ent

package
v0.0.0-...-20f649f Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: BSD-3-Clause Imports: 42 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.
	TypeAccessory             = "Accessory"
	TypeDeadline              = "Deadline"
	TypeEvent                 = "Event"
	TypeForum                 = "Forum"
	TypeForumPost             = "ForumPost"
	TypeGroup                 = "Group"
	TypeGroupInviteLink       = "GroupInviteLink"
	TypeGroupUser             = "GroupUser"
	TypeInstitution           = "Institution"
	TypeInstitutionInviteLink = "InstitutionInviteLink"
	TypeJWTRevocation         = "JWTRevocation"
	TypeMilestone             = "Milestone"
	TypePet                   = "Pet"
	TypeReaction              = "Reaction"
	TypeRedemption            = "Redemption"
	TypeStudyPlan             = "StudyPlan"
	TypeUser                  = "User"
	TypeUserPet               = "UserPet"
	TypeVoucher               = "Voucher"
)

Variables

This section is empty.

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 Accessories

type Accessories []*Accessory

Accessories is a parsable slice of Accessory.

type Accessory

type Accessory struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name of the prize
	Name string `json:"name,omitempty"`
	// Description of the prize
	Description string `json:"description,omitempty"`
	// Points required to redeem the prize
	PointsRequired int `json:"points_required,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AccessoryQuery when eager-loading is set.
	Edges AccessoryEdges `json:"edges"`
	// contains filtered or unexported fields
}

Accessory is the model entity for the Accessory schema.

func (*Accessory) QueryInstitution

func (a *Accessory) QueryInstitution() *InstitutionQuery

QueryInstitution queries the "institution" edge of the Accessory entity.

func (*Accessory) QueryRedemptions

func (a *Accessory) QueryRedemptions() *RedemptionQuery

QueryRedemptions queries the "redemptions" edge of the Accessory entity.

func (*Accessory) String

func (a *Accessory) String() string

String implements the fmt.Stringer.

func (*Accessory) Unwrap

func (a *Accessory) Unwrap() *Accessory

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

func (a *Accessory) Update() *AccessoryUpdateOne

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

func (*Accessory) Value

func (a *Accessory) Value(name string) (ent.Value, error)

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

type AccessoryClient

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

AccessoryClient is a client for the Accessory schema.

func NewAccessoryClient

func NewAccessoryClient(c config) *AccessoryClient

NewAccessoryClient returns a client for the Accessory from the given config.

func (*AccessoryClient) Create

func (c *AccessoryClient) Create() *AccessoryCreate

Create returns a builder for creating a Accessory entity.

func (*AccessoryClient) CreateBulk

func (c *AccessoryClient) CreateBulk(builders ...*AccessoryCreate) *AccessoryCreateBulk

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

func (*AccessoryClient) Delete

func (c *AccessoryClient) Delete() *AccessoryDelete

Delete returns a delete builder for Accessory.

func (*AccessoryClient) DeleteOne

func (c *AccessoryClient) DeleteOne(a *Accessory) *AccessoryDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AccessoryClient) DeleteOneID

func (c *AccessoryClient) DeleteOneID(id int) *AccessoryDeleteOne

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

func (*AccessoryClient) Get

func (c *AccessoryClient) Get(ctx context.Context, id int) (*Accessory, error)

Get returns a Accessory entity by its id.

func (*AccessoryClient) GetX

func (c *AccessoryClient) GetX(ctx context.Context, id int) *Accessory

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

func (*AccessoryClient) Hooks

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

Hooks returns the client hooks.

func (*AccessoryClient) Intercept

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

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

func (*AccessoryClient) Interceptors

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

Interceptors returns the client interceptors.

func (*AccessoryClient) Query

func (c *AccessoryClient) Query() *AccessoryQuery

Query returns a query builder for Accessory.

func (*AccessoryClient) QueryInstitution

func (c *AccessoryClient) QueryInstitution(a *Accessory) *InstitutionQuery

QueryInstitution queries the institution edge of a Accessory.

func (*AccessoryClient) QueryRedemptions

func (c *AccessoryClient) QueryRedemptions(a *Accessory) *RedemptionQuery

QueryRedemptions queries the redemptions edge of a Accessory.

func (*AccessoryClient) Update

func (c *AccessoryClient) Update() *AccessoryUpdate

Update returns an update builder for Accessory.

func (*AccessoryClient) UpdateOne

func (c *AccessoryClient) UpdateOne(a *Accessory) *AccessoryUpdateOne

UpdateOne returns an update builder for the given entity.

func (*AccessoryClient) UpdateOneID

func (c *AccessoryClient) UpdateOneID(id int) *AccessoryUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AccessoryClient) Use

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

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

type AccessoryCreate

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

AccessoryCreate is the builder for creating a Accessory entity.

func (*AccessoryCreate) AddRedemptionIDs

func (ac *AccessoryCreate) AddRedemptionIDs(ids ...int) *AccessoryCreate

AddRedemptionIDs adds the "redemptions" edge to the Redemption entity by IDs.

func (*AccessoryCreate) AddRedemptions

func (ac *AccessoryCreate) AddRedemptions(r ...*Redemption) *AccessoryCreate

AddRedemptions adds the "redemptions" edges to the Redemption entity.

func (*AccessoryCreate) Exec

func (ac *AccessoryCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*AccessoryCreate) ExecX

func (ac *AccessoryCreate) ExecX(ctx context.Context)

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

func (*AccessoryCreate) Mutation

func (ac *AccessoryCreate) Mutation() *AccessoryMutation

Mutation returns the AccessoryMutation object of the builder.

func (*AccessoryCreate) OnConflict

func (ac *AccessoryCreate) OnConflict(opts ...sql.ConflictOption) *AccessoryUpsertOne

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

client.Accessory.Create().
	SetName(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.AccessoryUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*AccessoryCreate) OnConflictColumns

func (ac *AccessoryCreate) OnConflictColumns(columns ...string) *AccessoryUpsertOne

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

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

func (*AccessoryCreate) Save

func (ac *AccessoryCreate) Save(ctx context.Context) (*Accessory, error)

Save creates the Accessory in the database.

func (*AccessoryCreate) SaveX

func (ac *AccessoryCreate) SaveX(ctx context.Context) *Accessory

SaveX calls Save and panics if Save returns an error.

func (*AccessoryCreate) SetDescription

func (ac *AccessoryCreate) SetDescription(s string) *AccessoryCreate

SetDescription sets the "description" field.

func (*AccessoryCreate) SetInstitution

func (ac *AccessoryCreate) SetInstitution(i *Institution) *AccessoryCreate

SetInstitution sets the "institution" edge to the Institution entity.

func (*AccessoryCreate) SetInstitutionID

func (ac *AccessoryCreate) SetInstitutionID(id int) *AccessoryCreate

SetInstitutionID sets the "institution" edge to the Institution entity by ID.

func (*AccessoryCreate) SetName

func (ac *AccessoryCreate) SetName(s string) *AccessoryCreate

SetName sets the "name" field.

func (*AccessoryCreate) SetPointsRequired

func (ac *AccessoryCreate) SetPointsRequired(i int) *AccessoryCreate

SetPointsRequired sets the "points_required" field.

type AccessoryCreateBulk

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

AccessoryCreateBulk is the builder for creating many Accessory entities in bulk.

func (*AccessoryCreateBulk) Exec

func (acb *AccessoryCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*AccessoryCreateBulk) ExecX

func (acb *AccessoryCreateBulk) ExecX(ctx context.Context)

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

func (*AccessoryCreateBulk) OnConflict

func (acb *AccessoryCreateBulk) OnConflict(opts ...sql.ConflictOption) *AccessoryUpsertBulk

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

client.Accessory.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.AccessoryUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*AccessoryCreateBulk) OnConflictColumns

func (acb *AccessoryCreateBulk) OnConflictColumns(columns ...string) *AccessoryUpsertBulk

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

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

func (*AccessoryCreateBulk) Save

func (acb *AccessoryCreateBulk) Save(ctx context.Context) ([]*Accessory, error)

Save creates the Accessory entities in the database.

func (*AccessoryCreateBulk) SaveX

func (acb *AccessoryCreateBulk) SaveX(ctx context.Context) []*Accessory

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

type AccessoryDelete

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

AccessoryDelete is the builder for deleting a Accessory entity.

func (*AccessoryDelete) Exec

func (ad *AccessoryDelete) Exec(ctx context.Context) (int, error)

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

func (*AccessoryDelete) ExecX

func (ad *AccessoryDelete) ExecX(ctx context.Context) int

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

func (*AccessoryDelete) Where

Where appends a list predicates to the AccessoryDelete builder.

type AccessoryDeleteOne

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

AccessoryDeleteOne is the builder for deleting a single Accessory entity.

func (*AccessoryDeleteOne) Exec

func (ado *AccessoryDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*AccessoryDeleteOne) ExecX

func (ado *AccessoryDeleteOne) ExecX(ctx context.Context)

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

func (*AccessoryDeleteOne) Where

Where appends a list predicates to the AccessoryDelete builder.

type AccessoryEdges

type AccessoryEdges struct {
	// Redemptions that involve this prize
	Redemptions []*Redemption `json:"redemptions,omitempty"`
	// Institution that owns this accessory
	Institution *Institution `json:"institution,omitempty"`
	// contains filtered or unexported fields
}

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

func (AccessoryEdges) InstitutionOrErr

func (e AccessoryEdges) InstitutionOrErr() (*Institution, error)

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

func (AccessoryEdges) RedemptionsOrErr

func (e AccessoryEdges) RedemptionsOrErr() ([]*Redemption, error)

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

type AccessoryGroupBy

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

AccessoryGroupBy is the group-by builder for Accessory entities.

func (*AccessoryGroupBy) Aggregate

func (agb *AccessoryGroupBy) Aggregate(fns ...AggregateFunc) *AccessoryGroupBy

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

func (*AccessoryGroupBy) Bool

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

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

func (*AccessoryGroupBy) BoolX

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

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

func (*AccessoryGroupBy) Bools

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

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

func (*AccessoryGroupBy) BoolsX

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

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

func (*AccessoryGroupBy) Float64

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

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

func (*AccessoryGroupBy) Float64X

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

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

func (*AccessoryGroupBy) Float64s

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

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

func (*AccessoryGroupBy) Float64sX

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

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

func (*AccessoryGroupBy) Int

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

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

func (*AccessoryGroupBy) IntX

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

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

func (*AccessoryGroupBy) Ints

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

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

func (*AccessoryGroupBy) IntsX

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

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

func (*AccessoryGroupBy) Scan

func (agb *AccessoryGroupBy) Scan(ctx context.Context, v any) error

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

func (*AccessoryGroupBy) ScanX

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

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

func (*AccessoryGroupBy) String

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

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

func (*AccessoryGroupBy) StringX

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

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

func (*AccessoryGroupBy) Strings

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

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

func (*AccessoryGroupBy) StringsX

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

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

type AccessoryMutation

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

AccessoryMutation represents an operation that mutates the Accessory nodes in the graph.

func (*AccessoryMutation) AddField

func (m *AccessoryMutation) 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 (*AccessoryMutation) AddPointsRequired

func (m *AccessoryMutation) AddPointsRequired(i int)

AddPointsRequired adds i to the "points_required" field.

func (*AccessoryMutation) AddRedemptionIDs

func (m *AccessoryMutation) AddRedemptionIDs(ids ...int)

AddRedemptionIDs adds the "redemptions" edge to the Redemption entity by ids.

func (*AccessoryMutation) AddedEdges

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

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

func (*AccessoryMutation) AddedField

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

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

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

func (*AccessoryMutation) AddedIDs

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

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

func (*AccessoryMutation) AddedPointsRequired

func (m *AccessoryMutation) AddedPointsRequired() (r int, exists bool)

AddedPointsRequired returns the value that was added to the "points_required" field in this mutation.

func (*AccessoryMutation) ClearEdge

func (m *AccessoryMutation) 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 (*AccessoryMutation) ClearField

func (m *AccessoryMutation) 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 (*AccessoryMutation) ClearInstitution

func (m *AccessoryMutation) ClearInstitution()

ClearInstitution clears the "institution" edge to the Institution entity.

func (*AccessoryMutation) ClearRedemptions

func (m *AccessoryMutation) ClearRedemptions()

ClearRedemptions clears the "redemptions" edge to the Redemption entity.

func (*AccessoryMutation) ClearedEdges

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

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

func (*AccessoryMutation) ClearedFields

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

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

func (AccessoryMutation) Client

func (m AccessoryMutation) 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 (*AccessoryMutation) Description

func (m *AccessoryMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*AccessoryMutation) EdgeCleared

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

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

func (*AccessoryMutation) Field

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

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

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

func (*AccessoryMutation) Fields

func (m *AccessoryMutation) 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 (*AccessoryMutation) ID

func (m *AccessoryMutation) ID() (id int, 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 (*AccessoryMutation) IDs

func (m *AccessoryMutation) IDs(ctx context.Context) ([]int, 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 (*AccessoryMutation) InstitutionCleared

func (m *AccessoryMutation) InstitutionCleared() bool

InstitutionCleared reports if the "institution" edge to the Institution entity was cleared.

func (*AccessoryMutation) InstitutionID

func (m *AccessoryMutation) InstitutionID() (id int, exists bool)

InstitutionID returns the "institution" edge ID in the mutation.

func (*AccessoryMutation) InstitutionIDs

func (m *AccessoryMutation) InstitutionIDs() (ids []int)

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

func (*AccessoryMutation) Name

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

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

func (*AccessoryMutation) OldDescription

func (m *AccessoryMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Accessory entity. If the Accessory 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 (*AccessoryMutation) OldField

func (m *AccessoryMutation) 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 (*AccessoryMutation) OldName

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

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

func (m *AccessoryMutation) OldPointsRequired(ctx context.Context) (v int, err error)

OldPointsRequired returns the old "points_required" field's value of the Accessory entity. If the Accessory 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 (*AccessoryMutation) Op

func (m *AccessoryMutation) Op() Op

Op returns the operation name.

func (*AccessoryMutation) PointsRequired

func (m *AccessoryMutation) PointsRequired() (r int, exists bool)

PointsRequired returns the value of the "points_required" field in the mutation.

func (*AccessoryMutation) RedemptionsCleared

func (m *AccessoryMutation) RedemptionsCleared() bool

RedemptionsCleared reports if the "redemptions" edge to the Redemption entity was cleared.

func (*AccessoryMutation) RedemptionsIDs

func (m *AccessoryMutation) RedemptionsIDs() (ids []int)

RedemptionsIDs returns the "redemptions" edge IDs in the mutation.

func (*AccessoryMutation) RemoveRedemptionIDs

func (m *AccessoryMutation) RemoveRedemptionIDs(ids ...int)

RemoveRedemptionIDs removes the "redemptions" edge to the Redemption entity by IDs.

func (*AccessoryMutation) RemovedEdges

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

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

func (*AccessoryMutation) RemovedIDs

func (m *AccessoryMutation) 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 (*AccessoryMutation) RemovedRedemptionsIDs

func (m *AccessoryMutation) RemovedRedemptionsIDs() (ids []int)

RemovedRedemptions returns the removed IDs of the "redemptions" edge to the Redemption entity.

func (*AccessoryMutation) ResetDescription

func (m *AccessoryMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*AccessoryMutation) ResetEdge

func (m *AccessoryMutation) 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 (*AccessoryMutation) ResetField

func (m *AccessoryMutation) 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 (*AccessoryMutation) ResetInstitution

func (m *AccessoryMutation) ResetInstitution()

ResetInstitution resets all changes to the "institution" edge.

func (*AccessoryMutation) ResetName

func (m *AccessoryMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*AccessoryMutation) ResetPointsRequired

func (m *AccessoryMutation) ResetPointsRequired()

ResetPointsRequired resets all changes to the "points_required" field.

func (*AccessoryMutation) ResetRedemptions

func (m *AccessoryMutation) ResetRedemptions()

ResetRedemptions resets all changes to the "redemptions" edge.

func (*AccessoryMutation) SetDescription

func (m *AccessoryMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*AccessoryMutation) SetField

func (m *AccessoryMutation) 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 (*AccessoryMutation) SetInstitutionID

func (m *AccessoryMutation) SetInstitutionID(id int)

SetInstitutionID sets the "institution" edge to the Institution entity by id.

func (*AccessoryMutation) SetName

func (m *AccessoryMutation) SetName(s string)

SetName sets the "name" field.

func (*AccessoryMutation) SetOp

func (m *AccessoryMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AccessoryMutation) SetPointsRequired

func (m *AccessoryMutation) SetPointsRequired(i int)

SetPointsRequired sets the "points_required" field.

func (AccessoryMutation) Tx

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

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

func (*AccessoryMutation) Type

func (m *AccessoryMutation) Type() string

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

func (*AccessoryMutation) Where

func (m *AccessoryMutation) Where(ps ...predicate.Accessory)

Where appends a list predicates to the AccessoryMutation builder.

func (*AccessoryMutation) WhereP

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

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

type AccessoryQuery

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

AccessoryQuery is the builder for querying Accessory entities.

func (*AccessoryQuery) Aggregate

func (aq *AccessoryQuery) Aggregate(fns ...AggregateFunc) *AccessorySelect

Aggregate returns a AccessorySelect configured with the given aggregations.

func (*AccessoryQuery) All

func (aq *AccessoryQuery) All(ctx context.Context) ([]*Accessory, error)

All executes the query and returns a list of Accessories.

func (*AccessoryQuery) AllX

func (aq *AccessoryQuery) AllX(ctx context.Context) []*Accessory

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

func (*AccessoryQuery) Clone

func (aq *AccessoryQuery) Clone() *AccessoryQuery

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

func (*AccessoryQuery) Count

func (aq *AccessoryQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*AccessoryQuery) CountX

func (aq *AccessoryQuery) CountX(ctx context.Context) int

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

func (*AccessoryQuery) Exist

func (aq *AccessoryQuery) Exist(ctx context.Context) (bool, error)

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

func (*AccessoryQuery) ExistX

func (aq *AccessoryQuery) ExistX(ctx context.Context) bool

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

func (*AccessoryQuery) First

func (aq *AccessoryQuery) First(ctx context.Context) (*Accessory, error)

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

func (*AccessoryQuery) FirstID

func (aq *AccessoryQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*AccessoryQuery) FirstIDX

func (aq *AccessoryQuery) FirstIDX(ctx context.Context) int

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

func (*AccessoryQuery) FirstX

func (aq *AccessoryQuery) FirstX(ctx context.Context) *Accessory

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

func (*AccessoryQuery) GroupBy

func (aq *AccessoryQuery) GroupBy(field string, fields ...string) *AccessoryGroupBy

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

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Accessory.Query().
	GroupBy(accessory.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AccessoryQuery) IDs

func (aq *AccessoryQuery) IDs(ctx context.Context) (ids []int, err error)

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

func (*AccessoryQuery) IDsX

func (aq *AccessoryQuery) IDsX(ctx context.Context) []int

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

func (*AccessoryQuery) Limit

func (aq *AccessoryQuery) Limit(limit int) *AccessoryQuery

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

func (*AccessoryQuery) Offset

func (aq *AccessoryQuery) Offset(offset int) *AccessoryQuery

Offset to start from.

func (*AccessoryQuery) Only

func (aq *AccessoryQuery) Only(ctx context.Context) (*Accessory, error)

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

func (*AccessoryQuery) OnlyID

func (aq *AccessoryQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*AccessoryQuery) OnlyIDX

func (aq *AccessoryQuery) OnlyIDX(ctx context.Context) int

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

func (*AccessoryQuery) OnlyX

func (aq *AccessoryQuery) OnlyX(ctx context.Context) *Accessory

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

func (*AccessoryQuery) Order

Order specifies how the records should be ordered.

func (*AccessoryQuery) QueryInstitution

func (aq *AccessoryQuery) QueryInstitution() *InstitutionQuery

QueryInstitution chains the current query on the "institution" edge.

func (*AccessoryQuery) QueryRedemptions

func (aq *AccessoryQuery) QueryRedemptions() *RedemptionQuery

QueryRedemptions chains the current query on the "redemptions" edge.

func (*AccessoryQuery) Select

func (aq *AccessoryQuery) Select(fields ...string) *AccessorySelect

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

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.Accessory.Query().
	Select(accessory.FieldName).
	Scan(ctx, &v)

func (*AccessoryQuery) Unique

func (aq *AccessoryQuery) Unique(unique bool) *AccessoryQuery

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

Where adds a new predicate for the AccessoryQuery builder.

func (*AccessoryQuery) WithInstitution

func (aq *AccessoryQuery) WithInstitution(opts ...func(*InstitutionQuery)) *AccessoryQuery

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

func (*AccessoryQuery) WithRedemptions

func (aq *AccessoryQuery) WithRedemptions(opts ...func(*RedemptionQuery)) *AccessoryQuery

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

type AccessorySelect

type AccessorySelect struct {
	*AccessoryQuery
	// contains filtered or unexported fields
}

AccessorySelect is the builder for selecting fields of Accessory entities.

func (*AccessorySelect) Aggregate

func (as *AccessorySelect) Aggregate(fns ...AggregateFunc) *AccessorySelect

Aggregate adds the given aggregation functions to the selector query.

func (*AccessorySelect) Bool

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

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

func (*AccessorySelect) BoolX

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

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

func (*AccessorySelect) Bools

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

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

func (*AccessorySelect) BoolsX

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

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

func (*AccessorySelect) Float64

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

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

func (*AccessorySelect) Float64X

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

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

func (*AccessorySelect) Float64s

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

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

func (*AccessorySelect) Float64sX

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

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

func (*AccessorySelect) Int

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

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

func (*AccessorySelect) IntX

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

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

func (*AccessorySelect) Ints

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

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

func (*AccessorySelect) IntsX

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

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

func (*AccessorySelect) Scan

func (as *AccessorySelect) Scan(ctx context.Context, v any) error

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

func (*AccessorySelect) ScanX

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

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

func (*AccessorySelect) String

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

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

func (*AccessorySelect) StringX

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

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

func (*AccessorySelect) Strings

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

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

func (*AccessorySelect) StringsX

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

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

type AccessoryUpdate

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

AccessoryUpdate is the builder for updating Accessory entities.

func (*AccessoryUpdate) AddPointsRequired

func (au *AccessoryUpdate) AddPointsRequired(i int) *AccessoryUpdate

AddPointsRequired adds i to the "points_required" field.

func (*AccessoryUpdate) AddRedemptionIDs

func (au *AccessoryUpdate) AddRedemptionIDs(ids ...int) *AccessoryUpdate

AddRedemptionIDs adds the "redemptions" edge to the Redemption entity by IDs.

func (*AccessoryUpdate) AddRedemptions

func (au *AccessoryUpdate) AddRedemptions(r ...*Redemption) *AccessoryUpdate

AddRedemptions adds the "redemptions" edges to the Redemption entity.

func (*AccessoryUpdate) ClearInstitution

func (au *AccessoryUpdate) ClearInstitution() *AccessoryUpdate

ClearInstitution clears the "institution" edge to the Institution entity.

func (*AccessoryUpdate) ClearRedemptions

func (au *AccessoryUpdate) ClearRedemptions() *AccessoryUpdate

ClearRedemptions clears all "redemptions" edges to the Redemption entity.

func (*AccessoryUpdate) Exec

func (au *AccessoryUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*AccessoryUpdate) ExecX

func (au *AccessoryUpdate) ExecX(ctx context.Context)

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

func (*AccessoryUpdate) Mutation

func (au *AccessoryUpdate) Mutation() *AccessoryMutation

Mutation returns the AccessoryMutation object of the builder.

func (*AccessoryUpdate) RemoveRedemptionIDs

func (au *AccessoryUpdate) RemoveRedemptionIDs(ids ...int) *AccessoryUpdate

RemoveRedemptionIDs removes the "redemptions" edge to Redemption entities by IDs.

func (*AccessoryUpdate) RemoveRedemptions

func (au *AccessoryUpdate) RemoveRedemptions(r ...*Redemption) *AccessoryUpdate

RemoveRedemptions removes "redemptions" edges to Redemption entities.

func (*AccessoryUpdate) Save

func (au *AccessoryUpdate) Save(ctx context.Context) (int, error)

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

func (*AccessoryUpdate) SaveX

func (au *AccessoryUpdate) SaveX(ctx context.Context) int

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

func (*AccessoryUpdate) SetDescription

func (au *AccessoryUpdate) SetDescription(s string) *AccessoryUpdate

SetDescription sets the "description" field.

func (*AccessoryUpdate) SetInstitution

func (au *AccessoryUpdate) SetInstitution(i *Institution) *AccessoryUpdate

SetInstitution sets the "institution" edge to the Institution entity.

func (*AccessoryUpdate) SetInstitutionID

func (au *AccessoryUpdate) SetInstitutionID(id int) *AccessoryUpdate

SetInstitutionID sets the "institution" edge to the Institution entity by ID.

func (*AccessoryUpdate) SetName

func (au *AccessoryUpdate) SetName(s string) *AccessoryUpdate

SetName sets the "name" field.

func (*AccessoryUpdate) SetPointsRequired

func (au *AccessoryUpdate) SetPointsRequired(i int) *AccessoryUpdate

SetPointsRequired sets the "points_required" field.

func (*AccessoryUpdate) Where

Where appends a list predicates to the AccessoryUpdate builder.

type AccessoryUpdateOne

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

AccessoryUpdateOne is the builder for updating a single Accessory entity.

func (*AccessoryUpdateOne) AddPointsRequired

func (auo *AccessoryUpdateOne) AddPointsRequired(i int) *AccessoryUpdateOne

AddPointsRequired adds i to the "points_required" field.

func (*AccessoryUpdateOne) AddRedemptionIDs

func (auo *AccessoryUpdateOne) AddRedemptionIDs(ids ...int) *AccessoryUpdateOne

AddRedemptionIDs adds the "redemptions" edge to the Redemption entity by IDs.

func (*AccessoryUpdateOne) AddRedemptions

func (auo *AccessoryUpdateOne) AddRedemptions(r ...*Redemption) *AccessoryUpdateOne

AddRedemptions adds the "redemptions" edges to the Redemption entity.

func (*AccessoryUpdateOne) ClearInstitution

func (auo *AccessoryUpdateOne) ClearInstitution() *AccessoryUpdateOne

ClearInstitution clears the "institution" edge to the Institution entity.

func (*AccessoryUpdateOne) ClearRedemptions

func (auo *AccessoryUpdateOne) ClearRedemptions() *AccessoryUpdateOne

ClearRedemptions clears all "redemptions" edges to the Redemption entity.

func (*AccessoryUpdateOne) Exec

func (auo *AccessoryUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*AccessoryUpdateOne) ExecX

func (auo *AccessoryUpdateOne) ExecX(ctx context.Context)

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

func (*AccessoryUpdateOne) Mutation

func (auo *AccessoryUpdateOne) Mutation() *AccessoryMutation

Mutation returns the AccessoryMutation object of the builder.

func (*AccessoryUpdateOne) RemoveRedemptionIDs

func (auo *AccessoryUpdateOne) RemoveRedemptionIDs(ids ...int) *AccessoryUpdateOne

RemoveRedemptionIDs removes the "redemptions" edge to Redemption entities by IDs.

func (*AccessoryUpdateOne) RemoveRedemptions

func (auo *AccessoryUpdateOne) RemoveRedemptions(r ...*Redemption) *AccessoryUpdateOne

RemoveRedemptions removes "redemptions" edges to Redemption entities.

func (*AccessoryUpdateOne) Save

func (auo *AccessoryUpdateOne) Save(ctx context.Context) (*Accessory, error)

Save executes the query and returns the updated Accessory entity.

func (*AccessoryUpdateOne) SaveX

func (auo *AccessoryUpdateOne) SaveX(ctx context.Context) *Accessory

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

func (*AccessoryUpdateOne) Select

func (auo *AccessoryUpdateOne) Select(field string, fields ...string) *AccessoryUpdateOne

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

func (*AccessoryUpdateOne) SetDescription

func (auo *AccessoryUpdateOne) SetDescription(s string) *AccessoryUpdateOne

SetDescription sets the "description" field.

func (*AccessoryUpdateOne) SetInstitution

func (auo *AccessoryUpdateOne) SetInstitution(i *Institution) *AccessoryUpdateOne

SetInstitution sets the "institution" edge to the Institution entity.

func (*AccessoryUpdateOne) SetInstitutionID

func (auo *AccessoryUpdateOne) SetInstitutionID(id int) *AccessoryUpdateOne

SetInstitutionID sets the "institution" edge to the Institution entity by ID.

func (*AccessoryUpdateOne) SetName

func (auo *AccessoryUpdateOne) SetName(s string) *AccessoryUpdateOne

SetName sets the "name" field.

func (*AccessoryUpdateOne) SetPointsRequired

func (auo *AccessoryUpdateOne) SetPointsRequired(i int) *AccessoryUpdateOne

SetPointsRequired sets the "points_required" field.

func (*AccessoryUpdateOne) Where

Where appends a list predicates to the AccessoryUpdate builder.

type AccessoryUpsert

type AccessoryUpsert struct {
	*sql.UpdateSet
}

AccessoryUpsert is the "OnConflict" setter.

func (*AccessoryUpsert) AddPointsRequired

func (u *AccessoryUpsert) AddPointsRequired(v int) *AccessoryUpsert

AddPointsRequired adds v to the "points_required" field.

func (*AccessoryUpsert) SetDescription

func (u *AccessoryUpsert) SetDescription(v string) *AccessoryUpsert

SetDescription sets the "description" field.

func (*AccessoryUpsert) SetName

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

SetName sets the "name" field.

func (*AccessoryUpsert) SetPointsRequired

func (u *AccessoryUpsert) SetPointsRequired(v int) *AccessoryUpsert

SetPointsRequired sets the "points_required" field.

func (*AccessoryUpsert) UpdateDescription

func (u *AccessoryUpsert) UpdateDescription() *AccessoryUpsert

UpdateDescription sets the "description" field to the value that was provided on create.

func (*AccessoryUpsert) UpdateName

func (u *AccessoryUpsert) UpdateName() *AccessoryUpsert

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

func (*AccessoryUpsert) UpdatePointsRequired

func (u *AccessoryUpsert) UpdatePointsRequired() *AccessoryUpsert

UpdatePointsRequired sets the "points_required" field to the value that was provided on create.

type AccessoryUpsertBulk

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

AccessoryUpsertBulk is the builder for "upsert"-ing a bulk of Accessory nodes.

func (*AccessoryUpsertBulk) AddPointsRequired

func (u *AccessoryUpsertBulk) AddPointsRequired(v int) *AccessoryUpsertBulk

AddPointsRequired adds v to the "points_required" field.

func (*AccessoryUpsertBulk) DoNothing

func (u *AccessoryUpsertBulk) DoNothing() *AccessoryUpsertBulk

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

func (*AccessoryUpsertBulk) Exec

Exec executes the query.

func (*AccessoryUpsertBulk) ExecX

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

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

func (*AccessoryUpsertBulk) Ignore

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

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

func (*AccessoryUpsertBulk) SetDescription

func (u *AccessoryUpsertBulk) SetDescription(v string) *AccessoryUpsertBulk

SetDescription sets the "description" field.

func (*AccessoryUpsertBulk) SetName

SetName sets the "name" field.

func (*AccessoryUpsertBulk) SetPointsRequired

func (u *AccessoryUpsertBulk) SetPointsRequired(v int) *AccessoryUpsertBulk

SetPointsRequired sets the "points_required" field.

func (*AccessoryUpsertBulk) Update

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

func (*AccessoryUpsertBulk) UpdateDescription

func (u *AccessoryUpsertBulk) UpdateDescription() *AccessoryUpsertBulk

UpdateDescription sets the "description" field to the value that was provided on create.

func (*AccessoryUpsertBulk) UpdateName

func (u *AccessoryUpsertBulk) UpdateName() *AccessoryUpsertBulk

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

func (*AccessoryUpsertBulk) UpdateNewValues

func (u *AccessoryUpsertBulk) UpdateNewValues() *AccessoryUpsertBulk

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

client.Accessory.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*AccessoryUpsertBulk) UpdatePointsRequired

func (u *AccessoryUpsertBulk) UpdatePointsRequired() *AccessoryUpsertBulk

UpdatePointsRequired sets the "points_required" field to the value that was provided on create.

type AccessoryUpsertOne

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

AccessoryUpsertOne is the builder for "upsert"-ing

one Accessory node.

func (*AccessoryUpsertOne) AddPointsRequired

func (u *AccessoryUpsertOne) AddPointsRequired(v int) *AccessoryUpsertOne

AddPointsRequired adds v to the "points_required" field.

func (*AccessoryUpsertOne) DoNothing

func (u *AccessoryUpsertOne) DoNothing() *AccessoryUpsertOne

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

func (*AccessoryUpsertOne) Exec

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

Exec executes the query.

func (*AccessoryUpsertOne) ExecX

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

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

func (*AccessoryUpsertOne) ID

func (u *AccessoryUpsertOne) ID(ctx context.Context) (id int, err error)

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

func (*AccessoryUpsertOne) IDX

func (u *AccessoryUpsertOne) IDX(ctx context.Context) int

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

func (*AccessoryUpsertOne) Ignore

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

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

func (*AccessoryUpsertOne) SetDescription

func (u *AccessoryUpsertOne) SetDescription(v string) *AccessoryUpsertOne

SetDescription sets the "description" field.

func (*AccessoryUpsertOne) SetName

SetName sets the "name" field.

func (*AccessoryUpsertOne) SetPointsRequired

func (u *AccessoryUpsertOne) SetPointsRequired(v int) *AccessoryUpsertOne

SetPointsRequired sets the "points_required" field.

func (*AccessoryUpsertOne) Update

func (u *AccessoryUpsertOne) Update(set func(*AccessoryUpsert)) *AccessoryUpsertOne

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

func (*AccessoryUpsertOne) UpdateDescription

func (u *AccessoryUpsertOne) UpdateDescription() *AccessoryUpsertOne

UpdateDescription sets the "description" field to the value that was provided on create.

func (*AccessoryUpsertOne) UpdateName

func (u *AccessoryUpsertOne) UpdateName() *AccessoryUpsertOne

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

func (*AccessoryUpsertOne) UpdateNewValues

func (u *AccessoryUpsertOne) UpdateNewValues() *AccessoryUpsertOne

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

client.Accessory.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*AccessoryUpsertOne) UpdatePointsRequired

func (u *AccessoryUpsertOne) UpdatePointsRequired() *AccessoryUpsertOne

UpdatePointsRequired sets the "points_required" field to the value that was provided on create.

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
	// Accessory is the client for interacting with the Accessory builders.
	Accessory *AccessoryClient
	// Deadline is the client for interacting with the Deadline builders.
	Deadline *DeadlineClient
	// Event is the client for interacting with the Event builders.
	Event *EventClient
	// Forum is the client for interacting with the Forum builders.
	Forum *ForumClient
	// ForumPost is the client for interacting with the ForumPost builders.
	ForumPost *ForumPostClient
	// Group is the client for interacting with the Group builders.
	Group *GroupClient
	// GroupInviteLink is the client for interacting with the GroupInviteLink builders.
	GroupInviteLink *GroupInviteLinkClient
	// GroupUser is the client for interacting with the GroupUser builders.
	GroupUser *GroupUserClient
	// Institution is the client for interacting with the Institution builders.
	Institution *InstitutionClient
	// InstitutionInviteLink is the client for interacting with the InstitutionInviteLink builders.
	InstitutionInviteLink *InstitutionInviteLinkClient
	// JWTRevocation is the client for interacting with the JWTRevocation builders.
	JWTRevocation *JWTRevocationClient
	// Milestone is the client for interacting with the Milestone builders.
	Milestone *MilestoneClient
	// Pet is the client for interacting with the Pet builders.
	Pet *PetClient
	// Reaction is the client for interacting with the Reaction builders.
	Reaction *ReactionClient
	// Redemption is the client for interacting with the Redemption builders.
	Redemption *RedemptionClient
	// StudyPlan is the client for interacting with the StudyPlan builders.
	StudyPlan *StudyPlanClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// UserPet is the client for interacting with the UserPet builders.
	UserPet *UserPetClient
	// Voucher is the client for interacting with the Voucher builders.
	Voucher *VoucherClient
	// 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().
	Accessory.
	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 Deadline

type Deadline struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name of the deadline
	Name string `json:"name,omitempty"`
	// Time when the deadline is due.
	// If there is no due time, set to nil
	DueTime *time.Time `json:"due_time,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the DeadlineQuery when eager-loading is set.
	Edges DeadlineEdges `json:"edges"`
	// contains filtered or unexported fields
}

Deadline is the model entity for the Deadline schema.

func (*Deadline) QueryAuthor

func (d *Deadline) QueryAuthor() *UserQuery

QueryAuthor queries the "author" edge of the Deadline entity.

func (*Deadline) QueryGroup

func (d *Deadline) QueryGroup() *GroupQuery

QueryGroup queries the "group" edge of the Deadline entity.

func (*Deadline) QueryVotedUsers

func (d *Deadline) QueryVotedUsers() *UserQuery

QueryVotedUsers queries the "voted_users" edge of the Deadline entity.

func (*Deadline) String

func (d *Deadline) String() string

String implements the fmt.Stringer.

func (*Deadline) Unwrap

func (d *Deadline) Unwrap() *Deadline

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

func (d *Deadline) Update() *DeadlineUpdateOne

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

func (*Deadline) Value

func (d *Deadline) Value(name string) (ent.Value, error)

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

type DeadlineClient

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

DeadlineClient is a client for the Deadline schema.

func NewDeadlineClient

func NewDeadlineClient(c config) *DeadlineClient

NewDeadlineClient returns a client for the Deadline from the given config.

func (*DeadlineClient) Create

func (c *DeadlineClient) Create() *DeadlineCreate

Create returns a builder for creating a Deadline entity.

func (*DeadlineClient) CreateBulk

func (c *DeadlineClient) CreateBulk(builders ...*DeadlineCreate) *DeadlineCreateBulk

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

func (*DeadlineClient) Delete

func (c *DeadlineClient) Delete() *DeadlineDelete

Delete returns a delete builder for Deadline.

func (*DeadlineClient) DeleteOne

func (c *DeadlineClient) DeleteOne(d *Deadline) *DeadlineDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DeadlineClient) DeleteOneID

func (c *DeadlineClient) DeleteOneID(id int) *DeadlineDeleteOne

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

func (*DeadlineClient) Get

func (c *DeadlineClient) Get(ctx context.Context, id int) (*Deadline, error)

Get returns a Deadline entity by its id.

func (*DeadlineClient) GetX

func (c *DeadlineClient) GetX(ctx context.Context, id int) *Deadline

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

func (*DeadlineClient) Hooks

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

Hooks returns the client hooks.

func (*DeadlineClient) Intercept

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

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

func (*DeadlineClient) Interceptors

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

Interceptors returns the client interceptors.

func (*DeadlineClient) Query

func (c *DeadlineClient) Query() *DeadlineQuery

Query returns a query builder for Deadline.

func (*DeadlineClient) QueryAuthor

func (c *DeadlineClient) QueryAuthor(d *Deadline) *UserQuery

QueryAuthor queries the author edge of a Deadline.

func (*DeadlineClient) QueryGroup

func (c *DeadlineClient) QueryGroup(d *Deadline) *GroupQuery

QueryGroup queries the group edge of a Deadline.

func (*DeadlineClient) QueryVotedUsers

func (c *DeadlineClient) QueryVotedUsers(d *Deadline) *UserQuery

QueryVotedUsers queries the voted_users edge of a Deadline.

func (*DeadlineClient) Update

func (c *DeadlineClient) Update() *DeadlineUpdate

Update returns an update builder for Deadline.

func (*DeadlineClient) UpdateOne

func (c *DeadlineClient) UpdateOne(d *Deadline) *DeadlineUpdateOne

UpdateOne returns an update builder for the given entity.

func (*DeadlineClient) UpdateOneID

func (c *DeadlineClient) UpdateOneID(id int) *DeadlineUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DeadlineClient) Use

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

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

type DeadlineCreate

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

DeadlineCreate is the builder for creating a Deadline entity.

func (*DeadlineCreate) AddVotedUserIDs

func (dc *DeadlineCreate) AddVotedUserIDs(ids ...int) *DeadlineCreate

AddVotedUserIDs adds the "voted_users" edge to the User entity by IDs.

func (*DeadlineCreate) AddVotedUsers

func (dc *DeadlineCreate) AddVotedUsers(u ...*User) *DeadlineCreate

AddVotedUsers adds the "voted_users" edges to the User entity.

func (*DeadlineCreate) Exec

func (dc *DeadlineCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*DeadlineCreate) ExecX

func (dc *DeadlineCreate) ExecX(ctx context.Context)

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

func (*DeadlineCreate) Mutation

func (dc *DeadlineCreate) Mutation() *DeadlineMutation

Mutation returns the DeadlineMutation object of the builder.

func (*DeadlineCreate) OnConflict

func (dc *DeadlineCreate) OnConflict(opts ...sql.ConflictOption) *DeadlineUpsertOne

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

client.Deadline.Create().
	SetName(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.DeadlineUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*DeadlineCreate) OnConflictColumns

func (dc *DeadlineCreate) OnConflictColumns(columns ...string) *DeadlineUpsertOne

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

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

func (*DeadlineCreate) Save

func (dc *DeadlineCreate) Save(ctx context.Context) (*Deadline, error)

Save creates the Deadline in the database.

func (*DeadlineCreate) SaveX

func (dc *DeadlineCreate) SaveX(ctx context.Context) *Deadline

SaveX calls Save and panics if Save returns an error.

func (*DeadlineCreate) SetAuthor

func (dc *DeadlineCreate) SetAuthor(u *User) *DeadlineCreate

SetAuthor sets the "author" edge to the User entity.

func (*DeadlineCreate) SetAuthorID

func (dc *DeadlineCreate) SetAuthorID(id int) *DeadlineCreate

SetAuthorID sets the "author" edge to the User entity by ID.

func (*DeadlineCreate) SetDueTime

func (dc *DeadlineCreate) SetDueTime(t time.Time) *DeadlineCreate

SetDueTime sets the "due_time" field.

func (*DeadlineCreate) SetGroup

func (dc *DeadlineCreate) SetGroup(g *Group) *DeadlineCreate

SetGroup sets the "group" edge to the Group entity.

func (*DeadlineCreate) SetGroupID

func (dc *DeadlineCreate) SetGroupID(id int) *DeadlineCreate

SetGroupID sets the "group" edge to the Group entity by ID.

func (*DeadlineCreate) SetName

func (dc *DeadlineCreate) SetName(s string) *DeadlineCreate

SetName sets the "name" field.

func (*DeadlineCreate) SetNillableDueTime

func (dc *DeadlineCreate) SetNillableDueTime(t *time.Time) *DeadlineCreate

SetNillableDueTime sets the "due_time" field if the given value is not nil.

type DeadlineCreateBulk

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

DeadlineCreateBulk is the builder for creating many Deadline entities in bulk.

func (*DeadlineCreateBulk) Exec

func (dcb *DeadlineCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*DeadlineCreateBulk) ExecX

func (dcb *DeadlineCreateBulk) ExecX(ctx context.Context)

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

func (*DeadlineCreateBulk) OnConflict

func (dcb *DeadlineCreateBulk) OnConflict(opts ...sql.ConflictOption) *DeadlineUpsertBulk

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

client.Deadline.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.DeadlineUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*DeadlineCreateBulk) OnConflictColumns

func (dcb *DeadlineCreateBulk) OnConflictColumns(columns ...string) *DeadlineUpsertBulk

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

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

func (*DeadlineCreateBulk) Save

func (dcb *DeadlineCreateBulk) Save(ctx context.Context) ([]*Deadline, error)

Save creates the Deadline entities in the database.

func (*DeadlineCreateBulk) SaveX

func (dcb *DeadlineCreateBulk) SaveX(ctx context.Context) []*Deadline

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

type DeadlineDelete

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

DeadlineDelete is the builder for deleting a Deadline entity.

func (*DeadlineDelete) Exec

func (dd *DeadlineDelete) Exec(ctx context.Context) (int, error)

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

func (*DeadlineDelete) ExecX

func (dd *DeadlineDelete) ExecX(ctx context.Context) int

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

func (*DeadlineDelete) Where

func (dd *DeadlineDelete) Where(ps ...predicate.Deadline) *DeadlineDelete

Where appends a list predicates to the DeadlineDelete builder.

type DeadlineDeleteOne

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

DeadlineDeleteOne is the builder for deleting a single Deadline entity.

func (*DeadlineDeleteOne) Exec

func (ddo *DeadlineDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DeadlineDeleteOne) ExecX

func (ddo *DeadlineDeleteOne) ExecX(ctx context.Context)

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

func (*DeadlineDeleteOne) Where

Where appends a list predicates to the DeadlineDelete builder.

type DeadlineEdges

type DeadlineEdges struct {
	// Author holds the value of the author edge.
	Author *User `json:"author,omitempty"`
	// Users who voted for this deadline
	VotedUsers []*User `json:"voted_users,omitempty"`
	// Group holds the value of the group edge.
	Group *Group `json:"group,omitempty"`
	// contains filtered or unexported fields
}

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

func (DeadlineEdges) AuthorOrErr

func (e DeadlineEdges) AuthorOrErr() (*User, error)

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

func (DeadlineEdges) GroupOrErr

func (e DeadlineEdges) GroupOrErr() (*Group, error)

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

func (DeadlineEdges) VotedUsersOrErr

func (e DeadlineEdges) VotedUsersOrErr() ([]*User, error)

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

type DeadlineGroupBy

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

DeadlineGroupBy is the group-by builder for Deadline entities.

func (*DeadlineGroupBy) Aggregate

func (dgb *DeadlineGroupBy) Aggregate(fns ...AggregateFunc) *DeadlineGroupBy

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

func (*DeadlineGroupBy) Bool

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

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

func (*DeadlineGroupBy) BoolX

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

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

func (*DeadlineGroupBy) Bools

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

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

func (*DeadlineGroupBy) BoolsX

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

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

func (*DeadlineGroupBy) Float64

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

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

func (*DeadlineGroupBy) Float64X

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

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

func (*DeadlineGroupBy) Float64s

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

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

func (*DeadlineGroupBy) Float64sX

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

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

func (*DeadlineGroupBy) Int

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

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

func (*DeadlineGroupBy) IntX

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

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

func (*DeadlineGroupBy) Ints

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

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

func (*DeadlineGroupBy) IntsX

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

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

func (*DeadlineGroupBy) Scan

func (dgb *DeadlineGroupBy) Scan(ctx context.Context, v any) error

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

func (*DeadlineGroupBy) ScanX

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

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

func (*DeadlineGroupBy) String

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

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

func (*DeadlineGroupBy) StringX

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

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

func (*DeadlineGroupBy) Strings

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

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

func (*DeadlineGroupBy) StringsX

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

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

type DeadlineMutation

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

DeadlineMutation represents an operation that mutates the Deadline nodes in the graph.

func (*DeadlineMutation) AddField

func (m *DeadlineMutation) 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 (*DeadlineMutation) AddVotedUserIDs

func (m *DeadlineMutation) AddVotedUserIDs(ids ...int)

AddVotedUserIDs adds the "voted_users" edge to the User entity by ids.

func (*DeadlineMutation) AddedEdges

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

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

func (*DeadlineMutation) AddedField

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

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

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

func (*DeadlineMutation) AddedIDs

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

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

func (*DeadlineMutation) AuthorCleared

func (m *DeadlineMutation) AuthorCleared() bool

AuthorCleared reports if the "author" edge to the User entity was cleared.

func (*DeadlineMutation) AuthorID

func (m *DeadlineMutation) AuthorID() (id int, exists bool)

AuthorID returns the "author" edge ID in the mutation.

func (*DeadlineMutation) AuthorIDs

func (m *DeadlineMutation) AuthorIDs() (ids []int)

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

func (*DeadlineMutation) ClearAuthor

func (m *DeadlineMutation) ClearAuthor()

ClearAuthor clears the "author" edge to the User entity.

func (*DeadlineMutation) ClearDueTime

func (m *DeadlineMutation) ClearDueTime()

ClearDueTime clears the value of the "due_time" field.

func (*DeadlineMutation) ClearEdge

func (m *DeadlineMutation) 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 (*DeadlineMutation) ClearField

func (m *DeadlineMutation) 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 (*DeadlineMutation) ClearGroup

func (m *DeadlineMutation) ClearGroup()

ClearGroup clears the "group" edge to the Group entity.

func (*DeadlineMutation) ClearVotedUsers

func (m *DeadlineMutation) ClearVotedUsers()

ClearVotedUsers clears the "voted_users" edge to the User entity.

func (*DeadlineMutation) ClearedEdges

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

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

func (*DeadlineMutation) ClearedFields

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

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

func (DeadlineMutation) Client

func (m DeadlineMutation) 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 (*DeadlineMutation) DueTime

func (m *DeadlineMutation) DueTime() (r time.Time, exists bool)

DueTime returns the value of the "due_time" field in the mutation.

func (*DeadlineMutation) DueTimeCleared

func (m *DeadlineMutation) DueTimeCleared() bool

DueTimeCleared returns if the "due_time" field was cleared in this mutation.

func (*DeadlineMutation) EdgeCleared

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

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

func (*DeadlineMutation) Field

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

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

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

func (*DeadlineMutation) Fields

func (m *DeadlineMutation) 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 (*DeadlineMutation) GroupCleared

func (m *DeadlineMutation) GroupCleared() bool

GroupCleared reports if the "group" edge to the Group entity was cleared.

func (*DeadlineMutation) GroupID

func (m *DeadlineMutation) GroupID() (id int, exists bool)

GroupID returns the "group" edge ID in the mutation.

func (*DeadlineMutation) GroupIDs

func (m *DeadlineMutation) GroupIDs() (ids []int)

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

func (*DeadlineMutation) ID

func (m *DeadlineMutation) ID() (id int, 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 (*DeadlineMutation) IDs

func (m *DeadlineMutation) IDs(ctx context.Context) ([]int, 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 (*DeadlineMutation) Name

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

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

func (*DeadlineMutation) OldDueTime

func (m *DeadlineMutation) OldDueTime(ctx context.Context) (v *time.Time, err error)

OldDueTime returns the old "due_time" field's value of the Deadline entity. If the Deadline 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 (*DeadlineMutation) OldField

func (m *DeadlineMutation) 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 (*DeadlineMutation) OldName

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

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

func (m *DeadlineMutation) Op() Op

Op returns the operation name.

func (*DeadlineMutation) RemoveVotedUserIDs

func (m *DeadlineMutation) RemoveVotedUserIDs(ids ...int)

RemoveVotedUserIDs removes the "voted_users" edge to the User entity by IDs.

func (*DeadlineMutation) RemovedEdges

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

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

func (*DeadlineMutation) RemovedIDs

func (m *DeadlineMutation) 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 (*DeadlineMutation) RemovedVotedUsersIDs

func (m *DeadlineMutation) RemovedVotedUsersIDs() (ids []int)

RemovedVotedUsers returns the removed IDs of the "voted_users" edge to the User entity.

func (*DeadlineMutation) ResetAuthor

func (m *DeadlineMutation) ResetAuthor()

ResetAuthor resets all changes to the "author" edge.

func (*DeadlineMutation) ResetDueTime

func (m *DeadlineMutation) ResetDueTime()

ResetDueTime resets all changes to the "due_time" field.

func (*DeadlineMutation) ResetEdge

func (m *DeadlineMutation) 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 (*DeadlineMutation) ResetField

func (m *DeadlineMutation) 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 (*DeadlineMutation) ResetGroup

func (m *DeadlineMutation) ResetGroup()

ResetGroup resets all changes to the "group" edge.

func (*DeadlineMutation) ResetName

func (m *DeadlineMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*DeadlineMutation) ResetVotedUsers

func (m *DeadlineMutation) ResetVotedUsers()

ResetVotedUsers resets all changes to the "voted_users" edge.

func (*DeadlineMutation) SetAuthorID

func (m *DeadlineMutation) SetAuthorID(id int)

SetAuthorID sets the "author" edge to the User entity by id.

func (*DeadlineMutation) SetDueTime

func (m *DeadlineMutation) SetDueTime(t time.Time)

SetDueTime sets the "due_time" field.

func (*DeadlineMutation) SetField

func (m *DeadlineMutation) 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 (*DeadlineMutation) SetGroupID

func (m *DeadlineMutation) SetGroupID(id int)

SetGroupID sets the "group" edge to the Group entity by id.

func (*DeadlineMutation) SetName

func (m *DeadlineMutation) SetName(s string)

SetName sets the "name" field.

func (*DeadlineMutation) SetOp

func (m *DeadlineMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (DeadlineMutation) Tx

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

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

func (*DeadlineMutation) Type

func (m *DeadlineMutation) Type() string

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

func (*DeadlineMutation) VotedUsersCleared

func (m *DeadlineMutation) VotedUsersCleared() bool

VotedUsersCleared reports if the "voted_users" edge to the User entity was cleared.

func (*DeadlineMutation) VotedUsersIDs

func (m *DeadlineMutation) VotedUsersIDs() (ids []int)

VotedUsersIDs returns the "voted_users" edge IDs in the mutation.

func (*DeadlineMutation) Where

func (m *DeadlineMutation) Where(ps ...predicate.Deadline)

Where appends a list predicates to the DeadlineMutation builder.

func (*DeadlineMutation) WhereP

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

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

type DeadlineQuery

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

DeadlineQuery is the builder for querying Deadline entities.

func (*DeadlineQuery) Aggregate

func (dq *DeadlineQuery) Aggregate(fns ...AggregateFunc) *DeadlineSelect

Aggregate returns a DeadlineSelect configured with the given aggregations.

func (*DeadlineQuery) All

func (dq *DeadlineQuery) All(ctx context.Context) ([]*Deadline, error)

All executes the query and returns a list of Deadlines.

func (*DeadlineQuery) AllX

func (dq *DeadlineQuery) AllX(ctx context.Context) []*Deadline

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

func (*DeadlineQuery) Clone

func (dq *DeadlineQuery) Clone() *DeadlineQuery

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

func (*DeadlineQuery) Count

func (dq *DeadlineQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DeadlineQuery) CountX

func (dq *DeadlineQuery) CountX(ctx context.Context) int

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

func (*DeadlineQuery) Exist

func (dq *DeadlineQuery) Exist(ctx context.Context) (bool, error)

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

func (*DeadlineQuery) ExistX

func (dq *DeadlineQuery) ExistX(ctx context.Context) bool

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

func (*DeadlineQuery) First

func (dq *DeadlineQuery) First(ctx context.Context) (*Deadline, error)

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

func (*DeadlineQuery) FirstID

func (dq *DeadlineQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*DeadlineQuery) FirstIDX

func (dq *DeadlineQuery) FirstIDX(ctx context.Context) int

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

func (*DeadlineQuery) FirstX

func (dq *DeadlineQuery) FirstX(ctx context.Context) *Deadline

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

func (*DeadlineQuery) GroupBy

func (dq *DeadlineQuery) GroupBy(field string, fields ...string) *DeadlineGroupBy

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

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Deadline.Query().
	GroupBy(deadline.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DeadlineQuery) IDs

func (dq *DeadlineQuery) IDs(ctx context.Context) (ids []int, err error)

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

func (*DeadlineQuery) IDsX

func (dq *DeadlineQuery) IDsX(ctx context.Context) []int

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

func (*DeadlineQuery) Limit

func (dq *DeadlineQuery) Limit(limit int) *DeadlineQuery

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

func (*DeadlineQuery) Offset

func (dq *DeadlineQuery) Offset(offset int) *DeadlineQuery

Offset to start from.

func (*DeadlineQuery) Only

func (dq *DeadlineQuery) Only(ctx context.Context) (*Deadline, error)

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

func (*DeadlineQuery) OnlyID

func (dq *DeadlineQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*DeadlineQuery) OnlyIDX

func (dq *DeadlineQuery) OnlyIDX(ctx context.Context) int

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

func (*DeadlineQuery) OnlyX

func (dq *DeadlineQuery) OnlyX(ctx context.Context) *Deadline

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

func (*DeadlineQuery) Order

Order specifies how the records should be ordered.

func (*DeadlineQuery) QueryAuthor

func (dq *DeadlineQuery) QueryAuthor() *UserQuery

QueryAuthor chains the current query on the "author" edge.

func (*DeadlineQuery) QueryGroup

func (dq *DeadlineQuery) QueryGroup() *GroupQuery

QueryGroup chains the current query on the "group" edge.

func (*DeadlineQuery) QueryVotedUsers

func (dq *DeadlineQuery) QueryVotedUsers() *UserQuery

QueryVotedUsers chains the current query on the "voted_users" edge.

func (*DeadlineQuery) Select

func (dq *DeadlineQuery) Select(fields ...string) *DeadlineSelect

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

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.Deadline.Query().
	Select(deadline.FieldName).
	Scan(ctx, &v)

func (*DeadlineQuery) Unique

func (dq *DeadlineQuery) Unique(unique bool) *DeadlineQuery

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

func (dq *DeadlineQuery) Where(ps ...predicate.Deadline) *DeadlineQuery

Where adds a new predicate for the DeadlineQuery builder.

func (*DeadlineQuery) WithAuthor

func (dq *DeadlineQuery) WithAuthor(opts ...func(*UserQuery)) *DeadlineQuery

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

func (*DeadlineQuery) WithGroup

func (dq *DeadlineQuery) WithGroup(opts ...func(*GroupQuery)) *DeadlineQuery

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

func (*DeadlineQuery) WithVotedUsers

func (dq *DeadlineQuery) WithVotedUsers(opts ...func(*UserQuery)) *DeadlineQuery

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

type DeadlineSelect

type DeadlineSelect struct {
	*DeadlineQuery
	// contains filtered or unexported fields
}

DeadlineSelect is the builder for selecting fields of Deadline entities.

func (*DeadlineSelect) Aggregate

func (ds *DeadlineSelect) Aggregate(fns ...AggregateFunc) *DeadlineSelect

Aggregate adds the given aggregation functions to the selector query.

func (*DeadlineSelect) Bool

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

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

func (*DeadlineSelect) BoolX

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

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

func (*DeadlineSelect) Bools

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

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

func (*DeadlineSelect) BoolsX

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

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

func (*DeadlineSelect) Float64

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

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

func (*DeadlineSelect) Float64X

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

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

func (*DeadlineSelect) Float64s

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

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

func (*DeadlineSelect) Float64sX

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

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

func (*DeadlineSelect) Int

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

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

func (*DeadlineSelect) IntX

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

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

func (*DeadlineSelect) Ints

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

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

func (*DeadlineSelect) IntsX

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

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

func (*DeadlineSelect) Scan

func (ds *DeadlineSelect) Scan(ctx context.Context, v any) error

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

func (*DeadlineSelect) ScanX

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

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

func (*DeadlineSelect) String

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

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

func (*DeadlineSelect) StringX

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

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

func (*DeadlineSelect) Strings

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

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

func (*DeadlineSelect) StringsX

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

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

type DeadlineUpdate

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

DeadlineUpdate is the builder for updating Deadline entities.

func (*DeadlineUpdate) AddVotedUserIDs

func (du *DeadlineUpdate) AddVotedUserIDs(ids ...int) *DeadlineUpdate

AddVotedUserIDs adds the "voted_users" edge to the User entity by IDs.

func (*DeadlineUpdate) AddVotedUsers

func (du *DeadlineUpdate) AddVotedUsers(u ...*User) *DeadlineUpdate

AddVotedUsers adds the "voted_users" edges to the User entity.

func (*DeadlineUpdate) ClearAuthor

func (du *DeadlineUpdate) ClearAuthor() *DeadlineUpdate

ClearAuthor clears the "author" edge to the User entity.

func (*DeadlineUpdate) ClearDueTime

func (du *DeadlineUpdate) ClearDueTime() *DeadlineUpdate

ClearDueTime clears the value of the "due_time" field.

func (*DeadlineUpdate) ClearGroup

func (du *DeadlineUpdate) ClearGroup() *DeadlineUpdate

ClearGroup clears the "group" edge to the Group entity.

func (*DeadlineUpdate) ClearVotedUsers

func (du *DeadlineUpdate) ClearVotedUsers() *DeadlineUpdate

ClearVotedUsers clears all "voted_users" edges to the User entity.

func (*DeadlineUpdate) Exec

func (du *DeadlineUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DeadlineUpdate) ExecX

func (du *DeadlineUpdate) ExecX(ctx context.Context)

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

func (*DeadlineUpdate) Mutation

func (du *DeadlineUpdate) Mutation() *DeadlineMutation

Mutation returns the DeadlineMutation object of the builder.

func (*DeadlineUpdate) RemoveVotedUserIDs

func (du *DeadlineUpdate) RemoveVotedUserIDs(ids ...int) *DeadlineUpdate

RemoveVotedUserIDs removes the "voted_users" edge to User entities by IDs.

func (*DeadlineUpdate) RemoveVotedUsers

func (du *DeadlineUpdate) RemoveVotedUsers(u ...*User) *DeadlineUpdate

RemoveVotedUsers removes "voted_users" edges to User entities.

func (*DeadlineUpdate) Save

func (du *DeadlineUpdate) Save(ctx context.Context) (int, error)

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

func (*DeadlineUpdate) SaveX

func (du *DeadlineUpdate) SaveX(ctx context.Context) int

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

func (*DeadlineUpdate) SetAuthor

func (du *DeadlineUpdate) SetAuthor(u *User) *DeadlineUpdate

SetAuthor sets the "author" edge to the User entity.

func (*DeadlineUpdate) SetAuthorID

func (du *DeadlineUpdate) SetAuthorID(id int) *DeadlineUpdate

SetAuthorID sets the "author" edge to the User entity by ID.

func (*DeadlineUpdate) SetDueTime

func (du *DeadlineUpdate) SetDueTime(t time.Time) *DeadlineUpdate

SetDueTime sets the "due_time" field.

func (*DeadlineUpdate) SetGroup

func (du *DeadlineUpdate) SetGroup(g *Group) *DeadlineUpdate

SetGroup sets the "group" edge to the Group entity.

func (*DeadlineUpdate) SetGroupID

func (du *DeadlineUpdate) SetGroupID(id int) *DeadlineUpdate

SetGroupID sets the "group" edge to the Group entity by ID.

func (*DeadlineUpdate) SetName

func (du *DeadlineUpdate) SetName(s string) *DeadlineUpdate

SetName sets the "name" field.

func (*DeadlineUpdate) SetNillableDueTime

func (du *DeadlineUpdate) SetNillableDueTime(t *time.Time) *DeadlineUpdate

SetNillableDueTime sets the "due_time" field if the given value is not nil.

func (*DeadlineUpdate) Where

func (du *DeadlineUpdate) Where(ps ...predicate.Deadline) *DeadlineUpdate

Where appends a list predicates to the DeadlineUpdate builder.

type DeadlineUpdateOne

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

DeadlineUpdateOne is the builder for updating a single Deadline entity.

func (*DeadlineUpdateOne) AddVotedUserIDs

func (duo *DeadlineUpdateOne) AddVotedUserIDs(ids ...int) *DeadlineUpdateOne

AddVotedUserIDs adds the "voted_users" edge to the User entity by IDs.

func (*DeadlineUpdateOne) AddVotedUsers

func (duo *DeadlineUpdateOne) AddVotedUsers(u ...*User) *DeadlineUpdateOne

AddVotedUsers adds the "voted_users" edges to the User entity.

func (*DeadlineUpdateOne) ClearAuthor

func (duo *DeadlineUpdateOne) ClearAuthor() *DeadlineUpdateOne

ClearAuthor clears the "author" edge to the User entity.

func (*DeadlineUpdateOne) ClearDueTime

func (duo *DeadlineUpdateOne) ClearDueTime() *DeadlineUpdateOne

ClearDueTime clears the value of the "due_time" field.

func (*DeadlineUpdateOne) ClearGroup

func (duo *DeadlineUpdateOne) ClearGroup() *DeadlineUpdateOne

ClearGroup clears the "group" edge to the Group entity.

func (*DeadlineUpdateOne) ClearVotedUsers

func (duo *DeadlineUpdateOne) ClearVotedUsers() *DeadlineUpdateOne

ClearVotedUsers clears all "voted_users" edges to the User entity.

func (*DeadlineUpdateOne) Exec

func (duo *DeadlineUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DeadlineUpdateOne) ExecX

func (duo *DeadlineUpdateOne) ExecX(ctx context.Context)

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

func (*DeadlineUpdateOne) Mutation

func (duo *DeadlineUpdateOne) Mutation() *DeadlineMutation

Mutation returns the DeadlineMutation object of the builder.

func (*DeadlineUpdateOne) RemoveVotedUserIDs

func (duo *DeadlineUpdateOne) RemoveVotedUserIDs(ids ...int) *DeadlineUpdateOne

RemoveVotedUserIDs removes the "voted_users" edge to User entities by IDs.

func (*DeadlineUpdateOne) RemoveVotedUsers

func (duo *DeadlineUpdateOne) RemoveVotedUsers(u ...*User) *DeadlineUpdateOne

RemoveVotedUsers removes "voted_users" edges to User entities.

func (*DeadlineUpdateOne) Save

func (duo *DeadlineUpdateOne) Save(ctx context.Context) (*Deadline, error)

Save executes the query and returns the updated Deadline entity.

func (*DeadlineUpdateOne) SaveX

func (duo *DeadlineUpdateOne) SaveX(ctx context.Context) *Deadline

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

func (*DeadlineUpdateOne) Select

func (duo *DeadlineUpdateOne) Select(field string, fields ...string) *DeadlineUpdateOne

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

func (*DeadlineUpdateOne) SetAuthor

func (duo *DeadlineUpdateOne) SetAuthor(u *User) *DeadlineUpdateOne

SetAuthor sets the "author" edge to the User entity.

func (*DeadlineUpdateOne) SetAuthorID

func (duo *DeadlineUpdateOne) SetAuthorID(id int) *DeadlineUpdateOne

SetAuthorID sets the "author" edge to the User entity by ID.

func (*DeadlineUpdateOne) SetDueTime

func (duo *DeadlineUpdateOne) SetDueTime(t time.Time) *DeadlineUpdateOne

SetDueTime sets the "due_time" field.

func (*DeadlineUpdateOne) SetGroup

func (duo *DeadlineUpdateOne) SetGroup(g *Group) *DeadlineUpdateOne

SetGroup sets the "group" edge to the Group entity.

func (*DeadlineUpdateOne) SetGroupID

func (duo *DeadlineUpdateOne) SetGroupID(id int) *DeadlineUpdateOne

SetGroupID sets the "group" edge to the Group entity by ID.

func (*DeadlineUpdateOne) SetName

func (duo *DeadlineUpdateOne) SetName(s string) *DeadlineUpdateOne

SetName sets the "name" field.

func (*DeadlineUpdateOne) SetNillableDueTime

func (duo *DeadlineUpdateOne) SetNillableDueTime(t *time.Time) *DeadlineUpdateOne

SetNillableDueTime sets the "due_time" field if the given value is not nil.

func (*DeadlineUpdateOne) Where

Where appends a list predicates to the DeadlineUpdate builder.

type DeadlineUpsert

type DeadlineUpsert struct {
	*sql.UpdateSet
}

DeadlineUpsert is the "OnConflict" setter.

func (*DeadlineUpsert) ClearDueTime

func (u *DeadlineUpsert) ClearDueTime() *DeadlineUpsert

ClearDueTime clears the value of the "due_time" field.

func (*DeadlineUpsert) SetDueTime

func (u *DeadlineUpsert) SetDueTime(v time.Time) *DeadlineUpsert

SetDueTime sets the "due_time" field.

func (*DeadlineUpsert) SetName

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

SetName sets the "name" field.

func (*DeadlineUpsert) UpdateDueTime

func (u *DeadlineUpsert) UpdateDueTime() *DeadlineUpsert

UpdateDueTime sets the "due_time" field to the value that was provided on create.

func (*DeadlineUpsert) UpdateName

func (u *DeadlineUpsert) UpdateName() *DeadlineUpsert

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

type DeadlineUpsertBulk

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

DeadlineUpsertBulk is the builder for "upsert"-ing a bulk of Deadline nodes.

func (*DeadlineUpsertBulk) ClearDueTime

func (u *DeadlineUpsertBulk) ClearDueTime() *DeadlineUpsertBulk

ClearDueTime clears the value of the "due_time" field.

func (*DeadlineUpsertBulk) DoNothing

func (u *DeadlineUpsertBulk) DoNothing() *DeadlineUpsertBulk

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

func (*DeadlineUpsertBulk) Exec

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

Exec executes the query.

func (*DeadlineUpsertBulk) ExecX

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

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

func (*DeadlineUpsertBulk) Ignore

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

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

func (*DeadlineUpsertBulk) SetDueTime

func (u *DeadlineUpsertBulk) SetDueTime(v time.Time) *DeadlineUpsertBulk

SetDueTime sets the "due_time" field.

func (*DeadlineUpsertBulk) SetName

SetName sets the "name" field.

func (*DeadlineUpsertBulk) Update

func (u *DeadlineUpsertBulk) Update(set func(*DeadlineUpsert)) *DeadlineUpsertBulk

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

func (*DeadlineUpsertBulk) UpdateDueTime

func (u *DeadlineUpsertBulk) UpdateDueTime() *DeadlineUpsertBulk

UpdateDueTime sets the "due_time" field to the value that was provided on create.

func (*DeadlineUpsertBulk) UpdateName

func (u *DeadlineUpsertBulk) UpdateName() *DeadlineUpsertBulk

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

func (*DeadlineUpsertBulk) UpdateNewValues

func (u *DeadlineUpsertBulk) UpdateNewValues() *DeadlineUpsertBulk

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

client.Deadline.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

type DeadlineUpsertOne

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

DeadlineUpsertOne is the builder for "upsert"-ing

one Deadline node.

func (*DeadlineUpsertOne) ClearDueTime

func (u *DeadlineUpsertOne) ClearDueTime() *DeadlineUpsertOne

ClearDueTime clears the value of the "due_time" field.

func (*DeadlineUpsertOne) DoNothing

func (u *DeadlineUpsertOne) DoNothing() *DeadlineUpsertOne

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

func (*DeadlineUpsertOne) Exec

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

Exec executes the query.

func (*DeadlineUpsertOne) ExecX

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

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

func (*DeadlineUpsertOne) ID

func (u *DeadlineUpsertOne) ID(ctx context.Context) (id int, err error)

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

func (*DeadlineUpsertOne) IDX

func (u *DeadlineUpsertOne) IDX(ctx context.Context) int

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

func (*DeadlineUpsertOne) Ignore

func (u *DeadlineUpsertOne) Ignore() *DeadlineUpsertOne

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

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

func (*DeadlineUpsertOne) SetDueTime

func (u *DeadlineUpsertOne) SetDueTime(v time.Time) *DeadlineUpsertOne

SetDueTime sets the "due_time" field.

func (*DeadlineUpsertOne) SetName

SetName sets the "name" field.

func (*DeadlineUpsertOne) Update

func (u *DeadlineUpsertOne) Update(set func(*DeadlineUpsert)) *DeadlineUpsertOne

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

func (*DeadlineUpsertOne) UpdateDueTime

func (u *DeadlineUpsertOne) UpdateDueTime() *DeadlineUpsertOne

UpdateDueTime sets the "due_time" field to the value that was provided on create.

func (*DeadlineUpsertOne) UpdateName

func (u *DeadlineUpsertOne) UpdateName() *DeadlineUpsertOne

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

func (*DeadlineUpsertOne) UpdateNewValues

func (u *DeadlineUpsertOne) UpdateNewValues() *DeadlineUpsertOne

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

client.Deadline.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

type Deadlines

type Deadlines []*Deadline

Deadlines is a parsable slice of Deadline.

type Event

type Event struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name of the event
	Name string `json:"name,omitempty"`
	// Start time of the event
	StartTime time.Time `json:"start_time,omitempty"`
	// End time of the event.
	// If event is all-day, set to nil
	EndTime *time.Time `json:"end_time,omitempty"`
	// Location of the event
	Location string `json:"location,omitempty"`
	// Repeat pattern of the event using cron syntax
	RepeatPattern string `json:"repeat_pattern,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the EventQuery when eager-loading is set.
	Edges EventEdges `json:"edges"`
	// contains filtered or unexported fields
}

Event is the model entity for the Event schema.

func (*Event) QueryGroup

func (e *Event) QueryGroup() *GroupQuery

QueryGroup queries the "group" edge of the Event entity.

func (*Event) String

func (e *Event) String() string

String implements the fmt.Stringer.

func (*Event) Unwrap

func (e *Event) Unwrap() *Event

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

func (e *Event) Update() *EventUpdateOne

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

func (*Event) Value

func (e *Event) Value(name string) (ent.Value, error)

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

type EventClient

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

EventClient is a client for the Event schema.

func NewEventClient

func NewEventClient(c config) *EventClient

NewEventClient returns a client for the Event from the given config.

func (*EventClient) Create

func (c *EventClient) Create() *EventCreate

Create returns a builder for creating a Event entity.

func (*EventClient) CreateBulk

func (c *EventClient) CreateBulk(builders ...*EventCreate) *EventCreateBulk

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

func (*EventClient) Delete

func (c *EventClient) Delete() *EventDelete

Delete returns a delete builder for Event.

func (*EventClient) DeleteOne

func (c *EventClient) DeleteOne(e *Event) *EventDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*EventClient) DeleteOneID

func (c *EventClient) DeleteOneID(id int) *EventDeleteOne

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

func (*EventClient) Get

func (c *EventClient) Get(ctx context.Context, id int) (*Event, error)

Get returns a Event entity by its id.

func (*EventClient) GetX

func (c *EventClient) GetX(ctx context.Context, id int) *Event

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

func (*EventClient) Hooks

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

Hooks returns the client hooks.

func (*EventClient) Intercept

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

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

func (*EventClient) Interceptors

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

Interceptors returns the client interceptors.

func (*EventClient) Query

func (c *EventClient) Query() *EventQuery

Query returns a query builder for Event.

func (*EventClient) QueryGroup

func (c *EventClient) QueryGroup(e *Event) *GroupQuery

QueryGroup queries the group edge of a Event.

func (*EventClient) Update

func (c *EventClient) Update() *EventUpdate

Update returns an update builder for Event.

func (*EventClient) UpdateOne

func (c *EventClient) UpdateOne(e *Event) *EventUpdateOne

UpdateOne returns an update builder for the given entity.

func (*EventClient) UpdateOneID

func (c *EventClient) UpdateOneID(id int) *EventUpdateOne

UpdateOneID returns an update builder for the given id.

func (*EventClient) Use

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

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

type EventCreate

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

EventCreate is the builder for creating a Event entity.

func (*EventCreate) Exec

func (ec *EventCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*EventCreate) ExecX

func (ec *EventCreate) ExecX(ctx context.Context)

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

func (*EventCreate) Mutation

func (ec *EventCreate) Mutation() *EventMutation

Mutation returns the EventMutation object of the builder.

func (*EventCreate) OnConflict

func (ec *EventCreate) OnConflict(opts ...sql.ConflictOption) *EventUpsertOne

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

client.Event.Create().
	SetName(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.EventUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*EventCreate) OnConflictColumns

func (ec *EventCreate) OnConflictColumns(columns ...string) *EventUpsertOne

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

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

func (*EventCreate) Save

func (ec *EventCreate) Save(ctx context.Context) (*Event, error)

Save creates the Event in the database.

func (*EventCreate) SaveX

func (ec *EventCreate) SaveX(ctx context.Context) *Event

SaveX calls Save and panics if Save returns an error.

func (*EventCreate) SetEndTime

func (ec *EventCreate) SetEndTime(t time.Time) *EventCreate

SetEndTime sets the "end_time" field.

func (*EventCreate) SetGroup

func (ec *EventCreate) SetGroup(g *Group) *EventCreate

SetGroup sets the "group" edge to the Group entity.

func (*EventCreate) SetGroupID

func (ec *EventCreate) SetGroupID(id int) *EventCreate

SetGroupID sets the "group" edge to the Group entity by ID.

func (*EventCreate) SetLocation

func (ec *EventCreate) SetLocation(s string) *EventCreate

SetLocation sets the "location" field.

func (*EventCreate) SetName

func (ec *EventCreate) SetName(s string) *EventCreate

SetName sets the "name" field.

func (*EventCreate) SetNillableEndTime

func (ec *EventCreate) SetNillableEndTime(t *time.Time) *EventCreate

SetNillableEndTime sets the "end_time" field if the given value is not nil.

func (*EventCreate) SetNillableLocation

func (ec *EventCreate) SetNillableLocation(s *string) *EventCreate

SetNillableLocation sets the "location" field if the given value is not nil.

func (*EventCreate) SetNillableRepeatPattern

func (ec *EventCreate) SetNillableRepeatPattern(s *string) *EventCreate

SetNillableRepeatPattern sets the "repeat_pattern" field if the given value is not nil.

func (*EventCreate) SetRepeatPattern

func (ec *EventCreate) SetRepeatPattern(s string) *EventCreate

SetRepeatPattern sets the "repeat_pattern" field.

func (*EventCreate) SetStartTime

func (ec *EventCreate) SetStartTime(t time.Time) *EventCreate

SetStartTime sets the "start_time" field.

type EventCreateBulk

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

EventCreateBulk is the builder for creating many Event entities in bulk.

func (*EventCreateBulk) Exec

func (ecb *EventCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*EventCreateBulk) ExecX

func (ecb *EventCreateBulk) ExecX(ctx context.Context)

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

func (*EventCreateBulk) OnConflict

func (ecb *EventCreateBulk) OnConflict(opts ...sql.ConflictOption) *EventUpsertBulk

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

client.Event.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.EventUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*EventCreateBulk) OnConflictColumns

func (ecb *EventCreateBulk) OnConflictColumns(columns ...string) *EventUpsertBulk

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

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

func (*EventCreateBulk) Save

func (ecb *EventCreateBulk) Save(ctx context.Context) ([]*Event, error)

Save creates the Event entities in the database.

func (*EventCreateBulk) SaveX

func (ecb *EventCreateBulk) SaveX(ctx context.Context) []*Event

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

type EventDelete

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

EventDelete is the builder for deleting a Event entity.

func (*EventDelete) Exec

func (ed *EventDelete) Exec(ctx context.Context) (int, error)

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

func (*EventDelete) ExecX

func (ed *EventDelete) ExecX(ctx context.Context) int

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

func (*EventDelete) Where

func (ed *EventDelete) Where(ps ...predicate.Event) *EventDelete

Where appends a list predicates to the EventDelete builder.

type EventDeleteOne

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

EventDeleteOne is the builder for deleting a single Event entity.

func (*EventDeleteOne) Exec

func (edo *EventDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*EventDeleteOne) ExecX

func (edo *EventDeleteOne) ExecX(ctx context.Context)

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

func (*EventDeleteOne) Where

func (edo *EventDeleteOne) Where(ps ...predicate.Event) *EventDeleteOne

Where appends a list predicates to the EventDelete builder.

type EventEdges

type EventEdges struct {
	// Group holds the value of the group edge.
	Group *Group `json:"group,omitempty"`
	// contains filtered or unexported fields
}

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

func (EventEdges) GroupOrErr

func (e EventEdges) GroupOrErr() (*Group, error)

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

type EventGroupBy

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

EventGroupBy is the group-by builder for Event entities.

func (*EventGroupBy) Aggregate

func (egb *EventGroupBy) Aggregate(fns ...AggregateFunc) *EventGroupBy

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

func (*EventGroupBy) Bool

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

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

func (*EventGroupBy) BoolX

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

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

func (*EventGroupBy) Bools

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

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

func (*EventGroupBy) BoolsX

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

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

func (*EventGroupBy) Float64

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

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

func (*EventGroupBy) Float64X

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

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

func (*EventGroupBy) Float64s

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

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

func (*EventGroupBy) Float64sX

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

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

func (*EventGroupBy) Int

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

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

func (*EventGroupBy) IntX

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

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

func (*EventGroupBy) Ints

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

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

func (*EventGroupBy) IntsX

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

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

func (*EventGroupBy) Scan

func (egb *EventGroupBy) Scan(ctx context.Context, v any) error

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

func (*EventGroupBy) ScanX

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

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

func (*EventGroupBy) String

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

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

func (*EventGroupBy) StringX

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

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

func (*EventGroupBy) Strings

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

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

func (*EventGroupBy) StringsX

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

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

type EventMutation

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

EventMutation represents an operation that mutates the Event nodes in the graph.

func (*EventMutation) AddField

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

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

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

func (*EventMutation) AddedField

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

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

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

func (*EventMutation) AddedIDs

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

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

func (*EventMutation) ClearEdge

func (m *EventMutation) 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 (*EventMutation) ClearEndTime

func (m *EventMutation) ClearEndTime()

ClearEndTime clears the value of the "end_time" field.

func (*EventMutation) ClearField

func (m *EventMutation) 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 (*EventMutation) ClearGroup

func (m *EventMutation) ClearGroup()

ClearGroup clears the "group" edge to the Group entity.

func (*EventMutation) ClearLocation

func (m *EventMutation) ClearLocation()

ClearLocation clears the value of the "location" field.

func (*EventMutation) ClearRepeatPattern

func (m *EventMutation) ClearRepeatPattern()

ClearRepeatPattern clears the value of the "repeat_pattern" field.

func (*EventMutation) ClearedEdges

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

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

func (*EventMutation) ClearedFields

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

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

func (EventMutation) Client

func (m EventMutation) 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 (*EventMutation) EdgeCleared

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

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

func (*EventMutation) EndTime

func (m *EventMutation) EndTime() (r time.Time, exists bool)

EndTime returns the value of the "end_time" field in the mutation.

func (*EventMutation) EndTimeCleared

func (m *EventMutation) EndTimeCleared() bool

EndTimeCleared returns if the "end_time" field was cleared in this mutation.

func (*EventMutation) Field

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

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

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

func (*EventMutation) Fields

func (m *EventMutation) 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 (*EventMutation) GroupCleared

func (m *EventMutation) GroupCleared() bool

GroupCleared reports if the "group" edge to the Group entity was cleared.

func (*EventMutation) GroupID

func (m *EventMutation) GroupID() (id int, exists bool)

GroupID returns the "group" edge ID in the mutation.

func (*EventMutation) GroupIDs

func (m *EventMutation) GroupIDs() (ids []int)

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

func (*EventMutation) ID

func (m *EventMutation) ID() (id int, 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 (*EventMutation) IDs

func (m *EventMutation) IDs(ctx context.Context) ([]int, 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 (*EventMutation) Location

func (m *EventMutation) Location() (r string, exists bool)

Location returns the value of the "location" field in the mutation.

func (*EventMutation) LocationCleared

func (m *EventMutation) LocationCleared() bool

LocationCleared returns if the "location" field was cleared in this mutation.

func (*EventMutation) Name

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

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

func (*EventMutation) OldEndTime

func (m *EventMutation) OldEndTime(ctx context.Context) (v *time.Time, err error)

OldEndTime returns the old "end_time" field's value of the Event entity. If the Event 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 (*EventMutation) OldField

func (m *EventMutation) 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 (*EventMutation) OldLocation

func (m *EventMutation) OldLocation(ctx context.Context) (v string, err error)

OldLocation returns the old "location" field's value of the Event entity. If the Event 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 (*EventMutation) OldName

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

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

func (m *EventMutation) OldRepeatPattern(ctx context.Context) (v string, err error)

OldRepeatPattern returns the old "repeat_pattern" field's value of the Event entity. If the Event 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 (*EventMutation) OldStartTime

func (m *EventMutation) OldStartTime(ctx context.Context) (v time.Time, err error)

OldStartTime returns the old "start_time" field's value of the Event entity. If the Event 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 (*EventMutation) Op

func (m *EventMutation) Op() Op

Op returns the operation name.

func (*EventMutation) RemovedEdges

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

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

func (*EventMutation) RemovedIDs

func (m *EventMutation) 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 (*EventMutation) RepeatPattern

func (m *EventMutation) RepeatPattern() (r string, exists bool)

RepeatPattern returns the value of the "repeat_pattern" field in the mutation.

func (*EventMutation) RepeatPatternCleared

func (m *EventMutation) RepeatPatternCleared() bool

RepeatPatternCleared returns if the "repeat_pattern" field was cleared in this mutation.

func (*EventMutation) ResetEdge

func (m *EventMutation) 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 (*EventMutation) ResetEndTime

func (m *EventMutation) ResetEndTime()

ResetEndTime resets all changes to the "end_time" field.

func (*EventMutation) ResetField

func (m *EventMutation) 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 (*EventMutation) ResetGroup

func (m *EventMutation) ResetGroup()

ResetGroup resets all changes to the "group" edge.

func (*EventMutation) ResetLocation

func (m *EventMutation) ResetLocation()

ResetLocation resets all changes to the "location" field.

func (*EventMutation) ResetName

func (m *EventMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*EventMutation) ResetRepeatPattern

func (m *EventMutation) ResetRepeatPattern()

ResetRepeatPattern resets all changes to the "repeat_pattern" field.

func (*EventMutation) ResetStartTime

func (m *EventMutation) ResetStartTime()

ResetStartTime resets all changes to the "start_time" field.

func (*EventMutation) SetEndTime

func (m *EventMutation) SetEndTime(t time.Time)

SetEndTime sets the "end_time" field.

func (*EventMutation) SetField

func (m *EventMutation) 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 (*EventMutation) SetGroupID

func (m *EventMutation) SetGroupID(id int)

SetGroupID sets the "group" edge to the Group entity by id.

func (*EventMutation) SetLocation

func (m *EventMutation) SetLocation(s string)

SetLocation sets the "location" field.

func (*EventMutation) SetName

func (m *EventMutation) SetName(s string)

SetName sets the "name" field.

func (*EventMutation) SetOp

func (m *EventMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*EventMutation) SetRepeatPattern

func (m *EventMutation) SetRepeatPattern(s string)

SetRepeatPattern sets the "repeat_pattern" field.

func (*EventMutation) SetStartTime

func (m *EventMutation) SetStartTime(t time.Time)

SetStartTime sets the "start_time" field.

func (*EventMutation) StartTime

func (m *EventMutation) StartTime() (r time.Time, exists bool)

StartTime returns the value of the "start_time" field in the mutation.

func (EventMutation) Tx

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

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

func (*EventMutation) Type

func (m *EventMutation) Type() string

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

func (*EventMutation) Where

func (m *EventMutation) Where(ps ...predicate.Event)

Where appends a list predicates to the EventMutation builder.

func (*EventMutation) WhereP

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

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

type EventQuery

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

EventQuery is the builder for querying Event entities.

func (*EventQuery) Aggregate

func (eq *EventQuery) Aggregate(fns ...AggregateFunc) *EventSelect

Aggregate returns a EventSelect configured with the given aggregations.

func (*EventQuery) All

func (eq *EventQuery) All(ctx context.Context) ([]*Event, error)

All executes the query and returns a list of Events.

func (*EventQuery) AllX

func (eq *EventQuery) AllX(ctx context.Context) []*Event

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

func (*EventQuery) Clone

func (eq *EventQuery) Clone() *EventQuery

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

func (*EventQuery) Count

func (eq *EventQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*EventQuery) CountX

func (eq *EventQuery) CountX(ctx context.Context) int

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

func (*EventQuery) Exist

func (eq *EventQuery) Exist(ctx context.Context) (bool, error)

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

func (*EventQuery) ExistX

func (eq *EventQuery) ExistX(ctx context.Context) bool

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

func (*EventQuery) First

func (eq *EventQuery) First(ctx context.Context) (*Event, error)

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

func (*EventQuery) FirstID

func (eq *EventQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*EventQuery) FirstIDX

func (eq *EventQuery) FirstIDX(ctx context.Context) int

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

func (*EventQuery) FirstX

func (eq *EventQuery) FirstX(ctx context.Context) *Event

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

func (*EventQuery) GroupBy

func (eq *EventQuery) GroupBy(field string, fields ...string) *EventGroupBy

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

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Event.Query().
	GroupBy(event.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*EventQuery) IDs

func (eq *EventQuery) IDs(ctx context.Context) (ids []int, err error)

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

func (*EventQuery) IDsX

func (eq *EventQuery) IDsX(ctx context.Context) []int

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

func (*EventQuery) Limit

func (eq *EventQuery) Limit(limit int) *EventQuery

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

func (*EventQuery) Offset

func (eq *EventQuery) Offset(offset int) *EventQuery

Offset to start from.

func (*EventQuery) Only

func (eq *EventQuery) Only(ctx context.Context) (*Event, error)

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

func (*EventQuery) OnlyID

func (eq *EventQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*EventQuery) OnlyIDX

func (eq *EventQuery) OnlyIDX(ctx context.Context) int

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

func (*EventQuery) OnlyX

func (eq *EventQuery) OnlyX(ctx context.Context) *Event

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

func (*EventQuery) Order

func (eq *EventQuery) Order(o ...event.OrderOption) *EventQuery

Order specifies how the records should be ordered.

func (*EventQuery) QueryGroup

func (eq *EventQuery) QueryGroup() *GroupQuery

QueryGroup chains the current query on the "group" edge.

func (*EventQuery) Select

func (eq *EventQuery) Select(fields ...string) *EventSelect

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

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.Event.Query().
	Select(event.FieldName).
	Scan(ctx, &v)

func (*EventQuery) Unique

func (eq *EventQuery) Unique(unique bool) *EventQuery

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

func (eq *EventQuery) Where(ps ...predicate.Event) *EventQuery

Where adds a new predicate for the EventQuery builder.

func (*EventQuery) WithGroup

func (eq *EventQuery) WithGroup(opts ...func(*GroupQuery)) *EventQuery

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

type EventSelect

type EventSelect struct {
	*EventQuery
	// contains filtered or unexported fields
}

EventSelect is the builder for selecting fields of Event entities.

func (*EventSelect) Aggregate

func (es *EventSelect) Aggregate(fns ...AggregateFunc) *EventSelect

Aggregate adds the given aggregation functions to the selector query.

func (*EventSelect) Bool

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

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

func (*EventSelect) BoolX

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

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

func (*EventSelect) Bools

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

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

func (*EventSelect) BoolsX

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

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

func (*EventSelect) Float64

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

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

func (*EventSelect) Float64X

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

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

func (*EventSelect) Float64s

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

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

func (*EventSelect) Float64sX

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

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

func (*EventSelect) Int

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

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

func (*EventSelect) IntX

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

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

func (*EventSelect) Ints

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

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

func (*EventSelect) IntsX

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

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

func (*EventSelect) Scan

func (es *EventSelect) Scan(ctx context.Context, v any) error

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

func (*EventSelect) ScanX

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

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

func (*EventSelect) String

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

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

func (*EventSelect) StringX

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

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

func (*EventSelect) Strings

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

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

func (*EventSelect) StringsX

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

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

type EventUpdate

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

EventUpdate is the builder for updating Event entities.

func (*EventUpdate) ClearEndTime

func (eu *EventUpdate) ClearEndTime() *EventUpdate

ClearEndTime clears the value of the "end_time" field.

func (*EventUpdate) ClearGroup

func (eu *EventUpdate) ClearGroup() *EventUpdate

ClearGroup clears the "group" edge to the Group entity.

func (*EventUpdate) ClearLocation

func (eu *EventUpdate) ClearLocation() *EventUpdate

ClearLocation clears the value of the "location" field.

func (*EventUpdate) ClearRepeatPattern

func (eu *EventUpdate) ClearRepeatPattern() *EventUpdate

ClearRepeatPattern clears the value of the "repeat_pattern" field.

func (*EventUpdate) Exec

func (eu *EventUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*EventUpdate) ExecX

func (eu *EventUpdate) ExecX(ctx context.Context)

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

func (*EventUpdate) Mutation

func (eu *EventUpdate) Mutation() *EventMutation

Mutation returns the EventMutation object of the builder.

func (*EventUpdate) Save

func (eu *EventUpdate) Save(ctx context.Context) (int, error)

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

func (*EventUpdate) SaveX

func (eu *EventUpdate) SaveX(ctx context.Context) int

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

func (*EventUpdate) SetEndTime

func (eu *EventUpdate) SetEndTime(t time.Time) *EventUpdate

SetEndTime sets the "end_time" field.

func (*EventUpdate) SetGroup

func (eu *EventUpdate) SetGroup(g *Group) *EventUpdate

SetGroup sets the "group" edge to the Group entity.

func (*EventUpdate) SetGroupID

func (eu *EventUpdate) SetGroupID(id int) *EventUpdate

SetGroupID sets the "group" edge to the Group entity by ID.

func (*EventUpdate) SetLocation

func (eu *EventUpdate) SetLocation(s string) *EventUpdate

SetLocation sets the "location" field.

func (*EventUpdate) SetName

func (eu *EventUpdate) SetName(s string) *EventUpdate

SetName sets the "name" field.

func (*EventUpdate) SetNillableEndTime

func (eu *EventUpdate) SetNillableEndTime(t *time.Time) *EventUpdate

SetNillableEndTime sets the "end_time" field if the given value is not nil.

func (*EventUpdate) SetNillableLocation

func (eu *EventUpdate) SetNillableLocation(s *string) *EventUpdate

SetNillableLocation sets the "location" field if the given value is not nil.

func (*EventUpdate) SetNillableRepeatPattern

func (eu *EventUpdate) SetNillableRepeatPattern(s *string) *EventUpdate

SetNillableRepeatPattern sets the "repeat_pattern" field if the given value is not nil.

func (*EventUpdate) SetRepeatPattern

func (eu *EventUpdate) SetRepeatPattern(s string) *EventUpdate

SetRepeatPattern sets the "repeat_pattern" field.

func (*EventUpdate) SetStartTime

func (eu *EventUpdate) SetStartTime(t time.Time) *EventUpdate

SetStartTime sets the "start_time" field.

func (*EventUpdate) Where

func (eu *EventUpdate) Where(ps ...predicate.Event) *EventUpdate

Where appends a list predicates to the EventUpdate builder.

type EventUpdateOne

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

EventUpdateOne is the builder for updating a single Event entity.

func (*EventUpdateOne) ClearEndTime

func (euo *EventUpdateOne) ClearEndTime() *EventUpdateOne

ClearEndTime clears the value of the "end_time" field.

func (*EventUpdateOne) ClearGroup

func (euo *EventUpdateOne) ClearGroup() *EventUpdateOne

ClearGroup clears the "group" edge to the Group entity.

func (*EventUpdateOne) ClearLocation

func (euo *EventUpdateOne) ClearLocation() *EventUpdateOne

ClearLocation clears the value of the "location" field.

func (*EventUpdateOne) ClearRepeatPattern

func (euo *EventUpdateOne) ClearRepeatPattern() *EventUpdateOne

ClearRepeatPattern clears the value of the "repeat_pattern" field.

func (*EventUpdateOne) Exec

func (euo *EventUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*EventUpdateOne) ExecX

func (euo *EventUpdateOne) ExecX(ctx context.Context)

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

func (*EventUpdateOne) Mutation

func (euo *EventUpdateOne) Mutation() *EventMutation

Mutation returns the EventMutation object of the builder.

func (*EventUpdateOne) Save

func (euo *EventUpdateOne) Save(ctx context.Context) (*Event, error)

Save executes the query and returns the updated Event entity.

func (*EventUpdateOne) SaveX

func (euo *EventUpdateOne) SaveX(ctx context.Context) *Event

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

func (*EventUpdateOne) Select

func (euo *EventUpdateOne) Select(field string, fields ...string) *EventUpdateOne

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

func (*EventUpdateOne) SetEndTime

func (euo *EventUpdateOne) SetEndTime(t time.Time) *EventUpdateOne

SetEndTime sets the "end_time" field.

func (*EventUpdateOne) SetGroup

func (euo *EventUpdateOne) SetGroup(g *Group) *EventUpdateOne

SetGroup sets the "group" edge to the Group entity.

func (*EventUpdateOne) SetGroupID

func (euo *EventUpdateOne) SetGroupID(id int) *EventUpdateOne

SetGroupID sets the "group" edge to the Group entity by ID.

func (*EventUpdateOne) SetLocation

func (euo *EventUpdateOne) SetLocation(s string) *EventUpdateOne

SetLocation sets the "location" field.

func (*EventUpdateOne) SetName

func (euo *EventUpdateOne) SetName(s string) *EventUpdateOne

SetName sets the "name" field.

func (*EventUpdateOne) SetNillableEndTime

func (euo *EventUpdateOne) SetNillableEndTime(t *time.Time) *EventUpdateOne

SetNillableEndTime sets the "end_time" field if the given value is not nil.

func (*EventUpdateOne) SetNillableLocation

func (euo *EventUpdateOne) SetNillableLocation(s *string) *EventUpdateOne

SetNillableLocation sets the "location" field if the given value is not nil.

func (*EventUpdateOne) SetNillableRepeatPattern

func (euo *EventUpdateOne) SetNillableRepeatPattern(s *string) *EventUpdateOne

SetNillableRepeatPattern sets the "repeat_pattern" field if the given value is not nil.

func (*EventUpdateOne) SetRepeatPattern

func (euo *EventUpdateOne) SetRepeatPattern(s string) *EventUpdateOne

SetRepeatPattern sets the "repeat_pattern" field.

func (*EventUpdateOne) SetStartTime

func (euo *EventUpdateOne) SetStartTime(t time.Time) *EventUpdateOne

SetStartTime sets the "start_time" field.

func (*EventUpdateOne) Where

func (euo *EventUpdateOne) Where(ps ...predicate.Event) *EventUpdateOne

Where appends a list predicates to the EventUpdate builder.

type EventUpsert

type EventUpsert struct {
	*sql.UpdateSet
}

EventUpsert is the "OnConflict" setter.

func (*EventUpsert) ClearEndTime

func (u *EventUpsert) ClearEndTime() *EventUpsert

ClearEndTime clears the value of the "end_time" field.

func (*EventUpsert) ClearLocation

func (u *EventUpsert) ClearLocation() *EventUpsert

ClearLocation clears the value of the "location" field.

func (*EventUpsert) ClearRepeatPattern

func (u *EventUpsert) ClearRepeatPattern() *EventUpsert

ClearRepeatPattern clears the value of the "repeat_pattern" field.

func (*EventUpsert) SetEndTime

func (u *EventUpsert) SetEndTime(v time.Time) *EventUpsert

SetEndTime sets the "end_time" field.

func (*EventUpsert) SetLocation

func (u *EventUpsert) SetLocation(v string) *EventUpsert

SetLocation sets the "location" field.

func (*EventUpsert) SetName

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

SetName sets the "name" field.

func (*EventUpsert) SetRepeatPattern

func (u *EventUpsert) SetRepeatPattern(v string) *EventUpsert

SetRepeatPattern sets the "repeat_pattern" field.

func (*EventUpsert) SetStartTime

func (u *EventUpsert) SetStartTime(v time.Time) *EventUpsert

SetStartTime sets the "start_time" field.

func (*EventUpsert) UpdateEndTime

func (u *EventUpsert) UpdateEndTime() *EventUpsert

UpdateEndTime sets the "end_time" field to the value that was provided on create.

func (*EventUpsert) UpdateLocation

func (u *EventUpsert) UpdateLocation() *EventUpsert

UpdateLocation sets the "location" field to the value that was provided on create.

func (*EventUpsert) UpdateName

func (u *EventUpsert) UpdateName() *EventUpsert

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

func (*EventUpsert) UpdateRepeatPattern

func (u *EventUpsert) UpdateRepeatPattern() *EventUpsert

UpdateRepeatPattern sets the "repeat_pattern" field to the value that was provided on create.

func (*EventUpsert) UpdateStartTime

func (u *EventUpsert) UpdateStartTime() *EventUpsert

UpdateStartTime sets the "start_time" field to the value that was provided on create.

type EventUpsertBulk

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

EventUpsertBulk is the builder for "upsert"-ing a bulk of Event nodes.

func (*EventUpsertBulk) ClearEndTime

func (u *EventUpsertBulk) ClearEndTime() *EventUpsertBulk

ClearEndTime clears the value of the "end_time" field.

func (*EventUpsertBulk) ClearLocation

func (u *EventUpsertBulk) ClearLocation() *EventUpsertBulk

ClearLocation clears the value of the "location" field.

func (*EventUpsertBulk) ClearRepeatPattern

func (u *EventUpsertBulk) ClearRepeatPattern() *EventUpsertBulk

ClearRepeatPattern clears the value of the "repeat_pattern" field.

func (*EventUpsertBulk) DoNothing

func (u *EventUpsertBulk) DoNothing() *EventUpsertBulk

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

func (*EventUpsertBulk) Exec

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

Exec executes the query.

func (*EventUpsertBulk) ExecX

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

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

func (*EventUpsertBulk) Ignore

func (u *EventUpsertBulk) Ignore() *EventUpsertBulk

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

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

func (*EventUpsertBulk) SetEndTime

func (u *EventUpsertBulk) SetEndTime(v time.Time) *EventUpsertBulk

SetEndTime sets the "end_time" field.

func (*EventUpsertBulk) SetLocation

func (u *EventUpsertBulk) SetLocation(v string) *EventUpsertBulk

SetLocation sets the "location" field.

func (*EventUpsertBulk) SetName

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

SetName sets the "name" field.

func (*EventUpsertBulk) SetRepeatPattern

func (u *EventUpsertBulk) SetRepeatPattern(v string) *EventUpsertBulk

SetRepeatPattern sets the "repeat_pattern" field.

func (*EventUpsertBulk) SetStartTime

func (u *EventUpsertBulk) SetStartTime(v time.Time) *EventUpsertBulk

SetStartTime sets the "start_time" field.

func (*EventUpsertBulk) Update

func (u *EventUpsertBulk) Update(set func(*EventUpsert)) *EventUpsertBulk

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

func (*EventUpsertBulk) UpdateEndTime

func (u *EventUpsertBulk) UpdateEndTime() *EventUpsertBulk

UpdateEndTime sets the "end_time" field to the value that was provided on create.

func (*EventUpsertBulk) UpdateLocation

func (u *EventUpsertBulk) UpdateLocation() *EventUpsertBulk

UpdateLocation sets the "location" field to the value that was provided on create.

func (*EventUpsertBulk) UpdateName

func (u *EventUpsertBulk) UpdateName() *EventUpsertBulk

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

func (*EventUpsertBulk) UpdateNewValues

func (u *EventUpsertBulk) UpdateNewValues() *EventUpsertBulk

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

client.Event.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*EventUpsertBulk) UpdateRepeatPattern

func (u *EventUpsertBulk) UpdateRepeatPattern() *EventUpsertBulk

UpdateRepeatPattern sets the "repeat_pattern" field to the value that was provided on create.

func (*EventUpsertBulk) UpdateStartTime

func (u *EventUpsertBulk) UpdateStartTime() *EventUpsertBulk

UpdateStartTime sets the "start_time" field to the value that was provided on create.

type EventUpsertOne

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

EventUpsertOne is the builder for "upsert"-ing

one Event node.

func (*EventUpsertOne) ClearEndTime

func (u *EventUpsertOne) ClearEndTime() *EventUpsertOne

ClearEndTime clears the value of the "end_time" field.

func (*EventUpsertOne) ClearLocation

func (u *EventUpsertOne) ClearLocation() *EventUpsertOne

ClearLocation clears the value of the "location" field.

func (*EventUpsertOne) ClearRepeatPattern

func (u *EventUpsertOne) ClearRepeatPattern() *EventUpsertOne

ClearRepeatPattern clears the value of the "repeat_pattern" field.

func (*EventUpsertOne) DoNothing

func (u *EventUpsertOne) DoNothing() *EventUpsertOne

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

func (*EventUpsertOne) Exec

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

Exec executes the query.

func (*EventUpsertOne) ExecX

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

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

func (*EventUpsertOne) ID

func (u *EventUpsertOne) ID(ctx context.Context) (id int, err error)

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

func (*EventUpsertOne) IDX

func (u *EventUpsertOne) IDX(ctx context.Context) int

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

func (*EventUpsertOne) Ignore

func (u *EventUpsertOne) Ignore() *EventUpsertOne

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

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

func (*EventUpsertOne) SetEndTime

func (u *EventUpsertOne) SetEndTime(v time.Time) *EventUpsertOne

SetEndTime sets the "end_time" field.

func (*EventUpsertOne) SetLocation

func (u *EventUpsertOne) SetLocation(v string) *EventUpsertOne

SetLocation sets the "location" field.

func (*EventUpsertOne) SetName

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

SetName sets the "name" field.

func (*EventUpsertOne) SetRepeatPattern

func (u *EventUpsertOne) SetRepeatPattern(v string) *EventUpsertOne

SetRepeatPattern sets the "repeat_pattern" field.

func (*EventUpsertOne) SetStartTime

func (u *EventUpsertOne) SetStartTime(v time.Time) *EventUpsertOne

SetStartTime sets the "start_time" field.

func (*EventUpsertOne) Update

func (u *EventUpsertOne) Update(set func(*EventUpsert)) *EventUpsertOne

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

func (*EventUpsertOne) UpdateEndTime

func (u *EventUpsertOne) UpdateEndTime() *EventUpsertOne

UpdateEndTime sets the "end_time" field to the value that was provided on create.

func (*EventUpsertOne) UpdateLocation

func (u *EventUpsertOne) UpdateLocation() *EventUpsertOne

UpdateLocation sets the "location" field to the value that was provided on create.

func (*EventUpsertOne) UpdateName

func (u *EventUpsertOne) UpdateName() *EventUpsertOne

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

func (*EventUpsertOne) UpdateNewValues

func (u *EventUpsertOne) UpdateNewValues() *EventUpsertOne

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

client.Event.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*EventUpsertOne) UpdateRepeatPattern

func (u *EventUpsertOne) UpdateRepeatPattern() *EventUpsertOne

UpdateRepeatPattern sets the "repeat_pattern" field to the value that was provided on create.

func (*EventUpsertOne) UpdateStartTime

func (u *EventUpsertOne) UpdateStartTime() *EventUpsertOne

UpdateStartTime sets the "start_time" field to the value that was provided on create.

type Events

type Events []*Event

Events is a parsable slice of Event.

type Forum

type Forum struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name of the forum (example: General)
	Name string `json:"name,omitempty"`
	// Short name of the forum (example: general)
	ShortName string `json:"short_name,omitempty"`
	// Description of the forum
	Description string `json:"description,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ForumQuery when eager-loading is set.
	Edges ForumEdges `json:"edges"`
	// contains filtered or unexported fields
}

Forum is the model entity for the Forum schema.

func (*Forum) QueryGroup

func (f *Forum) QueryGroup() *GroupQuery

QueryGroup queries the "group" edge of the Forum entity.

func (*Forum) QueryPosts

func (f *Forum) QueryPosts() *ForumPostQuery

QueryPosts queries the "posts" edge of the Forum entity.

func (*Forum) String

func (f *Forum) String() string

String implements the fmt.Stringer.

func (*Forum) Unwrap

func (f *Forum) Unwrap() *Forum

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

func (f *Forum) Update() *ForumUpdateOne

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

func (*Forum) Value

func (f *Forum) Value(name string) (ent.Value, error)

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

type ForumClient

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

ForumClient is a client for the Forum schema.

func NewForumClient

func NewForumClient(c config) *ForumClient

NewForumClient returns a client for the Forum from the given config.

func (*ForumClient) Create

func (c *ForumClient) Create() *ForumCreate

Create returns a builder for creating a Forum entity.

func (*ForumClient) CreateBulk

func (c *ForumClient) CreateBulk(builders ...*ForumCreate) *ForumCreateBulk

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

func (*ForumClient) Delete

func (c *ForumClient) Delete() *ForumDelete

Delete returns a delete builder for Forum.

func (*ForumClient) DeleteOne

func (c *ForumClient) DeleteOne(f *Forum) *ForumDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ForumClient) DeleteOneID

func (c *ForumClient) DeleteOneID(id int) *ForumDeleteOne

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

func (*ForumClient) Get

func (c *ForumClient) Get(ctx context.Context, id int) (*Forum, error)

Get returns a Forum entity by its id.

func (*ForumClient) GetX

func (c *ForumClient) GetX(ctx context.Context, id int) *Forum

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

func (*ForumClient) Hooks

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

Hooks returns the client hooks.

func (*ForumClient) Intercept

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

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

func (*ForumClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ForumClient) Query

func (c *ForumClient) Query() *ForumQuery

Query returns a query builder for Forum.

func (*ForumClient) QueryGroup

func (c *ForumClient) QueryGroup(f *Forum) *GroupQuery

QueryGroup queries the group edge of a Forum.

func (*ForumClient) QueryPosts

func (c *ForumClient) QueryPosts(f *Forum) *ForumPostQuery

QueryPosts queries the posts edge of a Forum.

func (*ForumClient) Update

func (c *ForumClient) Update() *ForumUpdate

Update returns an update builder for Forum.

func (*ForumClient) UpdateOne

func (c *ForumClient) UpdateOne(f *Forum) *ForumUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ForumClient) UpdateOneID

func (c *ForumClient) UpdateOneID(id int) *ForumUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ForumClient) Use

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

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

type ForumCreate

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

ForumCreate is the builder for creating a Forum entity.

func (*ForumCreate) AddPostIDs

func (fc *ForumCreate) AddPostIDs(ids ...int) *ForumCreate

AddPostIDs adds the "posts" edge to the ForumPost entity by IDs.

func (*ForumCreate) AddPosts

func (fc *ForumCreate) AddPosts(f ...*ForumPost) *ForumCreate

AddPosts adds the "posts" edges to the ForumPost entity.

func (*ForumCreate) Exec

func (fc *ForumCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ForumCreate) ExecX

func (fc *ForumCreate) ExecX(ctx context.Context)

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

func (*ForumCreate) Mutation

func (fc *ForumCreate) Mutation() *ForumMutation

Mutation returns the ForumMutation object of the builder.

func (*ForumCreate) OnConflict

func (fc *ForumCreate) OnConflict(opts ...sql.ConflictOption) *ForumUpsertOne

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

client.Forum.Create().
	SetName(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.ForumUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*ForumCreate) OnConflictColumns

func (fc *ForumCreate) OnConflictColumns(columns ...string) *ForumUpsertOne

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

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

func (*ForumCreate) Save

func (fc *ForumCreate) Save(ctx context.Context) (*Forum, error)

Save creates the Forum in the database.

func (*ForumCreate) SaveX

func (fc *ForumCreate) SaveX(ctx context.Context) *Forum

SaveX calls Save and panics if Save returns an error.

func (*ForumCreate) SetDescription

func (fc *ForumCreate) SetDescription(s string) *ForumCreate

SetDescription sets the "description" field.

func (*ForumCreate) SetGroup

func (fc *ForumCreate) SetGroup(g *Group) *ForumCreate

SetGroup sets the "group" edge to the Group entity.

func (*ForumCreate) SetGroupID

func (fc *ForumCreate) SetGroupID(id int) *ForumCreate

SetGroupID sets the "group" edge to the Group entity by ID.

func (*ForumCreate) SetName

func (fc *ForumCreate) SetName(s string) *ForumCreate

SetName sets the "name" field.

func (*ForumCreate) SetShortName

func (fc *ForumCreate) SetShortName(s string) *ForumCreate

SetShortName sets the "short_name" field.

type ForumCreateBulk

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

ForumCreateBulk is the builder for creating many Forum entities in bulk.

func (*ForumCreateBulk) Exec

func (fcb *ForumCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ForumCreateBulk) ExecX

func (fcb *ForumCreateBulk) ExecX(ctx context.Context)

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

func (*ForumCreateBulk) OnConflict

func (fcb *ForumCreateBulk) OnConflict(opts ...sql.ConflictOption) *ForumUpsertBulk

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

client.Forum.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.ForumUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*ForumCreateBulk) OnConflictColumns

func (fcb *ForumCreateBulk) OnConflictColumns(columns ...string) *ForumUpsertBulk

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

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

func (*ForumCreateBulk) Save

func (fcb *ForumCreateBulk) Save(ctx context.Context) ([]*Forum, error)

Save creates the Forum entities in the database.

func (*ForumCreateBulk) SaveX

func (fcb *ForumCreateBulk) SaveX(ctx context.Context) []*Forum

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

type ForumDelete

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

ForumDelete is the builder for deleting a Forum entity.

func (*ForumDelete) Exec

func (fd *ForumDelete) Exec(ctx context.Context) (int, error)

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

func (*ForumDelete) ExecX

func (fd *ForumDelete) ExecX(ctx context.Context) int

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

func (*ForumDelete) Where

func (fd *ForumDelete) Where(ps ...predicate.Forum) *ForumDelete

Where appends a list predicates to the ForumDelete builder.

type ForumDeleteOne

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

ForumDeleteOne is the builder for deleting a single Forum entity.

func (*ForumDeleteOne) Exec

func (fdo *ForumDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ForumDeleteOne) ExecX

func (fdo *ForumDeleteOne) ExecX(ctx context.Context)

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

func (*ForumDeleteOne) Where

func (fdo *ForumDeleteOne) Where(ps ...predicate.Forum) *ForumDeleteOne

Where appends a list predicates to the ForumDelete builder.

type ForumEdges

type ForumEdges struct {
	// Group holds the value of the group edge.
	Group *Group `json:"group,omitempty"`
	// Posts in the forum
	Posts []*ForumPost `json:"posts,omitempty"`
	// contains filtered or unexported fields
}

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

func (ForumEdges) GroupOrErr

func (e ForumEdges) GroupOrErr() (*Group, error)

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

func (ForumEdges) PostsOrErr

func (e ForumEdges) PostsOrErr() ([]*ForumPost, error)

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

type ForumGroupBy

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

ForumGroupBy is the group-by builder for Forum entities.

func (*ForumGroupBy) Aggregate

func (fgb *ForumGroupBy) Aggregate(fns ...AggregateFunc) *ForumGroupBy

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

func (*ForumGroupBy) Bool

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

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

func (*ForumGroupBy) BoolX

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

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

func (*ForumGroupBy) Bools

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

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

func (*ForumGroupBy) BoolsX

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

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

func (*ForumGroupBy) Float64

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

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

func (*ForumGroupBy) Float64X

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

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

func (*ForumGroupBy) Float64s

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

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

func (*ForumGroupBy) Float64sX

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

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

func (*ForumGroupBy) Int

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

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

func (*ForumGroupBy) IntX

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

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

func (*ForumGroupBy) Ints

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

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

func (*ForumGroupBy) IntsX

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

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

func (*ForumGroupBy) Scan

func (fgb *ForumGroupBy) Scan(ctx context.Context, v any) error

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

func (*ForumGroupBy) ScanX

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

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

func (*ForumGroupBy) String

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

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

func (*ForumGroupBy) StringX

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

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

func (*ForumGroupBy) Strings

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

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

func (*ForumGroupBy) StringsX

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

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

type ForumMutation

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

ForumMutation represents an operation that mutates the Forum nodes in the graph.

func (*ForumMutation) AddField

func (m *ForumMutation) 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 (*ForumMutation) AddPostIDs

func (m *ForumMutation) AddPostIDs(ids ...int)

AddPostIDs adds the "posts" edge to the ForumPost entity by ids.

func (*ForumMutation) AddedEdges

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

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

func (*ForumMutation) AddedField

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

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

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

func (*ForumMutation) AddedIDs

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

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

func (*ForumMutation) ClearEdge

func (m *ForumMutation) 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 (*ForumMutation) ClearField

func (m *ForumMutation) 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 (*ForumMutation) ClearGroup

func (m *ForumMutation) ClearGroup()

ClearGroup clears the "group" edge to the Group entity.

func (*ForumMutation) ClearPosts

func (m *ForumMutation) ClearPosts()

ClearPosts clears the "posts" edge to the ForumPost entity.

func (*ForumMutation) ClearedEdges

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

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

func (*ForumMutation) ClearedFields

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

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

func (ForumMutation) Client

func (m ForumMutation) 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 (*ForumMutation) Description

func (m *ForumMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*ForumMutation) EdgeCleared

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

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

func (*ForumMutation) Field

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

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

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

func (*ForumMutation) Fields

func (m *ForumMutation) 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 (*ForumMutation) GroupCleared

func (m *ForumMutation) GroupCleared() bool

GroupCleared reports if the "group" edge to the Group entity was cleared.

func (*ForumMutation) GroupID

func (m *ForumMutation) GroupID() (id int, exists bool)

GroupID returns the "group" edge ID in the mutation.

func (*ForumMutation) GroupIDs

func (m *ForumMutation) GroupIDs() (ids []int)

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

func (*ForumMutation) ID

func (m *ForumMutation) ID() (id int, 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 (*ForumMutation) IDs

func (m *ForumMutation) IDs(ctx context.Context) ([]int, 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 (*ForumMutation) Name

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

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

func (*ForumMutation) OldDescription

func (m *ForumMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Forum entity. If the Forum 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 (*ForumMutation) OldField

func (m *ForumMutation) 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 (*ForumMutation) OldName

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

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

func (m *ForumMutation) OldShortName(ctx context.Context) (v string, err error)

OldShortName returns the old "short_name" field's value of the Forum entity. If the Forum 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 (*ForumMutation) Op

func (m *ForumMutation) Op() Op

Op returns the operation name.

func (*ForumMutation) PostsCleared

func (m *ForumMutation) PostsCleared() bool

PostsCleared reports if the "posts" edge to the ForumPost entity was cleared.

func (*ForumMutation) PostsIDs

func (m *ForumMutation) PostsIDs() (ids []int)

PostsIDs returns the "posts" edge IDs in the mutation.

func (*ForumMutation) RemovePostIDs

func (m *ForumMutation) RemovePostIDs(ids ...int)

RemovePostIDs removes the "posts" edge to the ForumPost entity by IDs.

func (*ForumMutation) RemovedEdges

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

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

func (*ForumMutation) RemovedIDs

func (m *ForumMutation) 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 (*ForumMutation) RemovedPostsIDs

func (m *ForumMutation) RemovedPostsIDs() (ids []int)

RemovedPosts returns the removed IDs of the "posts" edge to the ForumPost entity.

func (*ForumMutation) ResetDescription

func (m *ForumMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*ForumMutation) ResetEdge

func (m *ForumMutation) 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 (*ForumMutation) ResetField

func (m *ForumMutation) 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 (*ForumMutation) ResetGroup

func (m *ForumMutation) ResetGroup()

ResetGroup resets all changes to the "group" edge.

func (*ForumMutation) ResetName

func (m *ForumMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ForumMutation) ResetPosts

func (m *ForumMutation) ResetPosts()

ResetPosts resets all changes to the "posts" edge.

func (*ForumMutation) ResetShortName

func (m *ForumMutation) ResetShortName()

ResetShortName resets all changes to the "short_name" field.

func (*ForumMutation) SetDescription

func (m *ForumMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*ForumMutation) SetField

func (m *ForumMutation) 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 (*ForumMutation) SetGroupID

func (m *ForumMutation) SetGroupID(id int)

SetGroupID sets the "group" edge to the Group entity by id.

func (*ForumMutation) SetName

func (m *ForumMutation) SetName(s string)

SetName sets the "name" field.

func (*ForumMutation) SetOp

func (m *ForumMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ForumMutation) SetShortName

func (m *ForumMutation) SetShortName(s string)

SetShortName sets the "short_name" field.

func (*ForumMutation) ShortName

func (m *ForumMutation) ShortName() (r string, exists bool)

ShortName returns the value of the "short_name" field in the mutation.

func (ForumMutation) Tx

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

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

func (*ForumMutation) Type

func (m *ForumMutation) Type() string

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

func (*ForumMutation) Where

func (m *ForumMutation) Where(ps ...predicate.Forum)

Where appends a list predicates to the ForumMutation builder.

func (*ForumMutation) WhereP

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

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

type ForumPost

type ForumPost struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Title of the forum post
	Title string `json:"title,omitempty"`
	// Content of the forum post
	Content string `json:"content,omitempty"`
	// Slice of user IDs that were mentioned
	MentionedUsersJSON []int `json:"mentioned_users_json,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ForumPostQuery when eager-loading is set.
	Edges ForumPostEdges `json:"edges"`
	// contains filtered or unexported fields
}

ForumPost is the model entity for the ForumPost schema.

func (*ForumPost) QueryAuthor

func (fp *ForumPost) QueryAuthor() *UserQuery

QueryAuthor queries the "author" edge of the ForumPost entity.

func (*ForumPost) QueryChildren

func (fp *ForumPost) QueryChildren() *ForumPostQuery

QueryChildren queries the "children" edge of the ForumPost entity.

func (*ForumPost) QueryForum

func (fp *ForumPost) QueryForum() *ForumQuery

QueryForum queries the "forum" edge of the ForumPost entity.

func (*ForumPost) QueryParent

func (fp *ForumPost) QueryParent() *ForumPostQuery

QueryParent queries the "parent" edge of the ForumPost entity.

func (*ForumPost) QueryReactedUsers

func (fp *ForumPost) QueryReactedUsers() *UserQuery

QueryReactedUsers queries the "reacted_users" edge of the ForumPost entity.

func (*ForumPost) QueryReactions

func (fp *ForumPost) QueryReactions() *ReactionQuery

QueryReactions queries the "reactions" edge of the ForumPost entity.

func (*ForumPost) String

func (fp *ForumPost) String() string

String implements the fmt.Stringer.

func (*ForumPost) Unwrap

func (fp *ForumPost) Unwrap() *ForumPost

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

func (fp *ForumPost) Update() *ForumPostUpdateOne

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

func (*ForumPost) Value

func (fp *ForumPost) Value(name string) (ent.Value, error)

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

type ForumPostClient

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

ForumPostClient is a client for the ForumPost schema.

func NewForumPostClient

func NewForumPostClient(c config) *ForumPostClient

NewForumPostClient returns a client for the ForumPost from the given config.

func (*ForumPostClient) Create

func (c *ForumPostClient) Create() *ForumPostCreate

Create returns a builder for creating a ForumPost entity.

func (*ForumPostClient) CreateBulk

func (c *ForumPostClient) CreateBulk(builders ...*ForumPostCreate) *ForumPostCreateBulk

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

func (*ForumPostClient) Delete

func (c *ForumPostClient) Delete() *ForumPostDelete

Delete returns a delete builder for ForumPost.

func (*ForumPostClient) DeleteOne

func (c *ForumPostClient) DeleteOne(fp *ForumPost) *ForumPostDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ForumPostClient) DeleteOneID

func (c *ForumPostClient) DeleteOneID(id int) *ForumPostDeleteOne

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

func (*ForumPostClient) Get

func (c *ForumPostClient) Get(ctx context.Context, id int) (*ForumPost, error)

Get returns a ForumPost entity by its id.

func (*ForumPostClient) GetX

func (c *ForumPostClient) GetX(ctx context.Context, id int) *ForumPost

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

func (*ForumPostClient) Hooks

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

Hooks returns the client hooks.

func (*ForumPostClient) Intercept

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

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

func (*ForumPostClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ForumPostClient) Query

func (c *ForumPostClient) Query() *ForumPostQuery

Query returns a query builder for ForumPost.

func (*ForumPostClient) QueryAuthor

func (c *ForumPostClient) QueryAuthor(fp *ForumPost) *UserQuery

QueryAuthor queries the author edge of a ForumPost.

func (*ForumPostClient) QueryChildren

func (c *ForumPostClient) QueryChildren(fp *ForumPost) *ForumPostQuery

QueryChildren queries the children edge of a ForumPost.

func (*ForumPostClient) QueryForum

func (c *ForumPostClient) QueryForum(fp *ForumPost) *ForumQuery

QueryForum queries the forum edge of a ForumPost.

func (*ForumPostClient) QueryParent

func (c *ForumPostClient) QueryParent(fp *ForumPost) *ForumPostQuery

QueryParent queries the parent edge of a ForumPost.

func (*ForumPostClient) QueryReactedUsers

func (c *ForumPostClient) QueryReactedUsers(fp *ForumPost) *UserQuery

QueryReactedUsers queries the reacted_users edge of a ForumPost.

func (*ForumPostClient) QueryReactions

func (c *ForumPostClient) QueryReactions(fp *ForumPost) *ReactionQuery

QueryReactions queries the reactions edge of a ForumPost.

func (*ForumPostClient) Update

func (c *ForumPostClient) Update() *ForumPostUpdate

Update returns an update builder for ForumPost.

func (*ForumPostClient) UpdateOne

func (c *ForumPostClient) UpdateOne(fp *ForumPost) *ForumPostUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ForumPostClient) UpdateOneID

func (c *ForumPostClient) UpdateOneID(id int) *ForumPostUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ForumPostClient) Use

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

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

type ForumPostCreate

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

ForumPostCreate is the builder for creating a ForumPost entity.

func (*ForumPostCreate) AddChildIDs

func (fpc *ForumPostCreate) AddChildIDs(ids ...int) *ForumPostCreate

AddChildIDs adds the "children" edge to the ForumPost entity by IDs.

func (*ForumPostCreate) AddChildren

func (fpc *ForumPostCreate) AddChildren(f ...*ForumPost) *ForumPostCreate

AddChildren adds the "children" edges to the ForumPost entity.

func (*ForumPostCreate) AddReactedUserIDs

func (fpc *ForumPostCreate) AddReactedUserIDs(ids ...int) *ForumPostCreate

AddReactedUserIDs adds the "reacted_users" edge to the User entity by IDs.

func (*ForumPostCreate) AddReactedUsers

func (fpc *ForumPostCreate) AddReactedUsers(u ...*User) *ForumPostCreate

AddReactedUsers adds the "reacted_users" edges to the User entity.

func (*ForumPostCreate) Exec

func (fpc *ForumPostCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ForumPostCreate) ExecX

func (fpc *ForumPostCreate) ExecX(ctx context.Context)

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

func (*ForumPostCreate) Mutation

func (fpc *ForumPostCreate) Mutation() *ForumPostMutation

Mutation returns the ForumPostMutation object of the builder.

func (*ForumPostCreate) OnConflict

func (fpc *ForumPostCreate) OnConflict(opts ...sql.ConflictOption) *ForumPostUpsertOne

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

client.ForumPost.Create().
	SetTitle(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.ForumPostUpsert) {
		SetTitle(v+v).
	}).
	Exec(ctx)

func (*ForumPostCreate) OnConflictColumns

func (fpc *ForumPostCreate) OnConflictColumns(columns ...string) *ForumPostUpsertOne

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

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

func (*ForumPostCreate) Save

func (fpc *ForumPostCreate) Save(ctx context.Context) (*ForumPost, error)

Save creates the ForumPost in the database.

func (*ForumPostCreate) SaveX

func (fpc *ForumPostCreate) SaveX(ctx context.Context) *ForumPost

SaveX calls Save and panics if Save returns an error.

func (*ForumPostCreate) SetAuthor

func (fpc *ForumPostCreate) SetAuthor(u *User) *ForumPostCreate

SetAuthor sets the "author" edge to the User entity.

func (*ForumPostCreate) SetAuthorID

func (fpc *ForumPostCreate) SetAuthorID(id int) *ForumPostCreate

SetAuthorID sets the "author" edge to the User entity by ID.

func (*ForumPostCreate) SetContent

func (fpc *ForumPostCreate) SetContent(s string) *ForumPostCreate

SetContent sets the "content" field.

func (*ForumPostCreate) SetForum

func (fpc *ForumPostCreate) SetForum(f *Forum) *ForumPostCreate

SetForum sets the "forum" edge to the Forum entity.

func (*ForumPostCreate) SetForumID

func (fpc *ForumPostCreate) SetForumID(id int) *ForumPostCreate

SetForumID sets the "forum" edge to the Forum entity by ID.

func (*ForumPostCreate) SetMentionedUsersJSON

func (fpc *ForumPostCreate) SetMentionedUsersJSON(i []int) *ForumPostCreate

SetMentionedUsersJSON sets the "mentioned_users_json" field.

func (*ForumPostCreate) SetNillableParentID

func (fpc *ForumPostCreate) SetNillableParentID(id *int) *ForumPostCreate

SetNillableParentID sets the "parent" edge to the ForumPost entity by ID if the given value is not nil.

func (*ForumPostCreate) SetParent

func (fpc *ForumPostCreate) SetParent(f *ForumPost) *ForumPostCreate

SetParent sets the "parent" edge to the ForumPost entity.

func (*ForumPostCreate) SetParentID

func (fpc *ForumPostCreate) SetParentID(id int) *ForumPostCreate

SetParentID sets the "parent" edge to the ForumPost entity by ID.

func (*ForumPostCreate) SetTitle

func (fpc *ForumPostCreate) SetTitle(s string) *ForumPostCreate

SetTitle sets the "title" field.

type ForumPostCreateBulk

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

ForumPostCreateBulk is the builder for creating many ForumPost entities in bulk.

func (*ForumPostCreateBulk) Exec

func (fpcb *ForumPostCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ForumPostCreateBulk) ExecX

func (fpcb *ForumPostCreateBulk) ExecX(ctx context.Context)

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

func (*ForumPostCreateBulk) OnConflict

func (fpcb *ForumPostCreateBulk) OnConflict(opts ...sql.ConflictOption) *ForumPostUpsertBulk

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

client.ForumPost.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.ForumPostUpsert) {
		SetTitle(v+v).
	}).
	Exec(ctx)

func (*ForumPostCreateBulk) OnConflictColumns

func (fpcb *ForumPostCreateBulk) OnConflictColumns(columns ...string) *ForumPostUpsertBulk

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

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

func (*ForumPostCreateBulk) Save

func (fpcb *ForumPostCreateBulk) Save(ctx context.Context) ([]*ForumPost, error)

Save creates the ForumPost entities in the database.

func (*ForumPostCreateBulk) SaveX

func (fpcb *ForumPostCreateBulk) SaveX(ctx context.Context) []*ForumPost

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

type ForumPostDelete

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

ForumPostDelete is the builder for deleting a ForumPost entity.

func (*ForumPostDelete) Exec

func (fpd *ForumPostDelete) Exec(ctx context.Context) (int, error)

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

func (*ForumPostDelete) ExecX

func (fpd *ForumPostDelete) ExecX(ctx context.Context) int

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

func (*ForumPostDelete) Where

Where appends a list predicates to the ForumPostDelete builder.

type ForumPostDeleteOne

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

ForumPostDeleteOne is the builder for deleting a single ForumPost entity.

func (*ForumPostDeleteOne) Exec

func (fpdo *ForumPostDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ForumPostDeleteOne) ExecX

func (fpdo *ForumPostDeleteOne) ExecX(ctx context.Context)

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

func (*ForumPostDeleteOne) Where

Where appends a list predicates to the ForumPostDelete builder.

type ForumPostEdges

type ForumPostEdges struct {
	// Author of the forum post
	Author *User `json:"author,omitempty"`
	// Forum holds the value of the forum edge.
	Forum *Forum `json:"forum,omitempty"`
	// Parent holds the value of the parent edge.
	Parent *ForumPost `json:"parent,omitempty"`
	// Children holds the value of the children edge.
	Children []*ForumPost `json:"children,omitempty"`
	// ReactedUsers holds the value of the reacted_users edge.
	ReactedUsers []*User `json:"reacted_users,omitempty"`
	// Reactions holds the value of the reactions edge.
	Reactions []*Reaction `json:"reactions,omitempty"`
	// contains filtered or unexported fields
}

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

func (ForumPostEdges) AuthorOrErr

func (e ForumPostEdges) AuthorOrErr() (*User, error)

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

func (ForumPostEdges) ChildrenOrErr

func (e ForumPostEdges) ChildrenOrErr() ([]*ForumPost, error)

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

func (ForumPostEdges) ForumOrErr

func (e ForumPostEdges) ForumOrErr() (*Forum, error)

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

func (ForumPostEdges) ParentOrErr

func (e ForumPostEdges) ParentOrErr() (*ForumPost, error)

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

func (ForumPostEdges) ReactedUsersOrErr

func (e ForumPostEdges) ReactedUsersOrErr() ([]*User, error)

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

func (ForumPostEdges) ReactionsOrErr

func (e ForumPostEdges) ReactionsOrErr() ([]*Reaction, error)

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

type ForumPostGroupBy

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

ForumPostGroupBy is the group-by builder for ForumPost entities.

func (*ForumPostGroupBy) Aggregate

func (fpgb *ForumPostGroupBy) Aggregate(fns ...AggregateFunc) *ForumPostGroupBy

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

func (*ForumPostGroupBy) Bool

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

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

func (*ForumPostGroupBy) BoolX

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

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

func (*ForumPostGroupBy) Bools

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

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

func (*ForumPostGroupBy) BoolsX

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

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

func (*ForumPostGroupBy) Float64

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

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

func (*ForumPostGroupBy) Float64X

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

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

func (*ForumPostGroupBy) Float64s

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

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

func (*ForumPostGroupBy) Float64sX

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

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

func (*ForumPostGroupBy) Int

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

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

func (*ForumPostGroupBy) IntX

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

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

func (*ForumPostGroupBy) Ints

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

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

func (*ForumPostGroupBy) IntsX

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

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

func (*ForumPostGroupBy) Scan

func (fpgb *ForumPostGroupBy) Scan(ctx context.Context, v any) error

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

func (*ForumPostGroupBy) ScanX

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

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

func (*ForumPostGroupBy) String

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

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

func (*ForumPostGroupBy) StringX

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

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

func (*ForumPostGroupBy) Strings

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

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

func (*ForumPostGroupBy) StringsX

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

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

type ForumPostMutation

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

ForumPostMutation represents an operation that mutates the ForumPost nodes in the graph.

func (*ForumPostMutation) AddChildIDs

func (m *ForumPostMutation) AddChildIDs(ids ...int)

AddChildIDs adds the "children" edge to the ForumPost entity by ids.

func (*ForumPostMutation) AddField

func (m *ForumPostMutation) 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 (*ForumPostMutation) AddReactedUserIDs

func (m *ForumPostMutation) AddReactedUserIDs(ids ...int)

AddReactedUserIDs adds the "reacted_users" edge to the User entity by ids.

func (*ForumPostMutation) AddedEdges

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

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

func (*ForumPostMutation) AddedField

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

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

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

func (*ForumPostMutation) AddedIDs

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

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

func (*ForumPostMutation) AppendMentionedUsersJSON

func (m *ForumPostMutation) AppendMentionedUsersJSON(i []int)

AppendMentionedUsersJSON adds i to the "mentioned_users_json" field.

func (*ForumPostMutation) AppendedMentionedUsersJSON

func (m *ForumPostMutation) AppendedMentionedUsersJSON() ([]int, bool)

AppendedMentionedUsersJSON returns the list of values that were appended to the "mentioned_users_json" field in this mutation.

func (*ForumPostMutation) AuthorCleared

func (m *ForumPostMutation) AuthorCleared() bool

AuthorCleared reports if the "author" edge to the User entity was cleared.

func (*ForumPostMutation) AuthorID

func (m *ForumPostMutation) AuthorID() (id int, exists bool)

AuthorID returns the "author" edge ID in the mutation.

func (*ForumPostMutation) AuthorIDs

func (m *ForumPostMutation) AuthorIDs() (ids []int)

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

func (*ForumPostMutation) ChildrenCleared

func (m *ForumPostMutation) ChildrenCleared() bool

ChildrenCleared reports if the "children" edge to the ForumPost entity was cleared.

func (*ForumPostMutation) ChildrenIDs

func (m *ForumPostMutation) ChildrenIDs() (ids []int)

ChildrenIDs returns the "children" edge IDs in the mutation.

func (*ForumPostMutation) ClearAuthor

func (m *ForumPostMutation) ClearAuthor()

ClearAuthor clears the "author" edge to the User entity.

func (*ForumPostMutation) ClearChildren

func (m *ForumPostMutation) ClearChildren()

ClearChildren clears the "children" edge to the ForumPost entity.

func (*ForumPostMutation) ClearEdge

func (m *ForumPostMutation) 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 (*ForumPostMutation) ClearField

func (m *ForumPostMutation) 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 (*ForumPostMutation) ClearForum

func (m *ForumPostMutation) ClearForum()

ClearForum clears the "forum" edge to the Forum entity.

func (*ForumPostMutation) ClearParent

func (m *ForumPostMutation) ClearParent()

ClearParent clears the "parent" edge to the ForumPost entity.

func (*ForumPostMutation) ClearReactedUsers

func (m *ForumPostMutation) ClearReactedUsers()

ClearReactedUsers clears the "reacted_users" edge to the User entity.

func (*ForumPostMutation) ClearedEdges

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

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

func (*ForumPostMutation) ClearedFields

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

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

func (ForumPostMutation) Client

func (m ForumPostMutation) 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 (*ForumPostMutation) Content

func (m *ForumPostMutation) Content() (r string, exists bool)

Content returns the value of the "content" field in the mutation.

func (*ForumPostMutation) EdgeCleared

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

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

func (*ForumPostMutation) Field

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

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

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

func (*ForumPostMutation) Fields

func (m *ForumPostMutation) 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 (*ForumPostMutation) ForumCleared

func (m *ForumPostMutation) ForumCleared() bool

ForumCleared reports if the "forum" edge to the Forum entity was cleared.

func (*ForumPostMutation) ForumID

func (m *ForumPostMutation) ForumID() (id int, exists bool)

ForumID returns the "forum" edge ID in the mutation.

func (*ForumPostMutation) ForumIDs

func (m *ForumPostMutation) ForumIDs() (ids []int)

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

func (*ForumPostMutation) ID

func (m *ForumPostMutation) ID() (id int, 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 (*ForumPostMutation) IDs

func (m *ForumPostMutation) IDs(ctx context.Context) ([]int, 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 (*ForumPostMutation) MentionedUsersJSON

func (m *ForumPostMutation) MentionedUsersJSON() (r []int, exists bool)

MentionedUsersJSON returns the value of the "mentioned_users_json" field in the mutation.

func (*ForumPostMutation) OldContent

func (m *ForumPostMutation) OldContent(ctx context.Context) (v string, err error)

OldContent returns the old "content" field's value of the ForumPost entity. If the ForumPost 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 (*ForumPostMutation) OldField

func (m *ForumPostMutation) 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 (*ForumPostMutation) OldMentionedUsersJSON

func (m *ForumPostMutation) OldMentionedUsersJSON(ctx context.Context) (v []int, err error)

OldMentionedUsersJSON returns the old "mentioned_users_json" field's value of the ForumPost entity. If the ForumPost 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 (*ForumPostMutation) OldTitle

func (m *ForumPostMutation) OldTitle(ctx context.Context) (v string, err error)

OldTitle returns the old "title" field's value of the ForumPost entity. If the ForumPost 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 (*ForumPostMutation) Op

func (m *ForumPostMutation) Op() Op

Op returns the operation name.

func (*ForumPostMutation) ParentCleared

func (m *ForumPostMutation) ParentCleared() bool

ParentCleared reports if the "parent" edge to the ForumPost entity was cleared.

func (*ForumPostMutation) ParentID

func (m *ForumPostMutation) ParentID() (id int, exists bool)

ParentID returns the "parent" edge ID in the mutation.

func (*ForumPostMutation) ParentIDs

func (m *ForumPostMutation) ParentIDs() (ids []int)

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

func (*ForumPostMutation) ReactedUsersCleared

func (m *ForumPostMutation) ReactedUsersCleared() bool

ReactedUsersCleared reports if the "reacted_users" edge to the User entity was cleared.

func (*ForumPostMutation) ReactedUsersIDs

func (m *ForumPostMutation) ReactedUsersIDs() (ids []int)

ReactedUsersIDs returns the "reacted_users" edge IDs in the mutation.

func (*ForumPostMutation) RemoveChildIDs

func (m *ForumPostMutation) RemoveChildIDs(ids ...int)

RemoveChildIDs removes the "children" edge to the ForumPost entity by IDs.

func (*ForumPostMutation) RemoveReactedUserIDs

func (m *ForumPostMutation) RemoveReactedUserIDs(ids ...int)

RemoveReactedUserIDs removes the "reacted_users" edge to the User entity by IDs.

func (*ForumPostMutation) RemovedChildrenIDs

func (m *ForumPostMutation) RemovedChildrenIDs() (ids []int)

RemovedChildren returns the removed IDs of the "children" edge to the ForumPost entity.

func (*ForumPostMutation) RemovedEdges

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

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

func (*ForumPostMutation) RemovedIDs

func (m *ForumPostMutation) 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 (*ForumPostMutation) RemovedReactedUsersIDs

func (m *ForumPostMutation) RemovedReactedUsersIDs() (ids []int)

RemovedReactedUsers returns the removed IDs of the "reacted_users" edge to the User entity.

func (*ForumPostMutation) ResetAuthor

func (m *ForumPostMutation) ResetAuthor()

ResetAuthor resets all changes to the "author" edge.

func (*ForumPostMutation) ResetChildren

func (m *ForumPostMutation) ResetChildren()

ResetChildren resets all changes to the "children" edge.

func (*ForumPostMutation) ResetContent

func (m *ForumPostMutation) ResetContent()

ResetContent resets all changes to the "content" field.

func (*ForumPostMutation) ResetEdge

func (m *ForumPostMutation) 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 (*ForumPostMutation) ResetField

func (m *ForumPostMutation) 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 (*ForumPostMutation) ResetForum

func (m *ForumPostMutation) ResetForum()

ResetForum resets all changes to the "forum" edge.

func (*ForumPostMutation) ResetMentionedUsersJSON

func (m *ForumPostMutation) ResetMentionedUsersJSON()

ResetMentionedUsersJSON resets all changes to the "mentioned_users_json" field.

func (*ForumPostMutation) ResetParent

func (m *ForumPostMutation) ResetParent()

ResetParent resets all changes to the "parent" edge.

func (*ForumPostMutation) ResetReactedUsers

func (m *ForumPostMutation) ResetReactedUsers()

ResetReactedUsers resets all changes to the "reacted_users" edge.

func (*ForumPostMutation) ResetTitle

func (m *ForumPostMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*ForumPostMutation) SetAuthorID

func (m *ForumPostMutation) SetAuthorID(id int)

SetAuthorID sets the "author" edge to the User entity by id.

func (*ForumPostMutation) SetContent

func (m *ForumPostMutation) SetContent(s string)

SetContent sets the "content" field.

func (*ForumPostMutation) SetField

func (m *ForumPostMutation) 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 (*ForumPostMutation) SetForumID

func (m *ForumPostMutation) SetForumID(id int)

SetForumID sets the "forum" edge to the Forum entity by id.

func (*ForumPostMutation) SetMentionedUsersJSON

func (m *ForumPostMutation) SetMentionedUsersJSON(i []int)

SetMentionedUsersJSON sets the "mentioned_users_json" field.

func (*ForumPostMutation) SetOp

func (m *ForumPostMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ForumPostMutation) SetParentID

func (m *ForumPostMutation) SetParentID(id int)

SetParentID sets the "parent" edge to the ForumPost entity by id.

func (*ForumPostMutation) SetTitle

func (m *ForumPostMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*ForumPostMutation) Title

func (m *ForumPostMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (ForumPostMutation) Tx

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

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

func (*ForumPostMutation) Type

func (m *ForumPostMutation) Type() string

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

func (*ForumPostMutation) Where

func (m *ForumPostMutation) Where(ps ...predicate.ForumPost)

Where appends a list predicates to the ForumPostMutation builder.

func (*ForumPostMutation) WhereP

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

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

type ForumPostQuery

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

ForumPostQuery is the builder for querying ForumPost entities.

func (*ForumPostQuery) Aggregate

func (fpq *ForumPostQuery) Aggregate(fns ...AggregateFunc) *ForumPostSelect

Aggregate returns a ForumPostSelect configured with the given aggregations.

func (*ForumPostQuery) All

func (fpq *ForumPostQuery) All(ctx context.Context) ([]*ForumPost, error)

All executes the query and returns a list of ForumPosts.

func (*ForumPostQuery) AllX

func (fpq *ForumPostQuery) AllX(ctx context.Context) []*ForumPost

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

func (*ForumPostQuery) Clone

func (fpq *ForumPostQuery) Clone() *ForumPostQuery

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

func (*ForumPostQuery) Count

func (fpq *ForumPostQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ForumPostQuery) CountX

func (fpq *ForumPostQuery) CountX(ctx context.Context) int

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

func (*ForumPostQuery) Exist

func (fpq *ForumPostQuery) Exist(ctx context.Context) (bool, error)

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

func (*ForumPostQuery) ExistX

func (fpq *ForumPostQuery) ExistX(ctx context.Context) bool

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

func (*ForumPostQuery) First

func (fpq *ForumPostQuery) First(ctx context.Context) (*ForumPost, error)

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

func (*ForumPostQuery) FirstID

func (fpq *ForumPostQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*ForumPostQuery) FirstIDX

func (fpq *ForumPostQuery) FirstIDX(ctx context.Context) int

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

func (*ForumPostQuery) FirstX

func (fpq *ForumPostQuery) FirstX(ctx context.Context) *ForumPost

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

func (*ForumPostQuery) GroupBy

func (fpq *ForumPostQuery) GroupBy(field string, fields ...string) *ForumPostGroupBy

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 {
	Title string `json:"title,omitempty"`
	Count int `json:"count,omitempty"`
}

client.ForumPost.Query().
	GroupBy(forumpost.FieldTitle).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ForumPostQuery) IDs

func (fpq *ForumPostQuery) IDs(ctx context.Context) (ids []int, err error)

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

func (*ForumPostQuery) IDsX

func (fpq *ForumPostQuery) IDsX(ctx context.Context) []int

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

func (*ForumPostQuery) Limit

func (fpq *ForumPostQuery) Limit(limit int) *ForumPostQuery

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

func (*ForumPostQuery) Offset

func (fpq *ForumPostQuery) Offset(offset int) *ForumPostQuery

Offset to start from.

func (*ForumPostQuery) Only

func (fpq *ForumPostQuery) Only(ctx context.Context) (*ForumPost, error)

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

func (*ForumPostQuery) OnlyID

func (fpq *ForumPostQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*ForumPostQuery) OnlyIDX

func (fpq *ForumPostQuery) OnlyIDX(ctx context.Context) int

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

func (*ForumPostQuery) OnlyX

func (fpq *ForumPostQuery) OnlyX(ctx context.Context) *ForumPost

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

func (*ForumPostQuery) Order

Order specifies how the records should be ordered.

func (*ForumPostQuery) QueryAuthor

func (fpq *ForumPostQuery) QueryAuthor() *UserQuery

QueryAuthor chains the current query on the "author" edge.

func (*ForumPostQuery) QueryChildren

func (fpq *ForumPostQuery) QueryChildren() *ForumPostQuery

QueryChildren chains the current query on the "children" edge.

func (*ForumPostQuery) QueryForum

func (fpq *ForumPostQuery) QueryForum() *ForumQuery

QueryForum chains the current query on the "forum" edge.

func (*ForumPostQuery) QueryParent

func (fpq *ForumPostQuery) QueryParent() *ForumPostQuery

QueryParent chains the current query on the "parent" edge.

func (*ForumPostQuery) QueryReactedUsers

func (fpq *ForumPostQuery) QueryReactedUsers() *UserQuery

QueryReactedUsers chains the current query on the "reacted_users" edge.

func (*ForumPostQuery) QueryReactions

func (fpq *ForumPostQuery) QueryReactions() *ReactionQuery

QueryReactions chains the current query on the "reactions" edge.

func (*ForumPostQuery) Select

func (fpq *ForumPostQuery) Select(fields ...string) *ForumPostSelect

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 {
	Title string `json:"title,omitempty"`
}

client.ForumPost.Query().
	Select(forumpost.FieldTitle).
	Scan(ctx, &v)

func (*ForumPostQuery) Unique

func (fpq *ForumPostQuery) Unique(unique bool) *ForumPostQuery

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

func (fpq *ForumPostQuery) Where(ps ...predicate.ForumPost) *ForumPostQuery

Where adds a new predicate for the ForumPostQuery builder.

func (*ForumPostQuery) WithAuthor

func (fpq *ForumPostQuery) WithAuthor(opts ...func(*UserQuery)) *ForumPostQuery

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

func (*ForumPostQuery) WithChildren

func (fpq *ForumPostQuery) WithChildren(opts ...func(*ForumPostQuery)) *ForumPostQuery

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

func (*ForumPostQuery) WithForum

func (fpq *ForumPostQuery) WithForum(opts ...func(*ForumQuery)) *ForumPostQuery

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

func (*ForumPostQuery) WithParent

func (fpq *ForumPostQuery) WithParent(opts ...func(*ForumPostQuery)) *ForumPostQuery

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

func (*ForumPostQuery) WithReactedUsers

func (fpq *ForumPostQuery) WithReactedUsers(opts ...func(*UserQuery)) *ForumPostQuery

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

func (*ForumPostQuery) WithReactions

func (fpq *ForumPostQuery) WithReactions(opts ...func(*ReactionQuery)) *ForumPostQuery

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

type ForumPostSelect

type ForumPostSelect struct {
	*ForumPostQuery
	// contains filtered or unexported fields
}

ForumPostSelect is the builder for selecting fields of ForumPost entities.

func (*ForumPostSelect) Aggregate

func (fps *ForumPostSelect) Aggregate(fns ...AggregateFunc) *ForumPostSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ForumPostSelect) Bool

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

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

func (*ForumPostSelect) BoolX

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

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

func (*ForumPostSelect) Bools

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

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

func (*ForumPostSelect) BoolsX

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

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

func (*ForumPostSelect) Float64

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

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

func (*ForumPostSelect) Float64X

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

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

func (*ForumPostSelect) Float64s

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

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ForumPostSelect) Float64sX

func (s *ForumPostSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ForumPostSelect) Int

func (s *ForumPostSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ForumPostSelect) IntX

func (s *ForumPostSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ForumPostSelect) Ints

func (s *ForumPostSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ForumPostSelect) IntsX

func (s *ForumPostSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ForumPostSelect) Scan

func (fps *ForumPostSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ForumPostSelect) ScanX

func (s *ForumPostSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ForumPostSelect) String

func (s *ForumPostSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ForumPostSelect) StringX

func (s *ForumPostSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ForumPostSelect) Strings

func (s *ForumPostSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ForumPostSelect) StringsX

func (s *ForumPostSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ForumPostUpdate

type ForumPostUpdate struct {
	// contains filtered or unexported fields
}

ForumPostUpdate is the builder for updating ForumPost entities.

func (*ForumPostUpdate) AddChildIDs

func (fpu *ForumPostUpdate) AddChildIDs(ids ...int) *ForumPostUpdate

AddChildIDs adds the "children" edge to the ForumPost entity by IDs.

func (*ForumPostUpdate) AddChildren

func (fpu *ForumPostUpdate) AddChildren(f ...*ForumPost) *ForumPostUpdate

AddChildren adds the "children" edges to the ForumPost entity.

func (*ForumPostUpdate) AddReactedUserIDs

func (fpu *ForumPostUpdate) AddReactedUserIDs(ids ...int) *ForumPostUpdate

AddReactedUserIDs adds the "reacted_users" edge to the User entity by IDs.

func (*ForumPostUpdate) AddReactedUsers

func (fpu *ForumPostUpdate) AddReactedUsers(u ...*User) *ForumPostUpdate

AddReactedUsers adds the "reacted_users" edges to the User entity.

func (*ForumPostUpdate) AppendMentionedUsersJSON

func (fpu *ForumPostUpdate) AppendMentionedUsersJSON(i []int) *ForumPostUpdate

AppendMentionedUsersJSON appends i to the "mentioned_users_json" field.

func (*ForumPostUpdate) ClearAuthor

func (fpu *ForumPostUpdate) ClearAuthor() *ForumPostUpdate

ClearAuthor clears the "author" edge to the User entity.

func (*ForumPostUpdate) ClearChildren

func (fpu *ForumPostUpdate) ClearChildren() *ForumPostUpdate

ClearChildren clears all "children" edges to the ForumPost entity.

func (*ForumPostUpdate) ClearForum

func (fpu *ForumPostUpdate) ClearForum() *ForumPostUpdate

ClearForum clears the "forum" edge to the Forum entity.

func (*ForumPostUpdate) ClearParent

func (fpu *ForumPostUpdate) ClearParent() *ForumPostUpdate

ClearParent clears the "parent" edge to the ForumPost entity.

func (*ForumPostUpdate) ClearReactedUsers

func (fpu *ForumPostUpdate) ClearReactedUsers() *ForumPostUpdate

ClearReactedUsers clears all "reacted_users" edges to the User entity.

func (*ForumPostUpdate) Exec

func (fpu *ForumPostUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ForumPostUpdate) ExecX

func (fpu *ForumPostUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ForumPostUpdate) Mutation

func (fpu *ForumPostUpdate) Mutation() *ForumPostMutation

Mutation returns the ForumPostMutation object of the builder.

func (*ForumPostUpdate) RemoveChildIDs

func (fpu *ForumPostUpdate) RemoveChildIDs(ids ...int) *ForumPostUpdate

RemoveChildIDs removes the "children" edge to ForumPost entities by IDs.

func (*ForumPostUpdate) RemoveChildren

func (fpu *ForumPostUpdate) RemoveChildren(f ...*ForumPost) *ForumPostUpdate

RemoveChildren removes "children" edges to ForumPost entities.

func (*ForumPostUpdate) RemoveReactedUserIDs

func (fpu *ForumPostUpdate) RemoveReactedUserIDs(ids ...int) *ForumPostUpdate

RemoveReactedUserIDs removes the "reacted_users" edge to User entities by IDs.

func (*ForumPostUpdate) RemoveReactedUsers

func (fpu *ForumPostUpdate) RemoveReactedUsers(u ...*User) *ForumPostUpdate

RemoveReactedUsers removes "reacted_users" edges to User entities.

func (*ForumPostUpdate) Save

func (fpu *ForumPostUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ForumPostUpdate) SaveX

func (fpu *ForumPostUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ForumPostUpdate) SetAuthor

func (fpu *ForumPostUpdate) SetAuthor(u *User) *ForumPostUpdate

SetAuthor sets the "author" edge to the User entity.

func (*ForumPostUpdate) SetAuthorID

func (fpu *ForumPostUpdate) SetAuthorID(id int) *ForumPostUpdate

SetAuthorID sets the "author" edge to the User entity by ID.

func (*ForumPostUpdate) SetContent

func (fpu *ForumPostUpdate) SetContent(s string) *ForumPostUpdate

SetContent sets the "content" field.

func (*ForumPostUpdate) SetForum

func (fpu *ForumPostUpdate) SetForum(f *Forum) *ForumPostUpdate

SetForum sets the "forum" edge to the Forum entity.

func (*ForumPostUpdate) SetForumID

func (fpu *ForumPostUpdate) SetForumID(id int) *ForumPostUpdate

SetForumID sets the "forum" edge to the Forum entity by ID.

func (*ForumPostUpdate) SetMentionedUsersJSON

func (fpu *ForumPostUpdate) SetMentionedUsersJSON(i []int) *ForumPostUpdate

SetMentionedUsersJSON sets the "mentioned_users_json" field.

func (*ForumPostUpdate) SetNillableParentID

func (fpu *ForumPostUpdate) SetNillableParentID(id *int) *ForumPostUpdate

SetNillableParentID sets the "parent" edge to the ForumPost entity by ID if the given value is not nil.

func (*ForumPostUpdate) SetParent

func (fpu *ForumPostUpdate) SetParent(f *ForumPost) *ForumPostUpdate

SetParent sets the "parent" edge to the ForumPost entity.

func (*ForumPostUpdate) SetParentID

func (fpu *ForumPostUpdate) SetParentID(id int) *ForumPostUpdate

SetParentID sets the "parent" edge to the ForumPost entity by ID.

func (*ForumPostUpdate) SetTitle

func (fpu *ForumPostUpdate) SetTitle(s string) *ForumPostUpdate

SetTitle sets the "title" field.

func (*ForumPostUpdate) Where

Where appends a list predicates to the ForumPostUpdate builder.

type ForumPostUpdateOne

type ForumPostUpdateOne struct {
	// contains filtered or unexported fields
}

ForumPostUpdateOne is the builder for updating a single ForumPost entity.

func (*ForumPostUpdateOne) AddChildIDs

func (fpuo *ForumPostUpdateOne) AddChildIDs(ids ...int) *ForumPostUpdateOne

AddChildIDs adds the "children" edge to the ForumPost entity by IDs.

func (*ForumPostUpdateOne) AddChildren

func (fpuo *ForumPostUpdateOne) AddChildren(f ...*ForumPost) *ForumPostUpdateOne

AddChildren adds the "children" edges to the ForumPost entity.

func (*ForumPostUpdateOne) AddReactedUserIDs

func (fpuo *ForumPostUpdateOne) AddReactedUserIDs(ids ...int) *ForumPostUpdateOne

AddReactedUserIDs adds the "reacted_users" edge to the User entity by IDs.

func (*ForumPostUpdateOne) AddReactedUsers

func (fpuo *ForumPostUpdateOne) AddReactedUsers(u ...*User) *ForumPostUpdateOne

AddReactedUsers adds the "reacted_users" edges to the User entity.

func (*ForumPostUpdateOne) AppendMentionedUsersJSON

func (fpuo *ForumPostUpdateOne) AppendMentionedUsersJSON(i []int) *ForumPostUpdateOne

AppendMentionedUsersJSON appends i to the "mentioned_users_json" field.

func (*ForumPostUpdateOne) ClearAuthor

func (fpuo *ForumPostUpdateOne) ClearAuthor() *ForumPostUpdateOne

ClearAuthor clears the "author" edge to the User entity.

func (*ForumPostUpdateOne) ClearChildren

func (fpuo *ForumPostUpdateOne) ClearChildren() *ForumPostUpdateOne

ClearChildren clears all "children" edges to the ForumPost entity.

func (*ForumPostUpdateOne) ClearForum

func (fpuo *ForumPostUpdateOne) ClearForum() *ForumPostUpdateOne

ClearForum clears the "forum" edge to the Forum entity.

func (*ForumPostUpdateOne) ClearParent

func (fpuo *ForumPostUpdateOne) ClearParent() *ForumPostUpdateOne

ClearParent clears the "parent" edge to the ForumPost entity.

func (*ForumPostUpdateOne) ClearReactedUsers

func (fpuo *ForumPostUpdateOne) ClearReactedUsers() *ForumPostUpdateOne

ClearReactedUsers clears all "reacted_users" edges to the User entity.

func (*ForumPostUpdateOne) Exec

func (fpuo *ForumPostUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ForumPostUpdateOne) ExecX

func (fpuo *ForumPostUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ForumPostUpdateOne) Mutation

func (fpuo *ForumPostUpdateOne) Mutation() *ForumPostMutation

Mutation returns the ForumPostMutation object of the builder.

func (*ForumPostUpdateOne) RemoveChildIDs

func (fpuo *ForumPostUpdateOne) RemoveChildIDs(ids ...int) *ForumPostUpdateOne

RemoveChildIDs removes the "children" edge to ForumPost entities by IDs.

func (*ForumPostUpdateOne) RemoveChildren

func (fpuo *ForumPostUpdateOne) RemoveChildren(f ...*ForumPost) *ForumPostUpdateOne

RemoveChildren removes "children" edges to ForumPost entities.

func (*ForumPostUpdateOne) RemoveReactedUserIDs

func (fpuo *ForumPostUpdateOne) RemoveReactedUserIDs(ids ...int) *ForumPostUpdateOne

RemoveReactedUserIDs removes the "reacted_users" edge to User entities by IDs.

func (*ForumPostUpdateOne) RemoveReactedUsers

func (fpuo *ForumPostUpdateOne) RemoveReactedUsers(u ...*User) *ForumPostUpdateOne

RemoveReactedUsers removes "reacted_users" edges to User entities.

func (*ForumPostUpdateOne) Save

func (fpuo *ForumPostUpdateOne) Save(ctx context.Context) (*ForumPost, error)

Save executes the query and returns the updated ForumPost entity.

func (*ForumPostUpdateOne) SaveX

func (fpuo *ForumPostUpdateOne) SaveX(ctx context.Context) *ForumPost

SaveX is like Save, but panics if an error occurs.

func (*ForumPostUpdateOne) Select

func (fpuo *ForumPostUpdateOne) Select(field string, fields ...string) *ForumPostUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ForumPostUpdateOne) SetAuthor

func (fpuo *ForumPostUpdateOne) SetAuthor(u *User) *ForumPostUpdateOne

SetAuthor sets the "author" edge to the User entity.

func (*ForumPostUpdateOne) SetAuthorID

func (fpuo *ForumPostUpdateOne) SetAuthorID(id int) *ForumPostUpdateOne

SetAuthorID sets the "author" edge to the User entity by ID.

func (*ForumPostUpdateOne) SetContent

func (fpuo *ForumPostUpdateOne) SetContent(s string) *ForumPostUpdateOne

SetContent sets the "content" field.

func (*ForumPostUpdateOne) SetForum

func (fpuo *ForumPostUpdateOne) SetForum(f *Forum) *ForumPostUpdateOne

SetForum sets the "forum" edge to the Forum entity.

func (*ForumPostUpdateOne) SetForumID

func (fpuo *ForumPostUpdateOne) SetForumID(id int) *ForumPostUpdateOne

SetForumID sets the "forum" edge to the Forum entity by ID.

func (*ForumPostUpdateOne) SetMentionedUsersJSON

func (fpuo *ForumPostUpdateOne) SetMentionedUsersJSON(i []int) *ForumPostUpdateOne

SetMentionedUsersJSON sets the "mentioned_users_json" field.

func (*ForumPostUpdateOne) SetNillableParentID

func (fpuo *ForumPostUpdateOne) SetNillableParentID(id *int) *ForumPostUpdateOne

SetNillableParentID sets the "parent" edge to the ForumPost entity by ID if the given value is not nil.

func (*ForumPostUpdateOne) SetParent

func (fpuo *ForumPostUpdateOne) SetParent(f *ForumPost) *ForumPostUpdateOne

SetParent sets the "parent" edge to the ForumPost entity.

func (*ForumPostUpdateOne) SetParentID

func (fpuo *ForumPostUpdateOne) SetParentID(id int) *ForumPostUpdateOne

SetParentID sets the "parent" edge to the ForumPost entity by ID.

func (*ForumPostUpdateOne) SetTitle

func (fpuo *ForumPostUpdateOne) SetTitle(s string) *ForumPostUpdateOne

SetTitle sets the "title" field.

func (*ForumPostUpdateOne) Where

Where appends a list predicates to the ForumPostUpdate builder.

type ForumPostUpsert

type ForumPostUpsert struct {
	*sql.UpdateSet
}

ForumPostUpsert is the "OnConflict" setter.

func (*ForumPostUpsert) SetContent

func (u *ForumPostUpsert) SetContent(v string) *ForumPostUpsert

SetContent sets the "content" field.

func (*ForumPostUpsert) SetMentionedUsersJSON

func (u *ForumPostUpsert) SetMentionedUsersJSON(v []int) *ForumPostUpsert

SetMentionedUsersJSON sets the "mentioned_users_json" field.

func (*ForumPostUpsert) SetTitle

func (u *ForumPostUpsert) SetTitle(v string) *ForumPostUpsert

SetTitle sets the "title" field.

func (*ForumPostUpsert) UpdateContent

func (u *ForumPostUpsert) UpdateContent() *ForumPostUpsert

UpdateContent sets the "content" field to the value that was provided on create.

func (*ForumPostUpsert) UpdateMentionedUsersJSON

func (u *ForumPostUpsert) UpdateMentionedUsersJSON() *ForumPostUpsert

UpdateMentionedUsersJSON sets the "mentioned_users_json" field to the value that was provided on create.

func (*ForumPostUpsert) UpdateTitle

func (u *ForumPostUpsert) UpdateTitle() *ForumPostUpsert

UpdateTitle sets the "title" field to the value that was provided on create.

type ForumPostUpsertBulk

type ForumPostUpsertBulk struct {
	// contains filtered or unexported fields
}

ForumPostUpsertBulk is the builder for "upsert"-ing a bulk of ForumPost nodes.

func (*ForumPostUpsertBulk) DoNothing

func (u *ForumPostUpsertBulk) DoNothing() *ForumPostUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ForumPostUpsertBulk) Exec

Exec executes the query.

func (*ForumPostUpsertBulk) ExecX

func (u *ForumPostUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ForumPostUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.ForumPost.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*ForumPostUpsertBulk) SetContent

SetContent sets the "content" field.

func (*ForumPostUpsertBulk) SetMentionedUsersJSON

func (u *ForumPostUpsertBulk) SetMentionedUsersJSON(v []int) *ForumPostUpsertBulk

SetMentionedUsersJSON sets the "mentioned_users_json" field.

func (*ForumPostUpsertBulk) SetTitle

SetTitle sets the "title" field.

func (*ForumPostUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the ForumPostCreateBulk.OnConflict documentation for more info.

func (*ForumPostUpsertBulk) UpdateContent

func (u *ForumPostUpsertBulk) UpdateContent() *ForumPostUpsertBulk

UpdateContent sets the "content" field to the value that was provided on create.

func (*ForumPostUpsertBulk) UpdateMentionedUsersJSON

func (u *ForumPostUpsertBulk) UpdateMentionedUsersJSON() *ForumPostUpsertBulk

UpdateMentionedUsersJSON sets the "mentioned_users_json" field to the value that was provided on create.

func (*ForumPostUpsertBulk) UpdateNewValues

func (u *ForumPostUpsertBulk) UpdateNewValues() *ForumPostUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.ForumPost.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*ForumPostUpsertBulk) UpdateTitle

func (u *ForumPostUpsertBulk) UpdateTitle() *ForumPostUpsertBulk

UpdateTitle sets the "title" field to the value that was provided on create.

type ForumPostUpsertOne

type ForumPostUpsertOne struct {
	// contains filtered or unexported fields
}

ForumPostUpsertOne is the builder for "upsert"-ing

one ForumPost node.

func (*ForumPostUpsertOne) DoNothing

func (u *ForumPostUpsertOne) DoNothing() *ForumPostUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ForumPostUpsertOne) Exec

func (u *ForumPostUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*ForumPostUpsertOne) ExecX

func (u *ForumPostUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ForumPostUpsertOne) ID

func (u *ForumPostUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*ForumPostUpsertOne) IDX

func (u *ForumPostUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*ForumPostUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.ForumPost.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*ForumPostUpsertOne) SetContent

func (u *ForumPostUpsertOne) SetContent(v string) *ForumPostUpsertOne

SetContent sets the "content" field.

func (*ForumPostUpsertOne) SetMentionedUsersJSON

func (u *ForumPostUpsertOne) SetMentionedUsersJSON(v []int) *ForumPostUpsertOne

SetMentionedUsersJSON sets the "mentioned_users_json" field.

func (*ForumPostUpsertOne) SetTitle

SetTitle sets the "title" field.

func (*ForumPostUpsertOne) Update

func (u *ForumPostUpsertOne) Update(set func(*ForumPostUpsert)) *ForumPostUpsertOne

Update allows overriding fields `UPDATE` values. See the ForumPostCreate.OnConflict documentation for more info.

func (*ForumPostUpsertOne) UpdateContent

func (u *ForumPostUpsertOne) UpdateContent() *ForumPostUpsertOne

UpdateContent sets the "content" field to the value that was provided on create.

func (*ForumPostUpsertOne) UpdateMentionedUsersJSON

func (u *ForumPostUpsertOne) UpdateMentionedUsersJSON() *ForumPostUpsertOne

UpdateMentionedUsersJSON sets the "mentioned_users_json" field to the value that was provided on create.

func (*ForumPostUpsertOne) UpdateNewValues

func (u *ForumPostUpsertOne) UpdateNewValues() *ForumPostUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.ForumPost.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*ForumPostUpsertOne) UpdateTitle

func (u *ForumPostUpsertOne) UpdateTitle() *ForumPostUpsertOne

UpdateTitle sets the "title" field to the value that was provided on create.

type ForumPosts

type ForumPosts []*ForumPost

ForumPosts is a parsable slice of ForumPost.

type ForumQuery

type ForumQuery struct {
	// contains filtered or unexported fields
}

ForumQuery is the builder for querying Forum entities.

func (*ForumQuery) Aggregate

func (fq *ForumQuery) Aggregate(fns ...AggregateFunc) *ForumSelect

Aggregate returns a ForumSelect configured with the given aggregations.

func (*ForumQuery) All

func (fq *ForumQuery) All(ctx context.Context) ([]*Forum, error)

All executes the query and returns a list of Forums.

func (*ForumQuery) AllX

func (fq *ForumQuery) AllX(ctx context.Context) []*Forum

AllX is like All, but panics if an error occurs.

func (*ForumQuery) Clone

func (fq *ForumQuery) Clone() *ForumQuery

Clone returns a duplicate of the ForumQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ForumQuery) Count

func (fq *ForumQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ForumQuery) CountX

func (fq *ForumQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ForumQuery) Exist

func (fq *ForumQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ForumQuery) ExistX

func (fq *ForumQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ForumQuery) First

func (fq *ForumQuery) First(ctx context.Context) (*Forum, error)

First returns the first Forum entity from the query. Returns a *NotFoundError when no Forum was found.

func (*ForumQuery) FirstID

func (fq *ForumQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Forum ID from the query. Returns a *NotFoundError when no Forum ID was found.

func (*ForumQuery) FirstIDX

func (fq *ForumQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*ForumQuery) FirstX

func (fq *ForumQuery) FirstX(ctx context.Context) *Forum

FirstX is like First, but panics if an error occurs.

func (*ForumQuery) GroupBy

func (fq *ForumQuery) GroupBy(field string, fields ...string) *ForumGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Forum.Query().
	GroupBy(forum.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ForumQuery) IDs

func (fq *ForumQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Forum IDs.

func (*ForumQuery) IDsX

func (fq *ForumQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*ForumQuery) Limit

func (fq *ForumQuery) Limit(limit int) *ForumQuery

Limit the number of records to be returned by this query.

func (*ForumQuery) Offset

func (fq *ForumQuery) Offset(offset int) *ForumQuery

Offset to start from.

func (*ForumQuery) Only

func (fq *ForumQuery) Only(ctx context.Context) (*Forum, error)

Only returns a single Forum entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Forum entity is found. Returns a *NotFoundError when no Forum entities are found.

func (*ForumQuery) OnlyID

func (fq *ForumQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Forum ID in the query. Returns a *NotSingularError when more than one Forum ID is found. Returns a *NotFoundError when no entities are found.

func (*ForumQuery) OnlyIDX

func (fq *ForumQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ForumQuery) OnlyX

func (fq *ForumQuery) OnlyX(ctx context.Context) *Forum

OnlyX is like Only, but panics if an error occurs.

func (*ForumQuery) Order

func (fq *ForumQuery) Order(o ...forum.OrderOption) *ForumQuery

Order specifies how the records should be ordered.

func (*ForumQuery) QueryGroup

func (fq *ForumQuery) QueryGroup() *GroupQuery

QueryGroup chains the current query on the "group" edge.

func (*ForumQuery) QueryPosts

func (fq *ForumQuery) QueryPosts() *ForumPostQuery

QueryPosts chains the current query on the "posts" edge.

func (*ForumQuery) Select

func (fq *ForumQuery) Select(fields ...string) *ForumSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.Forum.Query().
	Select(forum.FieldName).
	Scan(ctx, &v)

func (*ForumQuery) Unique

func (fq *ForumQuery) Unique(unique bool) *ForumQuery

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 (*ForumQuery) Where

func (fq *ForumQuery) Where(ps ...predicate.Forum) *ForumQuery

Where adds a new predicate for the ForumQuery builder.

func (*ForumQuery) WithGroup

func (fq *ForumQuery) WithGroup(opts ...func(*GroupQuery)) *ForumQuery

WithGroup tells the query-builder to eager-load the nodes that are connected to the "group" edge. The optional arguments are used to configure the query builder of the edge.

func (*ForumQuery) WithPosts

func (fq *ForumQuery) WithPosts(opts ...func(*ForumPostQuery)) *ForumQuery

WithPosts tells the query-builder to eager-load the nodes that are connected to the "posts" edge. The optional arguments are used to configure the query builder of the edge.

type ForumSelect

type ForumSelect struct {
	*ForumQuery
	// contains filtered or unexported fields
}

ForumSelect is the builder for selecting fields of Forum entities.

func (*ForumSelect) Aggregate

func (fs *ForumSelect) Aggregate(fns ...AggregateFunc) *ForumSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ForumSelect) Bool

func (s *ForumSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ForumSelect) BoolX

func (s *ForumSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ForumSelect) Bools

func (s *ForumSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ForumSelect) BoolsX

func (s *ForumSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ForumSelect) Float64

func (s *ForumSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ForumSelect) Float64X

func (s *ForumSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ForumSelect) Float64s

func (s *ForumSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ForumSelect) Float64sX

func (s *ForumSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ForumSelect) Int

func (s *ForumSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ForumSelect) IntX

func (s *ForumSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ForumSelect) Ints

func (s *ForumSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ForumSelect) IntsX

func (s *ForumSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ForumSelect) Scan

func (fs *ForumSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ForumSelect) ScanX

func (s *ForumSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ForumSelect) String

func (s *ForumSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ForumSelect) StringX

func (s *ForumSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ForumSelect) Strings

func (s *ForumSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ForumSelect) StringsX

func (s *ForumSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ForumUpdate

type ForumUpdate struct {
	// contains filtered or unexported fields
}

ForumUpdate is the builder for updating Forum entities.

func (*ForumUpdate) AddPostIDs

func (fu *ForumUpdate) AddPostIDs(ids ...int) *ForumUpdate

AddPostIDs adds the "posts" edge to the ForumPost entity by IDs.

func (*ForumUpdate) AddPosts

func (fu *ForumUpdate) AddPosts(f ...*ForumPost) *ForumUpdate

AddPosts adds the "posts" edges to the ForumPost entity.

func (*ForumUpdate) ClearGroup

func (fu *ForumUpdate) ClearGroup() *ForumUpdate

ClearGroup clears the "group" edge to the Group entity.

func (*ForumUpdate) ClearPosts

func (fu *ForumUpdate) ClearPosts() *ForumUpdate

ClearPosts clears all "posts" edges to the ForumPost entity.

func (*ForumUpdate) Exec

func (fu *ForumUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ForumUpdate) ExecX

func (fu *ForumUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ForumUpdate) Mutation

func (fu *ForumUpdate) Mutation() *ForumMutation

Mutation returns the ForumMutation object of the builder.

func (*ForumUpdate) RemovePostIDs

func (fu *ForumUpdate) RemovePostIDs(ids ...int) *ForumUpdate

RemovePostIDs removes the "posts" edge to ForumPost entities by IDs.

func (*ForumUpdate) RemovePosts

func (fu *ForumUpdate) RemovePosts(f ...*ForumPost) *ForumUpdate

RemovePosts removes "posts" edges to ForumPost entities.

func (*ForumUpdate) Save

func (fu *ForumUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ForumUpdate) SaveX

func (fu *ForumUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ForumUpdate) SetDescription

func (fu *ForumUpdate) SetDescription(s string) *ForumUpdate

SetDescription sets the "description" field.

func (*ForumUpdate) SetGroup

func (fu *ForumUpdate) SetGroup(g *Group) *ForumUpdate

SetGroup sets the "group" edge to the Group entity.

func (*ForumUpdate) SetGroupID

func (fu *ForumUpdate) SetGroupID(id int) *ForumUpdate

SetGroupID sets the "group" edge to the Group entity by ID.

func (*ForumUpdate) SetName

func (fu *ForumUpdate) SetName(s string) *ForumUpdate

SetName sets the "name" field.

func (*ForumUpdate) SetShortName

func (fu *ForumUpdate) SetShortName(s string) *ForumUpdate

SetShortName sets the "short_name" field.

func (*ForumUpdate) Where

func (fu *ForumUpdate) Where(ps ...predicate.Forum) *ForumUpdate

Where appends a list predicates to the ForumUpdate builder.

type ForumUpdateOne

type ForumUpdateOne struct {
	// contains filtered or unexported fields
}

ForumUpdateOne is the builder for updating a single Forum entity.

func (*ForumUpdateOne) AddPostIDs

func (fuo *ForumUpdateOne) AddPostIDs(ids ...int) *ForumUpdateOne

AddPostIDs adds the "posts" edge to the ForumPost entity by IDs.

func (*ForumUpdateOne) AddPosts

func (fuo *ForumUpdateOne) AddPosts(f ...*ForumPost) *ForumUpdateOne

AddPosts adds the "posts" edges to the ForumPost entity.

func (*ForumUpdateOne) ClearGroup

func (fuo *ForumUpdateOne) ClearGroup() *ForumUpdateOne

ClearGroup clears the "group" edge to the Group entity.

func (*ForumUpdateOne) ClearPosts

func (fuo *ForumUpdateOne) ClearPosts() *ForumUpdateOne

ClearPosts clears all "posts" edges to the ForumPost entity.

func (*ForumUpdateOne) Exec

func (fuo *ForumUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ForumUpdateOne) ExecX

func (fuo *ForumUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ForumUpdateOne) Mutation

func (fuo *ForumUpdateOne) Mutation() *ForumMutation

Mutation returns the ForumMutation object of the builder.

func (*ForumUpdateOne) RemovePostIDs

func (fuo *ForumUpdateOne) RemovePostIDs(ids ...int) *ForumUpdateOne

RemovePostIDs removes the "posts" edge to ForumPost entities by IDs.

func (*ForumUpdateOne) RemovePosts

func (fuo *ForumUpdateOne) RemovePosts(f ...*ForumPost) *ForumUpdateOne

RemovePosts removes "posts" edges to ForumPost entities.

func (*ForumUpdateOne) Save

func (fuo *ForumUpdateOne) Save(ctx context.Context) (*Forum, error)

Save executes the query and returns the updated Forum entity.

func (*ForumUpdateOne) SaveX

func (fuo *ForumUpdateOne) SaveX(ctx context.Context) *Forum

SaveX is like Save, but panics if an error occurs.

func (*ForumUpdateOne) Select

func (fuo *ForumUpdateOne) Select(field string, fields ...string) *ForumUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ForumUpdateOne) SetDescription

func (fuo *ForumUpdateOne) SetDescription(s string) *ForumUpdateOne

SetDescription sets the "description" field.

func (*ForumUpdateOne) SetGroup

func (fuo *ForumUpdateOne) SetGroup(g *Group) *ForumUpdateOne

SetGroup sets the "group" edge to the Group entity.

func (*ForumUpdateOne) SetGroupID

func (fuo *ForumUpdateOne) SetGroupID(id int) *ForumUpdateOne

SetGroupID sets the "group" edge to the Group entity by ID.

func (*ForumUpdateOne) SetName

func (fuo *ForumUpdateOne) SetName(s string) *ForumUpdateOne

SetName sets the "name" field.

func (*ForumUpdateOne) SetShortName

func (fuo *ForumUpdateOne) SetShortName(s string) *ForumUpdateOne

SetShortName sets the "short_name" field.

func (*ForumUpdateOne) Where

func (fuo *ForumUpdateOne) Where(ps ...predicate.Forum) *ForumUpdateOne

Where appends a list predicates to the ForumUpdate builder.

type ForumUpsert

type ForumUpsert struct {
	*sql.UpdateSet
}

ForumUpsert is the "OnConflict" setter.

func (*ForumUpsert) SetDescription

func (u *ForumUpsert) SetDescription(v string) *ForumUpsert

SetDescription sets the "description" field.

func (*ForumUpsert) SetName

func (u *ForumUpsert) SetName(v string) *ForumUpsert

SetName sets the "name" field.

func (*ForumUpsert) SetShortName

func (u *ForumUpsert) SetShortName(v string) *ForumUpsert

SetShortName sets the "short_name" field.

func (*ForumUpsert) UpdateDescription

func (u *ForumUpsert) UpdateDescription() *ForumUpsert

UpdateDescription sets the "description" field to the value that was provided on create.

func (*ForumUpsert) UpdateName

func (u *ForumUpsert) UpdateName() *ForumUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*ForumUpsert) UpdateShortName

func (u *ForumUpsert) UpdateShortName() *ForumUpsert

UpdateShortName sets the "short_name" field to the value that was provided on create.

type ForumUpsertBulk

type ForumUpsertBulk struct {
	// contains filtered or unexported fields
}

ForumUpsertBulk is the builder for "upsert"-ing a bulk of Forum nodes.

func (*ForumUpsertBulk) DoNothing

func (u *ForumUpsertBulk) DoNothing() *ForumUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ForumUpsertBulk) Exec

func (u *ForumUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ForumUpsertBulk) ExecX

func (u *ForumUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ForumUpsertBulk) Ignore

func (u *ForumUpsertBulk) Ignore() *ForumUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Forum.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*ForumUpsertBulk) SetDescription

func (u *ForumUpsertBulk) SetDescription(v string) *ForumUpsertBulk

SetDescription sets the "description" field.

func (*ForumUpsertBulk) SetName

func (u *ForumUpsertBulk) SetName(v string) *ForumUpsertBulk

SetName sets the "name" field.

func (*ForumUpsertBulk) SetShortName

func (u *ForumUpsertBulk) SetShortName(v string) *ForumUpsertBulk

SetShortName sets the "short_name" field.

func (*ForumUpsertBulk) Update

func (u *ForumUpsertBulk) Update(set func(*ForumUpsert)) *ForumUpsertBulk

Update allows overriding fields `UPDATE` values. See the ForumCreateBulk.OnConflict documentation for more info.

func (*ForumUpsertBulk) UpdateDescription

func (u *ForumUpsertBulk) UpdateDescription() *ForumUpsertBulk

UpdateDescription sets the "description" field to the value that was provided on create.

func (*ForumUpsertBulk) UpdateName

func (u *ForumUpsertBulk) UpdateName() *ForumUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*ForumUpsertBulk) UpdateNewValues

func (u *ForumUpsertBulk) UpdateNewValues() *ForumUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Forum.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*ForumUpsertBulk) UpdateShortName

func (u *ForumUpsertBulk) UpdateShortName() *ForumUpsertBulk

UpdateShortName sets the "short_name" field to the value that was provided on create.

type ForumUpsertOne

type ForumUpsertOne struct {
	// contains filtered or unexported fields
}

ForumUpsertOne is the builder for "upsert"-ing

one Forum node.

func (*ForumUpsertOne) DoNothing

func (u *ForumUpsertOne) DoNothing() *ForumUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ForumUpsertOne) Exec

func (u *ForumUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*ForumUpsertOne) ExecX

func (u *ForumUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ForumUpsertOne) ID

func (u *ForumUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*ForumUpsertOne) IDX

func (u *ForumUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*ForumUpsertOne) Ignore

func (u *ForumUpsertOne) Ignore() *ForumUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Forum.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*ForumUpsertOne) SetDescription

func (u *ForumUpsertOne) SetDescription(v string) *ForumUpsertOne

SetDescription sets the "description" field.

func (*ForumUpsertOne) SetName

func (u *ForumUpsertOne) SetName(v string) *ForumUpsertOne

SetName sets the "name" field.

func (*ForumUpsertOne) SetShortName

func (u *ForumUpsertOne) SetShortName(v string) *ForumUpsertOne

SetShortName sets the "short_name" field.

func (*ForumUpsertOne) Update

func (u *ForumUpsertOne) Update(set func(*ForumUpsert)) *ForumUpsertOne

Update allows overriding fields `UPDATE` values. See the ForumCreate.OnConflict documentation for more info.

func (*ForumUpsertOne) UpdateDescription

func (u *ForumUpsertOne) UpdateDescription() *ForumUpsertOne

UpdateDescription sets the "description" field to the value that was provided on create.

func (*ForumUpsertOne) UpdateName

func (u *ForumUpsertOne) UpdateName() *ForumUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*ForumUpsertOne) UpdateNewValues

func (u *ForumUpsertOne) UpdateNewValues() *ForumUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Forum.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*ForumUpsertOne) UpdateShortName

func (u *ForumUpsertOne) UpdateShortName() *ForumUpsertOne

UpdateShortName sets the "short_name" field to the value that was provided on create.

type Forums

type Forums []*Forum

Forums is a parsable slice of Forum.

type Group

type Group struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name of the group (example: CSF01 2023)
	Name string `json:"name,omitempty"`
	// Short name of the group (example: csf01-2023)
	ShortName string `json:"short_name,omitempty"`
	// Description of the group
	Description string `json:"description,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the GroupQuery when eager-loading is set.
	Edges GroupEdges `json:"edges"`
	// contains filtered or unexported fields
}

Group is the model entity for the Group schema.

func (*Group) QueryDeadlines

func (gr *Group) QueryDeadlines() *DeadlineQuery

QueryDeadlines queries the "deadlines" edge of the Group entity.

func (*Group) QueryEvents

func (gr *Group) QueryEvents() *EventQuery

QueryEvents queries the "events" edge of the Group entity.

func (*Group) QueryForums

func (gr *Group) QueryForums() *ForumQuery

QueryForums queries the "forums" edge of the Group entity.

func (*Group) QueryGroupUsers

func (gr *Group) QueryGroupUsers() *GroupUserQuery

QueryGroupUsers queries the "group_users" edge of the Group entity.

func (*Group) QueryInstitution

func (gr *Group) QueryInstitution() *InstitutionQuery

QueryInstitution queries the "institution" edge of the Group entity.

func (*Group) QueryInvites

func (gr *Group) QueryInvites() *GroupInviteLinkQuery

QueryInvites queries the "invites" edge of the Group entity.

func (*Group) QueryUsers

func (gr *Group) QueryUsers() *UserQuery

QueryUsers queries the "users" edge of the Group entity.

func (*Group) String

func (gr *Group) String() string

String implements the fmt.Stringer.

func (*Group) Unwrap

func (gr *Group) Unwrap() *Group

Unwrap unwraps the Group 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 (*Group) Update

func (gr *Group) Update() *GroupUpdateOne

Update returns a builder for updating this Group. Note that you need to call Group.Unwrap() before calling this method if this Group was returned from a transaction, and the transaction was committed or rolled back.

func (*Group) Value

func (gr *Group) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Group. This includes values selected through modifiers, order, etc.

type GroupClient

type GroupClient struct {
	// contains filtered or unexported fields
}

GroupClient is a client for the Group schema.

func NewGroupClient

func NewGroupClient(c config) *GroupClient

NewGroupClient returns a client for the Group from the given config.

func (*GroupClient) Create

func (c *GroupClient) Create() *GroupCreate

Create returns a builder for creating a Group entity.

func (*GroupClient) CreateBulk

func (c *GroupClient) CreateBulk(builders ...*GroupCreate) *GroupCreateBulk

CreateBulk returns a builder for creating a bulk of Group entities.

func (*GroupClient) Delete

func (c *GroupClient) Delete() *GroupDelete

Delete returns a delete builder for Group.

func (*GroupClient) DeleteOne

func (c *GroupClient) DeleteOne(gr *Group) *GroupDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GroupClient) DeleteOneID

func (c *GroupClient) DeleteOneID(id int) *GroupDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*GroupClient) Get

func (c *GroupClient) Get(ctx context.Context, id int) (*Group, error)

Get returns a Group entity by its id.

func (*GroupClient) GetX

func (c *GroupClient) GetX(ctx context.Context, id int) *Group

GetX is like Get, but panics if an error occurs.

func (*GroupClient) Hooks

func (c *GroupClient) Hooks() []Hook

Hooks returns the client hooks.

func (*GroupClient) Intercept

func (c *GroupClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `entgroup.Intercept(f(g(h())))`.

func (*GroupClient) Interceptors

func (c *GroupClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*GroupClient) Query

func (c *GroupClient) Query() *GroupQuery

Query returns a query builder for Group.

func (*GroupClient) QueryDeadlines

func (c *GroupClient) QueryDeadlines(gr *Group) *DeadlineQuery

QueryDeadlines queries the deadlines edge of a Group.

func (*GroupClient) QueryEvents

func (c *GroupClient) QueryEvents(gr *Group) *EventQuery

QueryEvents queries the events edge of a Group.

func (*GroupClient) QueryForums

func (c *GroupClient) QueryForums(gr *Group) *ForumQuery

QueryForums queries the forums edge of a Group.

func (*GroupClient) QueryGroupUsers

func (c *GroupClient) QueryGroupUsers(gr *Group) *GroupUserQuery

QueryGroupUsers queries the group_users edge of a Group.

func (*GroupClient) QueryInstitution

func (c *GroupClient) QueryInstitution(gr *Group) *InstitutionQuery

QueryInstitution queries the institution edge of a Group.

func (*GroupClient) QueryInvites

func (c *GroupClient) QueryInvites(gr *Group) *GroupInviteLinkQuery

QueryInvites queries the invites edge of a Group.

func (*GroupClient) QueryUsers

func (c *GroupClient) QueryUsers(gr *Group) *UserQuery

QueryUsers queries the users edge of a Group.

func (*GroupClient) Update

func (c *GroupClient) Update() *GroupUpdate

Update returns an update builder for Group.

func (*GroupClient) UpdateOne

func (c *GroupClient) UpdateOne(gr *Group) *GroupUpdateOne

UpdateOne returns an update builder for the given entity.

func (*GroupClient) UpdateOneID

func (c *GroupClient) UpdateOneID(id int) *GroupUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GroupClient) Use

func (c *GroupClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `entgroup.Hooks(f(g(h())))`.

type GroupCreate

type GroupCreate struct {
	// contains filtered or unexported fields
}

GroupCreate is the builder for creating a Group entity.

func (*GroupCreate) AddDeadlineIDs

func (gc *GroupCreate) AddDeadlineIDs(ids ...int) *GroupCreate

AddDeadlineIDs adds the "deadlines" edge to the Deadline entity by IDs.

func (*GroupCreate) AddDeadlines

func (gc *GroupCreate) AddDeadlines(d ...*Deadline) *GroupCreate

AddDeadlines adds the "deadlines" edges to the Deadline entity.

func (*GroupCreate) AddEventIDs

func (gc *GroupCreate) AddEventIDs(ids ...int) *GroupCreate

AddEventIDs adds the "events" edge to the Event entity by IDs.

func (*GroupCreate) AddEvents

func (gc *GroupCreate) AddEvents(e ...*Event) *GroupCreate

AddEvents adds the "events" edges to the Event entity.

func (*GroupCreate) AddForumIDs

func (gc *GroupCreate) AddForumIDs(ids ...int) *GroupCreate

AddForumIDs adds the "forums" edge to the Forum entity by IDs.

func (*GroupCreate) AddForums

func (gc *GroupCreate) AddForums(f ...*Forum) *GroupCreate

AddForums adds the "forums" edges to the Forum entity.

func (*GroupCreate) AddInviteIDs

func (gc *GroupCreate) AddInviteIDs(ids ...int) *GroupCreate

AddInviteIDs adds the "invites" edge to the GroupInviteLink entity by IDs.

func (*GroupCreate) AddInvites

func (gc *GroupCreate) AddInvites(g ...*GroupInviteLink) *GroupCreate

AddInvites adds the "invites" edges to the GroupInviteLink entity.

func (*GroupCreate) AddUserIDs

func (gc *GroupCreate) AddUserIDs(ids ...int) *GroupCreate

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*GroupCreate) AddUsers

func (gc *GroupCreate) AddUsers(u ...*User) *GroupCreate

AddUsers adds the "users" edges to the User entity.

func (*GroupCreate) Exec

func (gc *GroupCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupCreate) ExecX

func (gc *GroupCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupCreate) Mutation

func (gc *GroupCreate) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupCreate) OnConflict

func (gc *GroupCreate) OnConflict(opts ...sql.ConflictOption) *GroupUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Group.Create().
	SetName(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.GroupUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*GroupCreate) OnConflictColumns

func (gc *GroupCreate) OnConflictColumns(columns ...string) *GroupUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Group.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*GroupCreate) Save

func (gc *GroupCreate) Save(ctx context.Context) (*Group, error)

Save creates the Group in the database.

func (*GroupCreate) SaveX

func (gc *GroupCreate) SaveX(ctx context.Context) *Group

SaveX calls Save and panics if Save returns an error.

func (*GroupCreate) SetDescription

func (gc *GroupCreate) SetDescription(s string) *GroupCreate

SetDescription sets the "description" field.

func (*GroupCreate) SetInstitution

func (gc *GroupCreate) SetInstitution(i *Institution) *GroupCreate

SetInstitution sets the "institution" edge to the Institution entity.

func (*GroupCreate) SetInstitutionID

func (gc *GroupCreate) SetInstitutionID(id int) *GroupCreate

SetInstitutionID sets the "institution" edge to the Institution entity by ID.

func (*GroupCreate) SetName

func (gc *GroupCreate) SetName(s string) *GroupCreate

SetName sets the "name" field.

func (*GroupCreate) SetShortName

func (gc *GroupCreate) SetShortName(s string) *GroupCreate

SetShortName sets the "short_name" field.

type GroupCreateBulk

type GroupCreateBulk struct {
	// contains filtered or unexported fields
}

GroupCreateBulk is the builder for creating many Group entities in bulk.

func (*GroupCreateBulk) Exec

func (gcb *GroupCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupCreateBulk) ExecX

func (gcb *GroupCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupCreateBulk) OnConflict

func (gcb *GroupCreateBulk) OnConflict(opts ...sql.ConflictOption) *GroupUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Group.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.GroupUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*GroupCreateBulk) OnConflictColumns

func (gcb *GroupCreateBulk) OnConflictColumns(columns ...string) *GroupUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Group.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*GroupCreateBulk) Save

func (gcb *GroupCreateBulk) Save(ctx context.Context) ([]*Group, error)

Save creates the Group entities in the database.

func (*GroupCreateBulk) SaveX

func (gcb *GroupCreateBulk) SaveX(ctx context.Context) []*Group

SaveX is like Save, but panics if an error occurs.

type GroupDelete

type GroupDelete struct {
	// contains filtered or unexported fields
}

GroupDelete is the builder for deleting a Group entity.

func (*GroupDelete) Exec

func (gd *GroupDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*GroupDelete) ExecX

func (gd *GroupDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*GroupDelete) Where

func (gd *GroupDelete) Where(ps ...predicate.Group) *GroupDelete

Where appends a list predicates to the GroupDelete builder.

type GroupDeleteOne

type GroupDeleteOne struct {
	// contains filtered or unexported fields
}

GroupDeleteOne is the builder for deleting a single Group entity.

func (*GroupDeleteOne) Exec

func (gdo *GroupDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*GroupDeleteOne) ExecX

func (gdo *GroupDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupDeleteOne) Where

func (gdo *GroupDeleteOne) Where(ps ...predicate.Group) *GroupDeleteOne

Where appends a list predicates to the GroupDelete builder.

type GroupEdges

type GroupEdges struct {
	// Users that are in the group
	Users []*User `json:"users,omitempty"`
	// Events from the group
	Events []*Event `json:"events,omitempty"`
	// Forum from the group
	Forums []*Forum `json:"forums,omitempty"`
	// Deadlines created by users from the group
	Deadlines []*Deadline `json:"deadlines,omitempty"`
	// Invites for the group
	Invites []*GroupInviteLink `json:"invites,omitempty"`
	// Institution owning this group
	Institution *Institution `json:"institution,omitempty"`
	// GroupUsers holds the value of the group_users edge.
	GroupUsers []*GroupUser `json:"group_users,omitempty"`
	// contains filtered or unexported fields
}

GroupEdges holds the relations/edges for other nodes in the graph.

func (GroupEdges) DeadlinesOrErr

func (e GroupEdges) DeadlinesOrErr() ([]*Deadline, error)

DeadlinesOrErr returns the Deadlines value or an error if the edge was not loaded in eager-loading.

func (GroupEdges) EventsOrErr

func (e GroupEdges) EventsOrErr() ([]*Event, error)

EventsOrErr returns the Events value or an error if the edge was not loaded in eager-loading.

func (GroupEdges) ForumsOrErr

func (e GroupEdges) ForumsOrErr() ([]*Forum, error)

ForumsOrErr returns the Forums value or an error if the edge was not loaded in eager-loading.

func (GroupEdges) GroupUsersOrErr

func (e GroupEdges) GroupUsersOrErr() ([]*GroupUser, error)

GroupUsersOrErr returns the GroupUsers value or an error if the edge was not loaded in eager-loading.

func (GroupEdges) InstitutionOrErr

func (e GroupEdges) InstitutionOrErr() (*Institution, error)

InstitutionOrErr returns the Institution value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (GroupEdges) InvitesOrErr

func (e GroupEdges) InvitesOrErr() ([]*GroupInviteLink, error)

InvitesOrErr returns the Invites value or an error if the edge was not loaded in eager-loading.

func (GroupEdges) UsersOrErr

func (e GroupEdges) UsersOrErr() ([]*User, error)

UsersOrErr returns the Users value or an error if the edge was not loaded in eager-loading.

type GroupGroupBy

type GroupGroupBy struct {
	// contains filtered or unexported fields
}

GroupGroupBy is the group-by builder for Group entities.

func (*GroupGroupBy) Aggregate

func (ggb *GroupGroupBy) Aggregate(fns ...AggregateFunc) *GroupGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*GroupGroupBy) Bool

func (s *GroupGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*GroupGroupBy) BoolX

func (s *GroupGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*GroupGroupBy) Bools

func (s *GroupGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*GroupGroupBy) BoolsX

func (s *GroupGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*GroupGroupBy) Float64

func (s *GroupGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*GroupGroupBy) Float64X

func (s *GroupGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*GroupGroupBy) Float64s

func (s *GroupGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*GroupGroupBy) Float64sX

func (s *GroupGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*GroupGroupBy) Int

func (s *GroupGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*GroupGroupBy) IntX

func (s *GroupGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*GroupGroupBy) Ints

func (s *GroupGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*GroupGroupBy) IntsX

func (s *GroupGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*GroupGroupBy) Scan

func (ggb *GroupGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*GroupGroupBy) ScanX

func (s *GroupGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*GroupGroupBy) String

func (s *GroupGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*GroupGroupBy) StringX

func (s *GroupGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*GroupGroupBy) Strings

func (s *GroupGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GroupGroupBy) StringsX

func (s *GroupGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GroupInviteLink struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Code used in the invite link
	Code string `json:"code,omitempty"`
	// Role granted in the invite
	Role group.Role `json:"role,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the GroupInviteLinkQuery when eager-loading is set.
	Edges GroupInviteLinkEdges `json:"edges"`
	// contains filtered or unexported fields
}

GroupInviteLink is the model entity for the GroupInviteLink schema.

func (*GroupInviteLink) QueryGroup

func (gil *GroupInviteLink) QueryGroup() *GroupQuery

QueryGroup queries the "group" edge of the GroupInviteLink entity.

func (*GroupInviteLink) String

func (gil *GroupInviteLink) String() string

String implements the fmt.Stringer.

func (*GroupInviteLink) Unwrap

func (gil *GroupInviteLink) Unwrap() *GroupInviteLink

Unwrap unwraps the GroupInviteLink 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 (*GroupInviteLink) Update

Update returns a builder for updating this GroupInviteLink. Note that you need to call GroupInviteLink.Unwrap() before calling this method if this GroupInviteLink was returned from a transaction, and the transaction was committed or rolled back.

func (*GroupInviteLink) Value

func (gil *GroupInviteLink) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the GroupInviteLink. This includes values selected through modifiers, order, etc.

type GroupInviteLinkClient

type GroupInviteLinkClient struct {
	// contains filtered or unexported fields
}

GroupInviteLinkClient is a client for the GroupInviteLink schema.

func NewGroupInviteLinkClient

func NewGroupInviteLinkClient(c config) *GroupInviteLinkClient

NewGroupInviteLinkClient returns a client for the GroupInviteLink from the given config.

func (*GroupInviteLinkClient) Create

Create returns a builder for creating a GroupInviteLink entity.

func (*GroupInviteLinkClient) CreateBulk

CreateBulk returns a builder for creating a bulk of GroupInviteLink entities.

func (*GroupInviteLinkClient) Delete

Delete returns a delete builder for GroupInviteLink.

func (*GroupInviteLinkClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GroupInviteLinkClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*GroupInviteLinkClient) Get

Get returns a GroupInviteLink entity by its id.

func (*GroupInviteLinkClient) GetX

GetX is like Get, but panics if an error occurs.

func (*GroupInviteLinkClient) Hooks

func (c *GroupInviteLinkClient) Hooks() []Hook

Hooks returns the client hooks.

func (*GroupInviteLinkClient) Intercept

func (c *GroupInviteLinkClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `groupinvitelink.Intercept(f(g(h())))`.

func (*GroupInviteLinkClient) Interceptors

func (c *GroupInviteLinkClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*GroupInviteLinkClient) Query

Query returns a query builder for GroupInviteLink.

func (*GroupInviteLinkClient) QueryGroup

func (c *GroupInviteLinkClient) QueryGroup(gil *GroupInviteLink) *GroupQuery

QueryGroup queries the group edge of a GroupInviteLink.

func (*GroupInviteLinkClient) Update

Update returns an update builder for GroupInviteLink.

func (*GroupInviteLinkClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*GroupInviteLinkClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*GroupInviteLinkClient) Use

func (c *GroupInviteLinkClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `groupinvitelink.Hooks(f(g(h())))`.

type GroupInviteLinkCreate

type GroupInviteLinkCreate struct {
	// contains filtered or unexported fields
}

GroupInviteLinkCreate is the builder for creating a GroupInviteLink entity.

func (*GroupInviteLinkCreate) Exec

func (gilc *GroupInviteLinkCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupInviteLinkCreate) ExecX

func (gilc *GroupInviteLinkCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupInviteLinkCreate) Mutation

Mutation returns the GroupInviteLinkMutation object of the builder.

func (*GroupInviteLinkCreate) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.GroupInviteLink.Create().
	SetCode(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.GroupInviteLinkUpsert) {
		SetCode(v+v).
	}).
	Exec(ctx)

func (*GroupInviteLinkCreate) OnConflictColumns

func (gilc *GroupInviteLinkCreate) OnConflictColumns(columns ...string) *GroupInviteLinkUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.GroupInviteLink.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*GroupInviteLinkCreate) Save

Save creates the GroupInviteLink in the database.

func (*GroupInviteLinkCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*GroupInviteLinkCreate) SetCode

SetCode sets the "code" field.

func (*GroupInviteLinkCreate) SetGroup

SetGroup sets the "group" edge to the Group entity.

func (*GroupInviteLinkCreate) SetGroupID

func (gilc *GroupInviteLinkCreate) SetGroupID(id int) *GroupInviteLinkCreate

SetGroupID sets the "group" edge to the Group entity by ID.

func (*GroupInviteLinkCreate) SetRole

SetRole sets the "role" field.

type GroupInviteLinkCreateBulk

type GroupInviteLinkCreateBulk struct {
	// contains filtered or unexported fields
}

GroupInviteLinkCreateBulk is the builder for creating many GroupInviteLink entities in bulk.

func (*GroupInviteLinkCreateBulk) Exec

Exec executes the query.

func (*GroupInviteLinkCreateBulk) ExecX

func (gilcb *GroupInviteLinkCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupInviteLinkCreateBulk) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.GroupInviteLink.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.GroupInviteLinkUpsert) {
		SetCode(v+v).
	}).
	Exec(ctx)

func (*GroupInviteLinkCreateBulk) OnConflictColumns

func (gilcb *GroupInviteLinkCreateBulk) OnConflictColumns(columns ...string) *GroupInviteLinkUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.GroupInviteLink.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*GroupInviteLinkCreateBulk) Save

Save creates the GroupInviteLink entities in the database.

func (*GroupInviteLinkCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type GroupInviteLinkDelete

type GroupInviteLinkDelete struct {
	// contains filtered or unexported fields
}

GroupInviteLinkDelete is the builder for deleting a GroupInviteLink entity.

func (*GroupInviteLinkDelete) Exec

func (gild *GroupInviteLinkDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*GroupInviteLinkDelete) ExecX

func (gild *GroupInviteLinkDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*GroupInviteLinkDelete) Where

Where appends a list predicates to the GroupInviteLinkDelete builder.

type GroupInviteLinkDeleteOne

type GroupInviteLinkDeleteOne struct {
	// contains filtered or unexported fields
}

GroupInviteLinkDeleteOne is the builder for deleting a single GroupInviteLink entity.

func (*GroupInviteLinkDeleteOne) Exec

func (gildo *GroupInviteLinkDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*GroupInviteLinkDeleteOne) ExecX

func (gildo *GroupInviteLinkDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupInviteLinkDeleteOne) Where

Where appends a list predicates to the GroupInviteLinkDelete builder.

type GroupInviteLinkEdges

type GroupInviteLinkEdges struct {
	// Group holds the value of the group edge.
	Group *Group `json:"group,omitempty"`
	// contains filtered or unexported fields
}

GroupInviteLinkEdges holds the relations/edges for other nodes in the graph.

func (GroupInviteLinkEdges) GroupOrErr

func (e GroupInviteLinkEdges) GroupOrErr() (*Group, error)

GroupOrErr returns the Group value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type GroupInviteLinkGroupBy

type GroupInviteLinkGroupBy struct {
	// contains filtered or unexported fields
}

GroupInviteLinkGroupBy is the group-by builder for GroupInviteLink entities.

func (*GroupInviteLinkGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*GroupInviteLinkGroupBy) Bool

func (s *GroupInviteLinkGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*GroupInviteLinkGroupBy) BoolX

func (s *GroupInviteLinkGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*GroupInviteLinkGroupBy) Bools

func (s *GroupInviteLinkGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*GroupInviteLinkGroupBy) BoolsX

func (s *GroupInviteLinkGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*GroupInviteLinkGroupBy) Float64

func (s *GroupInviteLinkGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*GroupInviteLinkGroupBy) Float64X

func (s *GroupInviteLinkGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*GroupInviteLinkGroupBy) Float64s

func (s *GroupInviteLinkGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*GroupInviteLinkGroupBy) Float64sX

func (s *GroupInviteLinkGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*GroupInviteLinkGroupBy) Int

func (s *GroupInviteLinkGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*GroupInviteLinkGroupBy) IntX

func (s *GroupInviteLinkGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*GroupInviteLinkGroupBy) Ints

func (s *GroupInviteLinkGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*GroupInviteLinkGroupBy) IntsX

func (s *GroupInviteLinkGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*GroupInviteLinkGroupBy) Scan

func (gilgb *GroupInviteLinkGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*GroupInviteLinkGroupBy) ScanX

func (s *GroupInviteLinkGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*GroupInviteLinkGroupBy) String

func (s *GroupInviteLinkGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*GroupInviteLinkGroupBy) StringX

func (s *GroupInviteLinkGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*GroupInviteLinkGroupBy) Strings

func (s *GroupInviteLinkGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GroupInviteLinkGroupBy) StringsX

func (s *GroupInviteLinkGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GroupInviteLinkMutation

type GroupInviteLinkMutation struct {
	// contains filtered or unexported fields
}

GroupInviteLinkMutation represents an operation that mutates the GroupInviteLink nodes in the graph.

func (*GroupInviteLinkMutation) AddField

func (m *GroupInviteLinkMutation) 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 (*GroupInviteLinkMutation) AddedEdges

func (m *GroupInviteLinkMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*GroupInviteLinkMutation) AddedField

func (m *GroupInviteLinkMutation) 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 (*GroupInviteLinkMutation) AddedFields

func (m *GroupInviteLinkMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*GroupInviteLinkMutation) AddedIDs

func (m *GroupInviteLinkMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*GroupInviteLinkMutation) ClearEdge

func (m *GroupInviteLinkMutation) 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 (*GroupInviteLinkMutation) ClearField

func (m *GroupInviteLinkMutation) 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 (*GroupInviteLinkMutation) ClearGroup

func (m *GroupInviteLinkMutation) ClearGroup()

ClearGroup clears the "group" edge to the Group entity.

func (*GroupInviteLinkMutation) ClearedEdges

func (m *GroupInviteLinkMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*GroupInviteLinkMutation) ClearedFields

func (m *GroupInviteLinkMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (GroupInviteLinkMutation) Client

func (m GroupInviteLinkMutation) 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 (*GroupInviteLinkMutation) Code

func (m *GroupInviteLinkMutation) Code() (r string, exists bool)

Code returns the value of the "code" field in the mutation.

func (*GroupInviteLinkMutation) EdgeCleared

func (m *GroupInviteLinkMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*GroupInviteLinkMutation) Field

func (m *GroupInviteLinkMutation) 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 (*GroupInviteLinkMutation) FieldCleared

func (m *GroupInviteLinkMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*GroupInviteLinkMutation) Fields

func (m *GroupInviteLinkMutation) 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 (*GroupInviteLinkMutation) GroupCleared

func (m *GroupInviteLinkMutation) GroupCleared() bool

GroupCleared reports if the "group" edge to the Group entity was cleared.

func (*GroupInviteLinkMutation) GroupID

func (m *GroupInviteLinkMutation) GroupID() (id int, exists bool)

GroupID returns the "group" edge ID in the mutation.

func (*GroupInviteLinkMutation) GroupIDs

func (m *GroupInviteLinkMutation) GroupIDs() (ids []int)

GroupIDs returns the "group" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use GroupID instead. It exists only for internal usage by the builders.

func (*GroupInviteLinkMutation) ID

func (m *GroupInviteLinkMutation) ID() (id int, 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 (*GroupInviteLinkMutation) IDs

func (m *GroupInviteLinkMutation) IDs(ctx context.Context) ([]int, 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 (*GroupInviteLinkMutation) OldCode

func (m *GroupInviteLinkMutation) OldCode(ctx context.Context) (v string, err error)

OldCode returns the old "code" field's value of the GroupInviteLink entity. If the GroupInviteLink 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 (*GroupInviteLinkMutation) OldField

func (m *GroupInviteLinkMutation) 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 (*GroupInviteLinkMutation) OldRole

func (m *GroupInviteLinkMutation) OldRole(ctx context.Context) (v group.Role, err error)

OldRole returns the old "role" field's value of the GroupInviteLink entity. If the GroupInviteLink 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 (*GroupInviteLinkMutation) Op

func (m *GroupInviteLinkMutation) Op() Op

Op returns the operation name.

func (*GroupInviteLinkMutation) RemovedEdges

func (m *GroupInviteLinkMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*GroupInviteLinkMutation) RemovedIDs

func (m *GroupInviteLinkMutation) 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 (*GroupInviteLinkMutation) ResetCode

func (m *GroupInviteLinkMutation) ResetCode()

ResetCode resets all changes to the "code" field.

func (*GroupInviteLinkMutation) ResetEdge

func (m *GroupInviteLinkMutation) 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 (*GroupInviteLinkMutation) ResetField

func (m *GroupInviteLinkMutation) 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 (*GroupInviteLinkMutation) ResetGroup

func (m *GroupInviteLinkMutation) ResetGroup()

ResetGroup resets all changes to the "group" edge.

func (*GroupInviteLinkMutation) ResetRole

func (m *GroupInviteLinkMutation) ResetRole()

ResetRole resets all changes to the "role" field.

func (*GroupInviteLinkMutation) Role

func (m *GroupInviteLinkMutation) Role() (r group.Role, exists bool)

Role returns the value of the "role" field in the mutation.

func (*GroupInviteLinkMutation) SetCode

func (m *GroupInviteLinkMutation) SetCode(s string)

SetCode sets the "code" field.

func (*GroupInviteLinkMutation) SetField

func (m *GroupInviteLinkMutation) 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 (*GroupInviteLinkMutation) SetGroupID

func (m *GroupInviteLinkMutation) SetGroupID(id int)

SetGroupID sets the "group" edge to the Group entity by id.

func (*GroupInviteLinkMutation) SetOp

func (m *GroupInviteLinkMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*GroupInviteLinkMutation) SetRole

func (m *GroupInviteLinkMutation) SetRole(gr group.Role)

SetRole sets the "role" field.

func (GroupInviteLinkMutation) Tx

func (m GroupInviteLinkMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*GroupInviteLinkMutation) Type

func (m *GroupInviteLinkMutation) Type() string

Type returns the node type of this mutation (GroupInviteLink).

func (*GroupInviteLinkMutation) Where

Where appends a list predicates to the GroupInviteLinkMutation builder.

func (*GroupInviteLinkMutation) WhereP

func (m *GroupInviteLinkMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the GroupInviteLinkMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type GroupInviteLinkQuery

type GroupInviteLinkQuery struct {
	// contains filtered or unexported fields
}

GroupInviteLinkQuery is the builder for querying GroupInviteLink entities.

func (*GroupInviteLinkQuery) Aggregate

func (gilq *GroupInviteLinkQuery) Aggregate(fns ...AggregateFunc) *GroupInviteLinkSelect

Aggregate returns a GroupInviteLinkSelect configured with the given aggregations.

func (*GroupInviteLinkQuery) All

All executes the query and returns a list of GroupInviteLinks.

func (*GroupInviteLinkQuery) AllX

AllX is like All, but panics if an error occurs.

func (*GroupInviteLinkQuery) Clone

Clone returns a duplicate of the GroupInviteLinkQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*GroupInviteLinkQuery) Count

func (gilq *GroupInviteLinkQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GroupInviteLinkQuery) CountX

func (gilq *GroupInviteLinkQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*GroupInviteLinkQuery) Exist

func (gilq *GroupInviteLinkQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*GroupInviteLinkQuery) ExistX

func (gilq *GroupInviteLinkQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*GroupInviteLinkQuery) First

First returns the first GroupInviteLink entity from the query. Returns a *NotFoundError when no GroupInviteLink was found.

func (*GroupInviteLinkQuery) FirstID

func (gilq *GroupInviteLinkQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first GroupInviteLink ID from the query. Returns a *NotFoundError when no GroupInviteLink ID was found.

func (*GroupInviteLinkQuery) FirstIDX

func (gilq *GroupInviteLinkQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*GroupInviteLinkQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*GroupInviteLinkQuery) GroupBy

func (gilq *GroupInviteLinkQuery) GroupBy(field string, fields ...string) *GroupInviteLinkGroupBy

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 {
	Code string `json:"code,omitempty"`
	Count int `json:"count,omitempty"`
}

client.GroupInviteLink.Query().
	GroupBy(groupinvitelink.FieldCode).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*GroupInviteLinkQuery) IDs

func (gilq *GroupInviteLinkQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of GroupInviteLink IDs.

func (*GroupInviteLinkQuery) IDsX

func (gilq *GroupInviteLinkQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*GroupInviteLinkQuery) Limit

func (gilq *GroupInviteLinkQuery) Limit(limit int) *GroupInviteLinkQuery

Limit the number of records to be returned by this query.

func (*GroupInviteLinkQuery) Offset

func (gilq *GroupInviteLinkQuery) Offset(offset int) *GroupInviteLinkQuery

Offset to start from.

func (*GroupInviteLinkQuery) Only

Only returns a single GroupInviteLink entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one GroupInviteLink entity is found. Returns a *NotFoundError when no GroupInviteLink entities are found.

func (*GroupInviteLinkQuery) OnlyID

func (gilq *GroupInviteLinkQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only GroupInviteLink ID in the query. Returns a *NotSingularError when more than one GroupInviteLink ID is found. Returns a *NotFoundError when no entities are found.

func (*GroupInviteLinkQuery) OnlyIDX

func (gilq *GroupInviteLinkQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*GroupInviteLinkQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*GroupInviteLinkQuery) Order

Order specifies how the records should be ordered.

func (*GroupInviteLinkQuery) QueryGroup

func (gilq *GroupInviteLinkQuery) QueryGroup() *GroupQuery

QueryGroup chains the current query on the "group" edge.

func (*GroupInviteLinkQuery) Select

func (gilq *GroupInviteLinkQuery) Select(fields ...string) *GroupInviteLinkSelect

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 {
	Code string `json:"code,omitempty"`
}

client.GroupInviteLink.Query().
	Select(groupinvitelink.FieldCode).
	Scan(ctx, &v)

func (*GroupInviteLinkQuery) Unique

func (gilq *GroupInviteLinkQuery) Unique(unique bool) *GroupInviteLinkQuery

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 (*GroupInviteLinkQuery) Where

Where adds a new predicate for the GroupInviteLinkQuery builder.

func (*GroupInviteLinkQuery) WithGroup

func (gilq *GroupInviteLinkQuery) WithGroup(opts ...func(*GroupQuery)) *GroupInviteLinkQuery

WithGroup tells the query-builder to eager-load the nodes that are connected to the "group" edge. The optional arguments are used to configure the query builder of the edge.

type GroupInviteLinkSelect

type GroupInviteLinkSelect struct {
	*GroupInviteLinkQuery
	// contains filtered or unexported fields
}

GroupInviteLinkSelect is the builder for selecting fields of GroupInviteLink entities.

func (*GroupInviteLinkSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*GroupInviteLinkSelect) Bool

func (s *GroupInviteLinkSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*GroupInviteLinkSelect) BoolX

func (s *GroupInviteLinkSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*GroupInviteLinkSelect) Bools

func (s *GroupInviteLinkSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*GroupInviteLinkSelect) BoolsX

func (s *GroupInviteLinkSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*GroupInviteLinkSelect) Float64

func (s *GroupInviteLinkSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*GroupInviteLinkSelect) Float64X

func (s *GroupInviteLinkSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*GroupInviteLinkSelect) Float64s

func (s *GroupInviteLinkSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*GroupInviteLinkSelect) Float64sX

func (s *GroupInviteLinkSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*GroupInviteLinkSelect) Int

func (s *GroupInviteLinkSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*GroupInviteLinkSelect) IntX

func (s *GroupInviteLinkSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*GroupInviteLinkSelect) Ints

func (s *GroupInviteLinkSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*GroupInviteLinkSelect) IntsX

func (s *GroupInviteLinkSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*GroupInviteLinkSelect) Scan

func (gils *GroupInviteLinkSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*GroupInviteLinkSelect) ScanX

func (s *GroupInviteLinkSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*GroupInviteLinkSelect) String

func (s *GroupInviteLinkSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*GroupInviteLinkSelect) StringX

func (s *GroupInviteLinkSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*GroupInviteLinkSelect) Strings

func (s *GroupInviteLinkSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GroupInviteLinkSelect) StringsX

func (s *GroupInviteLinkSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GroupInviteLinkUpdate

type GroupInviteLinkUpdate struct {
	// contains filtered or unexported fields
}

GroupInviteLinkUpdate is the builder for updating GroupInviteLink entities.

func (*GroupInviteLinkUpdate) ClearGroup

func (gilu *GroupInviteLinkUpdate) ClearGroup() *GroupInviteLinkUpdate

ClearGroup clears the "group" edge to the Group entity.

func (*GroupInviteLinkUpdate) Exec

func (gilu *GroupInviteLinkUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupInviteLinkUpdate) ExecX

func (gilu *GroupInviteLinkUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupInviteLinkUpdate) Mutation

Mutation returns the GroupInviteLinkMutation object of the builder.

func (*GroupInviteLinkUpdate) Save

func (gilu *GroupInviteLinkUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*GroupInviteLinkUpdate) SaveX

func (gilu *GroupInviteLinkUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*GroupInviteLinkUpdate) SetCode

SetCode sets the "code" field.

func (*GroupInviteLinkUpdate) SetGroup

SetGroup sets the "group" edge to the Group entity.

func (*GroupInviteLinkUpdate) SetGroupID

func (gilu *GroupInviteLinkUpdate) SetGroupID(id int) *GroupInviteLinkUpdate

SetGroupID sets the "group" edge to the Group entity by ID.

func (*GroupInviteLinkUpdate) SetRole

SetRole sets the "role" field.

func (*GroupInviteLinkUpdate) Where

Where appends a list predicates to the GroupInviteLinkUpdate builder.

type GroupInviteLinkUpdateOne

type GroupInviteLinkUpdateOne struct {
	// contains filtered or unexported fields
}

GroupInviteLinkUpdateOne is the builder for updating a single GroupInviteLink entity.

func (*GroupInviteLinkUpdateOne) ClearGroup

ClearGroup clears the "group" edge to the Group entity.

func (*GroupInviteLinkUpdateOne) Exec

func (giluo *GroupInviteLinkUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GroupInviteLinkUpdateOne) ExecX

func (giluo *GroupInviteLinkUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupInviteLinkUpdateOne) Mutation

Mutation returns the GroupInviteLinkMutation object of the builder.

func (*GroupInviteLinkUpdateOne) Save

Save executes the query and returns the updated GroupInviteLink entity.

func (*GroupInviteLinkUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*GroupInviteLinkUpdateOne) Select

func (giluo *GroupInviteLinkUpdateOne) Select(field string, fields ...string) *GroupInviteLinkUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*GroupInviteLinkUpdateOne) SetCode

SetCode sets the "code" field.

func (*GroupInviteLinkUpdateOne) SetGroup

SetGroup sets the "group" edge to the Group entity.

func (*GroupInviteLinkUpdateOne) SetGroupID

func (giluo *GroupInviteLinkUpdateOne) SetGroupID(id int) *GroupInviteLinkUpdateOne

SetGroupID sets the "group" edge to the Group entity by ID.

func (*GroupInviteLinkUpdateOne) SetRole

SetRole sets the "role" field.

func (*GroupInviteLinkUpdateOne) Where

Where appends a list predicates to the GroupInviteLinkUpdate builder.

type GroupInviteLinkUpsert

type GroupInviteLinkUpsert struct {
	*sql.UpdateSet
}

GroupInviteLinkUpsert is the "OnConflict" setter.

func (*GroupInviteLinkUpsert) SetCode

SetCode sets the "code" field.

func (*GroupInviteLinkUpsert) SetRole

SetRole sets the "role" field.

func (*GroupInviteLinkUpsert) UpdateCode

UpdateCode sets the "code" field to the value that was provided on create.

func (*GroupInviteLinkUpsert) UpdateRole

UpdateRole sets the "role" field to the value that was provided on create.

type GroupInviteLinkUpsertBulk

type GroupInviteLinkUpsertBulk struct {
	// contains filtered or unexported fields
}

GroupInviteLinkUpsertBulk is the builder for "upsert"-ing a bulk of GroupInviteLink nodes.

func (*GroupInviteLinkUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*GroupInviteLinkUpsertBulk) Exec

Exec executes the query.

func (*GroupInviteLinkUpsertBulk) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*GroupInviteLinkUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.GroupInviteLink.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*GroupInviteLinkUpsertBulk) SetCode

SetCode sets the "code" field.

func (*GroupInviteLinkUpsertBulk) SetRole

SetRole sets the "role" field.

func (*GroupInviteLinkUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the GroupInviteLinkCreateBulk.OnConflict documentation for more info.

func (*GroupInviteLinkUpsertBulk) UpdateCode

UpdateCode sets the "code" field to the value that was provided on create.

func (*GroupInviteLinkUpsertBulk) UpdateNewValues

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.GroupInviteLink.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*GroupInviteLinkUpsertBulk) UpdateRole

UpdateRole sets the "role" field to the value that was provided on create.

type GroupInviteLinkUpsertOne

type GroupInviteLinkUpsertOne struct {
	// contains filtered or unexported fields
}

GroupInviteLinkUpsertOne is the builder for "upsert"-ing

one GroupInviteLink node.

func (*GroupInviteLinkUpsertOne) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*GroupInviteLinkUpsertOne) Exec

Exec executes the query.

func (*GroupInviteLinkUpsertOne) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*GroupInviteLinkUpsertOne) ID

func (u *GroupInviteLinkUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*GroupInviteLinkUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*GroupInviteLinkUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.GroupInviteLink.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*GroupInviteLinkUpsertOne) SetCode

SetCode sets the "code" field.

func (*GroupInviteLinkUpsertOne) SetRole

SetRole sets the "role" field.

func (*GroupInviteLinkUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the GroupInviteLinkCreate.OnConflict documentation for more info.

func (*GroupInviteLinkUpsertOne) UpdateCode

UpdateCode sets the "code" field to the value that was provided on create.

func (*GroupInviteLinkUpsertOne) UpdateNewValues

func (u *GroupInviteLinkUpsertOne) UpdateNewValues() *GroupInviteLinkUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.GroupInviteLink.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*GroupInviteLinkUpsertOne) UpdateRole

UpdateRole sets the "role" field to the value that was provided on create.

type GroupInviteLinks []*GroupInviteLink

GroupInviteLinks is a parsable slice of GroupInviteLink.

type GroupMutation

type GroupMutation struct {
	// contains filtered or unexported fields
}

GroupMutation represents an operation that mutates the Group nodes in the graph.

func (*GroupMutation) AddDeadlineIDs

func (m *GroupMutation) AddDeadlineIDs(ids ...int)

AddDeadlineIDs adds the "deadlines" edge to the Deadline entity by ids.

func (*GroupMutation) AddEventIDs

func (m *GroupMutation) AddEventIDs(ids ...int)

AddEventIDs adds the "events" edge to the Event entity by ids.

func (*GroupMutation) AddField

func (m *GroupMutation) 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 (*GroupMutation) AddForumIDs

func (m *GroupMutation) AddForumIDs(ids ...int)

AddForumIDs adds the "forums" edge to the Forum entity by ids.

func (*GroupMutation) AddInviteIDs

func (m *GroupMutation) AddInviteIDs(ids ...int)

AddInviteIDs adds the "invites" edge to the GroupInviteLink entity by ids.

func (*GroupMutation) AddUserIDs

func (m *GroupMutation) AddUserIDs(ids ...int)

AddUserIDs adds the "users" edge to the User entity by ids.

func (*GroupMutation) AddedEdges

func (m *GroupMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*GroupMutation) AddedField

func (m *GroupMutation) 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 (*GroupMutation) AddedFields

func (m *GroupMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*GroupMutation) AddedIDs

func (m *GroupMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*GroupMutation) ClearDeadlines

func (m *GroupMutation) ClearDeadlines()

ClearDeadlines clears the "deadlines" edge to the Deadline entity.

func (*GroupMutation) ClearEdge

func (m *GroupMutation) 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 (*GroupMutation) ClearEvents

func (m *GroupMutation) ClearEvents()

ClearEvents clears the "events" edge to the Event entity.

func (*GroupMutation) ClearField

func (m *GroupMutation) 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 (*GroupMutation) ClearForums

func (m *GroupMutation) ClearForums()

ClearForums clears the "forums" edge to the Forum entity.

func (*GroupMutation) ClearInstitution

func (m *GroupMutation) ClearInstitution()

ClearInstitution clears the "institution" edge to the Institution entity.

func (*GroupMutation) ClearInvites

func (m *GroupMutation) ClearInvites()

ClearInvites clears the "invites" edge to the GroupInviteLink entity.

func (*GroupMutation) ClearUsers

func (m *GroupMutation) ClearUsers()

ClearUsers clears the "users" edge to the User entity.

func (*GroupMutation) ClearedEdges

func (m *GroupMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*GroupMutation) ClearedFields

func (m *GroupMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (GroupMutation) Client

func (m GroupMutation) 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 (*GroupMutation) DeadlinesCleared

func (m *GroupMutation) DeadlinesCleared() bool

DeadlinesCleared reports if the "deadlines" edge to the Deadline entity was cleared.

func (*GroupMutation) DeadlinesIDs

func (m *GroupMutation) DeadlinesIDs() (ids []int)

DeadlinesIDs returns the "deadlines" edge IDs in the mutation.

func (*GroupMutation) Description

func (m *GroupMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*GroupMutation) EdgeCleared

func (m *GroupMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*GroupMutation) EventsCleared

func (m *GroupMutation) EventsCleared() bool

EventsCleared reports if the "events" edge to the Event entity was cleared.

func (*GroupMutation) EventsIDs

func (m *GroupMutation) EventsIDs() (ids []int)

EventsIDs returns the "events" edge IDs in the mutation.

func (*GroupMutation) Field

func (m *GroupMutation) 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 (*GroupMutation) FieldCleared

func (m *GroupMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*GroupMutation) Fields

func (m *GroupMutation) 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 (*GroupMutation) ForumsCleared

func (m *GroupMutation) ForumsCleared() bool

ForumsCleared reports if the "forums" edge to the Forum entity was cleared.

func (*GroupMutation) ForumsIDs

func (m *GroupMutation) ForumsIDs() (ids []int)

ForumsIDs returns the "forums" edge IDs in the mutation.

func (*GroupMutation) ID

func (m *GroupMutation) ID() (id int, 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 (*GroupMutation) IDs

func (m *GroupMutation) IDs(ctx context.Context) ([]int, 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 (*GroupMutation) InstitutionCleared

func (m *GroupMutation) InstitutionCleared() bool

InstitutionCleared reports if the "institution" edge to the Institution entity was cleared.

func (*GroupMutation) InstitutionID

func (m *GroupMutation) InstitutionID() (id int, exists bool)

InstitutionID returns the "institution" edge ID in the mutation.

func (*GroupMutation) InstitutionIDs

func (m *GroupMutation) InstitutionIDs() (ids []int)

InstitutionIDs returns the "institution" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use InstitutionID instead. It exists only for internal usage by the builders.

func (*GroupMutation) InvitesCleared

func (m *GroupMutation) InvitesCleared() bool

InvitesCleared reports if the "invites" edge to the GroupInviteLink entity was cleared.

func (*GroupMutation) InvitesIDs

func (m *GroupMutation) InvitesIDs() (ids []int)

InvitesIDs returns the "invites" edge IDs in the mutation.

func (*GroupMutation) Name

func (m *GroupMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*GroupMutation) OldDescription

func (m *GroupMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Group entity. If the Group 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 (*GroupMutation) OldField

func (m *GroupMutation) 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 (*GroupMutation) OldName

func (m *GroupMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Group entity. If the Group 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 (*GroupMutation) OldShortName

func (m *GroupMutation) OldShortName(ctx context.Context) (v string, err error)

OldShortName returns the old "short_name" field's value of the Group entity. If the Group 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 (*GroupMutation) Op

func (m *GroupMutation) Op() Op

Op returns the operation name.

func (*GroupMutation) RemoveDeadlineIDs

func (m *GroupMutation) RemoveDeadlineIDs(ids ...int)

RemoveDeadlineIDs removes the "deadlines" edge to the Deadline entity by IDs.

func (*GroupMutation) RemoveEventIDs

func (m *GroupMutation) RemoveEventIDs(ids ...int)

RemoveEventIDs removes the "events" edge to the Event entity by IDs.

func (*GroupMutation) RemoveForumIDs

func (m *GroupMutation) RemoveForumIDs(ids ...int)

RemoveForumIDs removes the "forums" edge to the Forum entity by IDs.

func (*GroupMutation) RemoveInviteIDs

func (m *GroupMutation) RemoveInviteIDs(ids ...int)

RemoveInviteIDs removes the "invites" edge to the GroupInviteLink entity by IDs.

func (*GroupMutation) RemoveUserIDs

func (m *GroupMutation) RemoveUserIDs(ids ...int)

RemoveUserIDs removes the "users" edge to the User entity by IDs.

func (*GroupMutation) RemovedDeadlinesIDs

func (m *GroupMutation) RemovedDeadlinesIDs() (ids []int)

RemovedDeadlines returns the removed IDs of the "deadlines" edge to the Deadline entity.

func (*GroupMutation) RemovedEdges

func (m *GroupMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*GroupMutation) RemovedEventsIDs

func (m *GroupMutation) RemovedEventsIDs() (ids []int)

RemovedEvents returns the removed IDs of the "events" edge to the Event entity.

func (*GroupMutation) RemovedForumsIDs

func (m *GroupMutation) RemovedForumsIDs() (ids []int)

RemovedForums returns the removed IDs of the "forums" edge to the Forum entity.

func (*GroupMutation) RemovedIDs

func (m *GroupMutation) 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 (*GroupMutation) RemovedInvitesIDs

func (m *GroupMutation) RemovedInvitesIDs() (ids []int)

RemovedInvites returns the removed IDs of the "invites" edge to the GroupInviteLink entity.

func (*GroupMutation) RemovedUsersIDs

func (m *GroupMutation) RemovedUsersIDs() (ids []int)

RemovedUsers returns the removed IDs of the "users" edge to the User entity.

func (*GroupMutation) ResetDeadlines

func (m *GroupMutation) ResetDeadlines()

ResetDeadlines resets all changes to the "deadlines" edge.

func (*GroupMutation) ResetDescription

func (m *GroupMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*GroupMutation) ResetEdge

func (m *GroupMutation) 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 (*GroupMutation) ResetEvents

func (m *GroupMutation) ResetEvents()

ResetEvents resets all changes to the "events" edge.

func (*GroupMutation) ResetField

func (m *GroupMutation) 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 (*GroupMutation) ResetForums

func (m *GroupMutation) ResetForums()

ResetForums resets all changes to the "forums" edge.

func (*GroupMutation) ResetInstitution

func (m *GroupMutation) ResetInstitution()

ResetInstitution resets all changes to the "institution" edge.

func (*GroupMutation) ResetInvites

func (m *GroupMutation) ResetInvites()

ResetInvites resets all changes to the "invites" edge.

func (*GroupMutation) ResetName

func (m *GroupMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*GroupMutation) ResetShortName

func (m *GroupMutation) ResetShortName()

ResetShortName resets all changes to the "short_name" field.

func (*GroupMutation) ResetUsers

func (m *GroupMutation) ResetUsers()

ResetUsers resets all changes to the "users" edge.

func (*GroupMutation) SetDescription

func (m *GroupMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*GroupMutation) SetField

func (m *GroupMutation) 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 (*GroupMutation) SetInstitutionID

func (m *GroupMutation) SetInstitutionID(id int)

SetInstitutionID sets the "institution" edge to the Institution entity by id.

func (*GroupMutation) SetName

func (m *GroupMutation) SetName(s string)

SetName sets the "name" field.

func (*GroupMutation) SetOp

func (m *GroupMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*GroupMutation) SetShortName

func (m *GroupMutation) SetShortName(s string)

SetShortName sets the "short_name" field.

func (*GroupMutation) ShortName

func (m *GroupMutation) ShortName() (r string, exists bool)

ShortName returns the value of the "short_name" field in the mutation.

func (GroupMutation) Tx

func (m GroupMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*GroupMutation) Type

func (m *GroupMutation) Type() string

Type returns the node type of this mutation (Group).

func (*GroupMutation) UsersCleared

func (m *GroupMutation) UsersCleared() bool

UsersCleared reports if the "users" edge to the User entity was cleared.

func (*GroupMutation) UsersIDs

func (m *GroupMutation) UsersIDs() (ids []int)

UsersIDs returns the "users" edge IDs in the mutation.

func (*GroupMutation) Where

func (m *GroupMutation) Where(ps ...predicate.Group)

Where appends a list predicates to the GroupMutation builder.

func (*GroupMutation) WhereP

func (m *GroupMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the GroupMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type GroupQuery

type GroupQuery struct {
	// contains filtered or unexported fields
}

GroupQuery is the builder for querying Group entities.

func (*GroupQuery) Aggregate

func (gq *GroupQuery) Aggregate(fns ...AggregateFunc) *GroupSelect

Aggregate returns a GroupSelect configured with the given aggregations.

func (*GroupQuery) All

func (gq *GroupQuery) All(ctx context.Context) ([]*Group, error)

All executes the query and returns a list of Groups.

func (*GroupQuery) AllX

func (gq *GroupQuery) AllX(ctx context.Context) []*Group

AllX is like All, but panics if an error occurs.

func (*GroupQuery) Clone

func (gq *GroupQuery) Clone() *GroupQuery

Clone returns a duplicate of the GroupQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*GroupQuery) Count

func (gq *GroupQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GroupQuery) CountX

func (gq *GroupQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*GroupQuery) Exist

func (gq *GroupQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*GroupQuery) ExistX

func (gq *GroupQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*GroupQuery) First

func (gq *GroupQuery) First(ctx context.Context) (*Group, error)

First returns the first Group entity from the query. Returns a *NotFoundError when no Group was found.

func (*GroupQuery) FirstID

func (gq *GroupQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Group ID from the query. Returns a *NotFoundError when no Group ID was found.

func (*GroupQuery) FirstIDX

func (gq *GroupQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*GroupQuery) FirstX

func (gq *GroupQuery) FirstX(ctx context.Context) *Group

FirstX is like First, but panics if an error occurs.

func (*GroupQuery) GroupBy

func (gq *GroupQuery) GroupBy(field string, fields ...string) *GroupGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Group.Query().
	GroupBy(entgroup.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*GroupQuery) IDs

func (gq *GroupQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Group IDs.

func (*GroupQuery) IDsX

func (gq *GroupQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*GroupQuery) Limit

func (gq *GroupQuery) Limit(limit int) *GroupQuery

Limit the number of records to be returned by this query.

func (*GroupQuery) Offset

func (gq *GroupQuery) Offset(offset int) *GroupQuery

Offset to start from.

func (*GroupQuery) Only

func (gq *GroupQuery) Only(ctx context.Context) (*Group, error)

Only returns a single Group entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Group entity is found. Returns a *NotFoundError when no Group entities are found.

func (*GroupQuery) OnlyID

func (gq *GroupQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Group ID in the query. Returns a *NotSingularError when more than one Group ID is found. Returns a *NotFoundError when no entities are found.

func (*GroupQuery) OnlyIDX

func (gq *GroupQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*GroupQuery) OnlyX

func (gq *GroupQuery) OnlyX(ctx context.Context) *Group

OnlyX is like Only, but panics if an error occurs.

func (*GroupQuery) Order

func (gq *GroupQuery) Order(o ...entgroup.OrderOption) *GroupQuery

Order specifies how the records should be ordered.

func (*GroupQuery) QueryDeadlines

func (gq *GroupQuery) QueryDeadlines() *DeadlineQuery

QueryDeadlines chains the current query on the "deadlines" edge.

func (*GroupQuery) QueryEvents

func (gq *GroupQuery) QueryEvents() *EventQuery

QueryEvents chains the current query on the "events" edge.

func (*GroupQuery) QueryForums

func (gq *GroupQuery) QueryForums() *ForumQuery

QueryForums chains the current query on the "forums" edge.

func (*GroupQuery) QueryGroupUsers

func (gq *GroupQuery) QueryGroupUsers() *GroupUserQuery

QueryGroupUsers chains the current query on the "group_users" edge.

func (*GroupQuery) QueryInstitution

func (gq *GroupQuery) QueryInstitution() *InstitutionQuery

QueryInstitution chains the current query on the "institution" edge.

func (*GroupQuery) QueryInvites

func (gq *GroupQuery) QueryInvites() *GroupInviteLinkQuery

QueryInvites chains the current query on the "invites" edge.

func (*GroupQuery) QueryUsers

func (gq *GroupQuery) QueryUsers() *UserQuery

QueryUsers chains the current query on the "users" edge.

func (*GroupQuery) Select

func (gq *GroupQuery) Select(fields ...string) *GroupSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.Group.Query().
	Select(entgroup.FieldName).
	Scan(ctx, &v)

func (*GroupQuery) Unique

func (gq *GroupQuery) Unique(unique bool) *GroupQuery

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 (*GroupQuery) Where

func (gq *GroupQuery) Where(ps ...predicate.Group) *GroupQuery

Where adds a new predicate for the GroupQuery builder.

func (*GroupQuery) WithDeadlines

func (gq *GroupQuery) WithDeadlines(opts ...func(*DeadlineQuery)) *GroupQuery

WithDeadlines tells the query-builder to eager-load the nodes that are connected to the "deadlines" edge. The optional arguments are used to configure the query builder of the edge.

func (*GroupQuery) WithEvents

func (gq *GroupQuery) WithEvents(opts ...func(*EventQuery)) *GroupQuery

WithEvents tells the query-builder to eager-load the nodes that are connected to the "events" edge. The optional arguments are used to configure the query builder of the edge.

func (*GroupQuery) WithForums

func (gq *GroupQuery) WithForums(opts ...func(*ForumQuery)) *GroupQuery

WithForums tells the query-builder to eager-load the nodes that are connected to the "forums" edge. The optional arguments are used to configure the query builder of the edge.

func (*GroupQuery) WithGroupUsers

func (gq *GroupQuery) WithGroupUsers(opts ...func(*GroupUserQuery)) *GroupQuery

WithGroupUsers tells the query-builder to eager-load the nodes that are connected to the "group_users" edge. The optional arguments are used to configure the query builder of the edge.

func (*GroupQuery) WithInstitution

func (gq *GroupQuery) WithInstitution(opts ...func(*InstitutionQuery)) *GroupQuery

WithInstitution tells the query-builder to eager-load the nodes that are connected to the "institution" edge. The optional arguments are used to configure the query builder of the edge.

func (*GroupQuery) WithInvites

func (gq *GroupQuery) WithInvites(opts ...func(*GroupInviteLinkQuery)) *GroupQuery

WithInvites tells the query-builder to eager-load the nodes that are connected to the "invites" edge. The optional arguments are used to configure the query builder of the edge.

func (*GroupQuery) WithUsers

func (gq *GroupQuery) WithUsers(opts ...func(*UserQuery)) *GroupQuery

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 GroupSelect

type GroupSelect struct {
	*GroupQuery
	// contains filtered or unexported fields
}

GroupSelect is the builder for selecting fields of Group entities.

func (*GroupSelect) Aggregate

func (gs *GroupSelect) Aggregate(fns ...AggregateFunc) *GroupSelect

Aggregate adds the given aggregation functions to the selector query.

func (*GroupSelect) Bool

func (s *GroupSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*GroupSelect) BoolX

func (s *GroupSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*GroupSelect) Bools

func (s *GroupSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*GroupSelect) BoolsX

func (s *GroupSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*GroupSelect) Float64

func (s *GroupSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*GroupSelect) Float64X

func (s *GroupSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*GroupSelect) Float64s

func (s *GroupSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*GroupSelect) Float64sX

func (s *GroupSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*GroupSelect) Int

func (s *GroupSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*GroupSelect) IntX

func (s *GroupSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*GroupSelect) Ints

func (s *GroupSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*GroupSelect) IntsX

func (s *GroupSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*GroupSelect) Scan

func (gs *GroupSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*GroupSelect) ScanX

func (s *GroupSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*GroupSelect) String

func (s *GroupSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*GroupSelect) StringX

func (s *GroupSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*GroupSelect) Strings

func (s *GroupSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GroupSelect) StringsX

func (s *GroupSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GroupUpdate

type GroupUpdate struct {
	// contains filtered or unexported fields
}

GroupUpdate is the builder for updating Group entities.

func (*GroupUpdate) AddDeadlineIDs

func (gu *GroupUpdate) AddDeadlineIDs(ids ...int) *GroupUpdate

AddDeadlineIDs adds the "deadlines" edge to the Deadline entity by IDs.

func (*GroupUpdate) AddDeadlines

func (gu *GroupUpdate) AddDeadlines(d ...*Deadline) *GroupUpdate

AddDeadlines adds the "deadlines" edges to the Deadline entity.

func (*GroupUpdate) AddEventIDs

func (gu *GroupUpdate) AddEventIDs(ids ...int) *GroupUpdate

AddEventIDs adds the "events" edge to the Event entity by IDs.

func (*GroupUpdate) AddEvents

func (gu *GroupUpdate) AddEvents(e ...*Event) *GroupUpdate

AddEvents adds the "events" edges to the Event entity.

func (*GroupUpdate) AddForumIDs

func (gu *GroupUpdate) AddForumIDs(ids ...int) *GroupUpdate

AddForumIDs adds the "forums" edge to the Forum entity by IDs.

func (*GroupUpdate) AddForums

func (gu *GroupUpdate) AddForums(f ...*Forum) *GroupUpdate

AddForums adds the "forums" edges to the Forum entity.

func (*GroupUpdate) AddInviteIDs

func (gu *GroupUpdate) AddInviteIDs(ids ...int) *GroupUpdate

AddInviteIDs adds the "invites" edge to the GroupInviteLink entity by IDs.

func (*GroupUpdate) AddInvites

func (gu *GroupUpdate) AddInvites(g ...*GroupInviteLink) *GroupUpdate

AddInvites adds the "invites" edges to the GroupInviteLink entity.

func (*GroupUpdate) AddUserIDs

func (gu *GroupUpdate) AddUserIDs(ids ...int) *GroupUpdate

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*GroupUpdate) AddUsers

func (gu *GroupUpdate) AddUsers(u ...*User) *GroupUpdate

AddUsers adds the "users" edges to the User entity.

func (*GroupUpdate) ClearDeadlines

func (gu *GroupUpdate) ClearDeadlines() *GroupUpdate

ClearDeadlines clears all "deadlines" edges to the Deadline entity.

func (*GroupUpdate) ClearEvents

func (gu *GroupUpdate) ClearEvents() *GroupUpdate

ClearEvents clears all "events" edges to the Event entity.

func (*GroupUpdate) ClearForums

func (gu *GroupUpdate) ClearForums() *GroupUpdate

ClearForums clears all "forums" edges to the Forum entity.

func (*GroupUpdate) ClearInstitution

func (gu *GroupUpdate) ClearInstitution() *GroupUpdate

ClearInstitution clears the "institution" edge to the Institution entity.

func (*GroupUpdate) ClearInvites

func (gu *GroupUpdate) ClearInvites() *GroupUpdate

ClearInvites clears all "invites" edges to the GroupInviteLink entity.

func (*GroupUpdate) ClearUsers

func (gu *GroupUpdate) ClearUsers() *GroupUpdate

ClearUsers clears all "users" edges to the User entity.

func (*GroupUpdate) Exec

func (gu *GroupUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupUpdate) ExecX

func (gu *GroupUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupUpdate) Mutation

func (gu *GroupUpdate) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupUpdate) RemoveDeadlineIDs

func (gu *GroupUpdate) RemoveDeadlineIDs(ids ...int) *GroupUpdate

RemoveDeadlineIDs removes the "deadlines" edge to Deadline entities by IDs.

func (*GroupUpdate) RemoveDeadlines

func (gu *GroupUpdate) RemoveDeadlines(d ...*Deadline) *GroupUpdate

RemoveDeadlines removes "deadlines" edges to Deadline entities.

func (*GroupUpdate) RemoveEventIDs

func (gu *GroupUpdate) RemoveEventIDs(ids ...int) *GroupUpdate

RemoveEventIDs removes the "events" edge to Event entities by IDs.

func (*GroupUpdate) RemoveEvents

func (gu *GroupUpdate) RemoveEvents(e ...*Event) *GroupUpdate

RemoveEvents removes "events" edges to Event entities.

func (*GroupUpdate) RemoveForumIDs

func (gu *GroupUpdate) RemoveForumIDs(ids ...int) *GroupUpdate

RemoveForumIDs removes the "forums" edge to Forum entities by IDs.

func (*GroupUpdate) RemoveForums

func (gu *GroupUpdate) RemoveForums(f ...*Forum) *GroupUpdate

RemoveForums removes "forums" edges to Forum entities.

func (*GroupUpdate) RemoveInviteIDs

func (gu *GroupUpdate) RemoveInviteIDs(ids ...int) *GroupUpdate

RemoveInviteIDs removes the "invites" edge to GroupInviteLink entities by IDs.

func (*GroupUpdate) RemoveInvites

func (gu *GroupUpdate) RemoveInvites(g ...*GroupInviteLink) *GroupUpdate

RemoveInvites removes "invites" edges to GroupInviteLink entities.

func (*GroupUpdate) RemoveUserIDs

func (gu *GroupUpdate) RemoveUserIDs(ids ...int) *GroupUpdate

RemoveUserIDs removes the "users" edge to User entities by IDs.

func (*GroupUpdate) RemoveUsers

func (gu *GroupUpdate) RemoveUsers(u ...*User) *GroupUpdate

RemoveUsers removes "users" edges to User entities.

func (*GroupUpdate) Save

func (gu *GroupUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*GroupUpdate) SaveX

func (gu *GroupUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*GroupUpdate) SetDescription

func (gu *GroupUpdate) SetDescription(s string) *GroupUpdate

SetDescription sets the "description" field.

func (*GroupUpdate) SetInstitution

func (gu *GroupUpdate) SetInstitution(i *Institution) *GroupUpdate

SetInstitution sets the "institution" edge to the Institution entity.

func (*GroupUpdate) SetInstitutionID

func (gu *GroupUpdate) SetInstitutionID(id int) *GroupUpdate

SetInstitutionID sets the "institution" edge to the Institution entity by ID.

func (*GroupUpdate) SetName

func (gu *GroupUpdate) SetName(s string) *GroupUpdate

SetName sets the "name" field.

func (*GroupUpdate) SetShortName

func (gu *GroupUpdate) SetShortName(s string) *GroupUpdate

SetShortName sets the "short_name" field.

func (*GroupUpdate) Where

func (gu *GroupUpdate) Where(ps ...predicate.Group) *GroupUpdate

Where appends a list predicates to the GroupUpdate builder.

type GroupUpdateOne

type GroupUpdateOne struct {
	// contains filtered or unexported fields
}

GroupUpdateOne is the builder for updating a single Group entity.

func (*GroupUpdateOne) AddDeadlineIDs

func (guo *GroupUpdateOne) AddDeadlineIDs(ids ...int) *GroupUpdateOne

AddDeadlineIDs adds the "deadlines" edge to the Deadline entity by IDs.

func (*GroupUpdateOne) AddDeadlines

func (guo *GroupUpdateOne) AddDeadlines(d ...*Deadline) *GroupUpdateOne

AddDeadlines adds the "deadlines" edges to the Deadline entity.

func (*GroupUpdateOne) AddEventIDs

func (guo *GroupUpdateOne) AddEventIDs(ids ...int) *GroupUpdateOne

AddEventIDs adds the "events" edge to the Event entity by IDs.

func (*GroupUpdateOne) AddEvents

func (guo *GroupUpdateOne) AddEvents(e ...*Event) *GroupUpdateOne

AddEvents adds the "events" edges to the Event entity.

func (*GroupUpdateOne) AddForumIDs

func (guo *GroupUpdateOne) AddForumIDs(ids ...int) *GroupUpdateOne

AddForumIDs adds the "forums" edge to the Forum entity by IDs.

func (*GroupUpdateOne) AddForums

func (guo *GroupUpdateOne) AddForums(f ...*Forum) *GroupUpdateOne

AddForums adds the "forums" edges to the Forum entity.

func (*GroupUpdateOne) AddInviteIDs

func (guo *GroupUpdateOne) AddInviteIDs(ids ...int) *GroupUpdateOne

AddInviteIDs adds the "invites" edge to the GroupInviteLink entity by IDs.

func (*GroupUpdateOne) AddInvites

func (guo *GroupUpdateOne) AddInvites(g ...*GroupInviteLink) *GroupUpdateOne

AddInvites adds the "invites" edges to the GroupInviteLink entity.

func (*GroupUpdateOne) AddUserIDs

func (guo *GroupUpdateOne) AddUserIDs(ids ...int) *GroupUpdateOne

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*GroupUpdateOne) AddUsers

func (guo *GroupUpdateOne) AddUsers(u ...*User) *GroupUpdateOne

AddUsers adds the "users" edges to the User entity.

func (*GroupUpdateOne) ClearDeadlines

func (guo *GroupUpdateOne) ClearDeadlines() *GroupUpdateOne

ClearDeadlines clears all "deadlines" edges to the Deadline entity.

func (*GroupUpdateOne) ClearEvents

func (guo *GroupUpdateOne) ClearEvents() *GroupUpdateOne

ClearEvents clears all "events" edges to the Event entity.

func (*GroupUpdateOne) ClearForums

func (guo *GroupUpdateOne) ClearForums() *GroupUpdateOne

ClearForums clears all "forums" edges to the Forum entity.

func (*GroupUpdateOne) ClearInstitution

func (guo *GroupUpdateOne) ClearInstitution() *GroupUpdateOne

ClearInstitution clears the "institution" edge to the Institution entity.

func (*GroupUpdateOne) ClearInvites

func (guo *GroupUpdateOne) ClearInvites() *GroupUpdateOne

ClearInvites clears all "invites" edges to the GroupInviteLink entity.

func (*GroupUpdateOne) ClearUsers

func (guo *GroupUpdateOne) ClearUsers() *GroupUpdateOne

ClearUsers clears all "users" edges to the User entity.

func (*GroupUpdateOne) Exec

func (guo *GroupUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GroupUpdateOne) ExecX

func (guo *GroupUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupUpdateOne) Mutation

func (guo *GroupUpdateOne) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupUpdateOne) RemoveDeadlineIDs

func (guo *GroupUpdateOne) RemoveDeadlineIDs(ids ...int) *GroupUpdateOne

RemoveDeadlineIDs removes the "deadlines" edge to Deadline entities by IDs.

func (*GroupUpdateOne) RemoveDeadlines

func (guo *GroupUpdateOne) RemoveDeadlines(d ...*Deadline) *GroupUpdateOne

RemoveDeadlines removes "deadlines" edges to Deadline entities.

func (*GroupUpdateOne) RemoveEventIDs

func (guo *GroupUpdateOne) RemoveEventIDs(ids ...int) *GroupUpdateOne

RemoveEventIDs removes the "events" edge to Event entities by IDs.

func (*GroupUpdateOne) RemoveEvents

func (guo *GroupUpdateOne) RemoveEvents(e ...*Event) *GroupUpdateOne

RemoveEvents removes "events" edges to Event entities.

func (*GroupUpdateOne) RemoveForumIDs

func (guo *GroupUpdateOne) RemoveForumIDs(ids ...int) *GroupUpdateOne

RemoveForumIDs removes the "forums" edge to Forum entities by IDs.

func (*GroupUpdateOne) RemoveForums

func (guo *GroupUpdateOne) RemoveForums(f ...*Forum) *GroupUpdateOne

RemoveForums removes "forums" edges to Forum entities.

func (*GroupUpdateOne) RemoveInviteIDs

func (guo *GroupUpdateOne) RemoveInviteIDs(ids ...int) *GroupUpdateOne

RemoveInviteIDs removes the "invites" edge to GroupInviteLink entities by IDs.

func (*GroupUpdateOne) RemoveInvites

func (guo *GroupUpdateOne) RemoveInvites(g ...*GroupInviteLink) *GroupUpdateOne

RemoveInvites removes "invites" edges to GroupInviteLink entities.

func (*GroupUpdateOne) RemoveUserIDs

func (guo *GroupUpdateOne) RemoveUserIDs(ids ...int) *GroupUpdateOne

RemoveUserIDs removes the "users" edge to User entities by IDs.

func (*GroupUpdateOne) RemoveUsers

func (guo *GroupUpdateOne) RemoveUsers(u ...*User) *GroupUpdateOne

RemoveUsers removes "users" edges to User entities.

func (*GroupUpdateOne) Save

func (guo *GroupUpdateOne) Save(ctx context.Context) (*Group, error)

Save executes the query and returns the updated Group entity.

func (*GroupUpdateOne) SaveX

func (guo *GroupUpdateOne) SaveX(ctx context.Context) *Group

SaveX is like Save, but panics if an error occurs.

func (*GroupUpdateOne) Select

func (guo *GroupUpdateOne) Select(field string, fields ...string) *GroupUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*GroupUpdateOne) SetDescription

func (guo *GroupUpdateOne) SetDescription(s string) *GroupUpdateOne

SetDescription sets the "description" field.

func (*GroupUpdateOne) SetInstitution

func (guo *GroupUpdateOne) SetInstitution(i *Institution) *GroupUpdateOne

SetInstitution sets the "institution" edge to the Institution entity.

func (*GroupUpdateOne) SetInstitutionID

func (guo *GroupUpdateOne) SetInstitutionID(id int) *GroupUpdateOne

SetInstitutionID sets the "institution" edge to the Institution entity by ID.

func (*GroupUpdateOne) SetName

func (guo *GroupUpdateOne) SetName(s string) *GroupUpdateOne

SetName sets the "name" field.

func (*GroupUpdateOne) SetShortName

func (guo *GroupUpdateOne) SetShortName(s string) *GroupUpdateOne

SetShortName sets the "short_name" field.

func (*GroupUpdateOne) Where

func (guo *GroupUpdateOne) Where(ps ...predicate.Group) *GroupUpdateOne

Where appends a list predicates to the GroupUpdate builder.

type GroupUpsert

type GroupUpsert struct {
	*sql.UpdateSet
}

GroupUpsert is the "OnConflict" setter.

func (*GroupUpsert) SetDescription

func (u *GroupUpsert) SetDescription(v string) *GroupUpsert

SetDescription sets the "description" field.

func (*GroupUpsert) SetName

func (u *GroupUpsert) SetName(v string) *GroupUpsert

SetName sets the "name" field.

func (*GroupUpsert) SetShortName

func (u *GroupUpsert) SetShortName(v string) *GroupUpsert

SetShortName sets the "short_name" field.

func (*GroupUpsert) UpdateDescription

func (u *GroupUpsert) UpdateDescription() *GroupUpsert

UpdateDescription sets the "description" field to the value that was provided on create.

func (*GroupUpsert) UpdateName

func (u *GroupUpsert) UpdateName() *GroupUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*GroupUpsert) UpdateShortName

func (u *GroupUpsert) UpdateShortName() *GroupUpsert

UpdateShortName sets the "short_name" field to the value that was provided on create.

type GroupUpsertBulk

type GroupUpsertBulk struct {
	// contains filtered or unexported fields
}

GroupUpsertBulk is the builder for "upsert"-ing a bulk of Group nodes.

func (*GroupUpsertBulk) DoNothing

func (u *GroupUpsertBulk) DoNothing() *GroupUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*GroupUpsertBulk) Exec

func (u *GroupUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupUpsertBulk) ExecX

func (u *GroupUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupUpsertBulk) Ignore

func (u *GroupUpsertBulk) Ignore() *GroupUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Group.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*GroupUpsertBulk) SetDescription

func (u *GroupUpsertBulk) SetDescription(v string) *GroupUpsertBulk

SetDescription sets the "description" field.

func (*GroupUpsertBulk) SetName

func (u *GroupUpsertBulk) SetName(v string) *GroupUpsertBulk

SetName sets the "name" field.

func (*GroupUpsertBulk) SetShortName

func (u *GroupUpsertBulk) SetShortName(v string) *GroupUpsertBulk

SetShortName sets the "short_name" field.

func (*GroupUpsertBulk) Update

func (u *GroupUpsertBulk) Update(set func(*GroupUpsert)) *GroupUpsertBulk

Update allows overriding fields `UPDATE` values. See the GroupCreateBulk.OnConflict documentation for more info.

func (*GroupUpsertBulk) UpdateDescription

func (u *GroupUpsertBulk) UpdateDescription() *GroupUpsertBulk

UpdateDescription sets the "description" field to the value that was provided on create.

func (*GroupUpsertBulk) UpdateName

func (u *GroupUpsertBulk) UpdateName() *GroupUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*GroupUpsertBulk) UpdateNewValues

func (u *GroupUpsertBulk) UpdateNewValues() *GroupUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Group.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*GroupUpsertBulk) UpdateShortName

func (u *GroupUpsertBulk) UpdateShortName() *GroupUpsertBulk

UpdateShortName sets the "short_name" field to the value that was provided on create.

type GroupUpsertOne

type GroupUpsertOne struct {
	// contains filtered or unexported fields
}

GroupUpsertOne is the builder for "upsert"-ing

one Group node.

func (*GroupUpsertOne) DoNothing

func (u *GroupUpsertOne) DoNothing() *GroupUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*GroupUpsertOne) Exec

func (u *GroupUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupUpsertOne) ExecX

func (u *GroupUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupUpsertOne) ID

func (u *GroupUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*GroupUpsertOne) IDX

func (u *GroupUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*GroupUpsertOne) Ignore

func (u *GroupUpsertOne) Ignore() *GroupUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Group.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*GroupUpsertOne) SetDescription

func (u *GroupUpsertOne) SetDescription(v string) *GroupUpsertOne

SetDescription sets the "description" field.

func (*GroupUpsertOne) SetName

func (u *GroupUpsertOne) SetName(v string) *GroupUpsertOne

SetName sets the "name" field.

func (*GroupUpsertOne) SetShortName

func (u *GroupUpsertOne) SetShortName(v string) *GroupUpsertOne

SetShortName sets the "short_name" field.

func (*GroupUpsertOne) Update

func (u *GroupUpsertOne) Update(set func(*GroupUpsert)) *GroupUpsertOne

Update allows overriding fields `UPDATE` values. See the GroupCreate.OnConflict documentation for more info.

func (*GroupUpsertOne) UpdateDescription

func (u *GroupUpsertOne) UpdateDescription() *GroupUpsertOne

UpdateDescription sets the "description" field to the value that was provided on create.

func (*GroupUpsertOne) UpdateName

func (u *GroupUpsertOne) UpdateName() *GroupUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*GroupUpsertOne) UpdateNewValues

func (u *GroupUpsertOne) UpdateNewValues() *GroupUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Group.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*GroupUpsertOne) UpdateShortName

func (u *GroupUpsertOne) UpdateShortName() *GroupUpsertOne

UpdateShortName sets the "short_name" field to the value that was provided on create.

type GroupUser

type GroupUser struct {

	// ID of the group
	GroupID int `json:"group_id,omitempty"`
	// ID of the user
	UserID int `json:"user_id,omitempty"`
	// Role of the user
	Role group.Role `json:"role,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the GroupUserQuery when eager-loading is set.
	Edges GroupUserEdges `json:"edges"`
	// contains filtered or unexported fields
}

GroupUser is the model entity for the GroupUser schema.

func (*GroupUser) QueryGroup

func (gu *GroupUser) QueryGroup() *GroupQuery

QueryGroup queries the "group" edge of the GroupUser entity.

func (*GroupUser) QueryUser

func (gu *GroupUser) QueryUser() *UserQuery

QueryUser queries the "user" edge of the GroupUser entity.

func (*GroupUser) String

func (gu *GroupUser) String() string

String implements the fmt.Stringer.

func (*GroupUser) Unwrap

func (gu *GroupUser) Unwrap() *GroupUser

Unwrap unwraps the GroupUser 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 (*GroupUser) Update

func (gu *GroupUser) Update() *GroupUserUpdateOne

Update returns a builder for updating this GroupUser. Note that you need to call GroupUser.Unwrap() before calling this method if this GroupUser was returned from a transaction, and the transaction was committed or rolled back.

func (*GroupUser) Value

func (gu *GroupUser) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the GroupUser. This includes values selected through modifiers, order, etc.

type GroupUserClient

type GroupUserClient struct {
	// contains filtered or unexported fields
}

GroupUserClient is a client for the GroupUser schema.

func NewGroupUserClient

func NewGroupUserClient(c config) *GroupUserClient

NewGroupUserClient returns a client for the GroupUser from the given config.

func (*GroupUserClient) Create

func (c *GroupUserClient) Create() *GroupUserCreate

Create returns a builder for creating a GroupUser entity.

func (*GroupUserClient) CreateBulk

func (c *GroupUserClient) CreateBulk(builders ...*GroupUserCreate) *GroupUserCreateBulk

CreateBulk returns a builder for creating a bulk of GroupUser entities.

func (*GroupUserClient) Delete

func (c *GroupUserClient) Delete() *GroupUserDelete

Delete returns a delete builder for GroupUser.

func (*GroupUserClient) Hooks

func (c *GroupUserClient) Hooks() []Hook

Hooks returns the client hooks.

func (*GroupUserClient) Intercept

func (c *GroupUserClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `groupuser.Intercept(f(g(h())))`.

func (*GroupUserClient) Interceptors

func (c *GroupUserClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*GroupUserClient) Query

func (c *GroupUserClient) Query() *GroupUserQuery

Query returns a query builder for GroupUser.

func (*GroupUserClient) QueryGroup

func (c *GroupUserClient) QueryGroup(gu *GroupUser) *GroupQuery

QueryGroup queries the group edge of a GroupUser.

func (*GroupUserClient) QueryUser

func (c *GroupUserClient) QueryUser(gu *GroupUser) *UserQuery

QueryUser queries the user edge of a GroupUser.

func (*GroupUserClient) Update

func (c *GroupUserClient) Update() *GroupUserUpdate

Update returns an update builder for GroupUser.

func (*GroupUserClient) UpdateOne

func (c *GroupUserClient) UpdateOne(gu *GroupUser) *GroupUserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*GroupUserClient) Use

func (c *GroupUserClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `groupuser.Hooks(f(g(h())))`.

type GroupUserCreate

type GroupUserCreate struct {
	// contains filtered or unexported fields
}

GroupUserCreate is the builder for creating a GroupUser entity.

func (*GroupUserCreate) Exec

func (guc *GroupUserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupUserCreate) ExecX

func (guc *GroupUserCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupUserCreate) Mutation

func (guc *GroupUserCreate) Mutation() *GroupUserMutation

Mutation returns the GroupUserMutation object of the builder.

func (*GroupUserCreate) OnConflict

func (guc *GroupUserCreate) OnConflict(opts ...sql.ConflictOption) *GroupUserUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.GroupUser.Create().
	SetGroupID(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.GroupUserUpsert) {
		SetGroupID(v+v).
	}).
	Exec(ctx)

func (*GroupUserCreate) OnConflictColumns

func (guc *GroupUserCreate) OnConflictColumns(columns ...string) *GroupUserUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.GroupUser.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*GroupUserCreate) Save

func (guc *GroupUserCreate) Save(ctx context.Context) (*GroupUser, error)

Save creates the GroupUser in the database.

func (*GroupUserCreate) SaveX

func (guc *GroupUserCreate) SaveX(ctx context.Context) *GroupUser

SaveX calls Save and panics if Save returns an error.

func (*GroupUserCreate) SetGroup

func (guc *GroupUserCreate) SetGroup(g *Group) *GroupUserCreate

SetGroup sets the "group" edge to the Group entity.

func (*GroupUserCreate) SetGroupID

func (guc *GroupUserCreate) SetGroupID(i int) *GroupUserCreate

SetGroupID sets the "group_id" field.

func (*GroupUserCreate) SetRole

func (guc *GroupUserCreate) SetRole(gr group.Role) *GroupUserCreate

SetRole sets the "role" field.

func (*GroupUserCreate) SetUser

func (guc *GroupUserCreate) SetUser(u *User) *GroupUserCreate

SetUser sets the "user" edge to the User entity.

func (*GroupUserCreate) SetUserID

func (guc *GroupUserCreate) SetUserID(i int) *GroupUserCreate

SetUserID sets the "user_id" field.

type GroupUserCreateBulk

type GroupUserCreateBulk struct {
	// contains filtered or unexported fields
}

GroupUserCreateBulk is the builder for creating many GroupUser entities in bulk.

func (*GroupUserCreateBulk) Exec

func (gucb *GroupUserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupUserCreateBulk) ExecX

func (gucb *GroupUserCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupUserCreateBulk) OnConflict

func (gucb *GroupUserCreateBulk) OnConflict(opts ...sql.ConflictOption) *GroupUserUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.GroupUser.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.GroupUserUpsert) {
		SetGroupID(v+v).
	}).
	Exec(ctx)

func (*GroupUserCreateBulk) OnConflictColumns

func (gucb *GroupUserCreateBulk) OnConflictColumns(columns ...string) *GroupUserUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.GroupUser.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*GroupUserCreateBulk) Save

func (gucb *GroupUserCreateBulk) Save(ctx context.Context) ([]*GroupUser, error)

Save creates the GroupUser entities in the database.

func (*GroupUserCreateBulk) SaveX

func (gucb *GroupUserCreateBulk) SaveX(ctx context.Context) []*GroupUser

SaveX is like Save, but panics if an error occurs.

type GroupUserDelete

type GroupUserDelete struct {
	// contains filtered or unexported fields
}

GroupUserDelete is the builder for deleting a GroupUser entity.

func (*GroupUserDelete) Exec

func (gud *GroupUserDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*GroupUserDelete) ExecX

func (gud *GroupUserDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*GroupUserDelete) Where

Where appends a list predicates to the GroupUserDelete builder.

type GroupUserDeleteOne

type GroupUserDeleteOne struct {
	// contains filtered or unexported fields
}

GroupUserDeleteOne is the builder for deleting a single GroupUser entity.

func (*GroupUserDeleteOne) Exec

func (gudo *GroupUserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*GroupUserDeleteOne) ExecX

func (gudo *GroupUserDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupUserDeleteOne) Where

Where appends a list predicates to the GroupUserDelete builder.

type GroupUserEdges

type GroupUserEdges struct {
	// Group holds the value of the group edge.
	Group *Group `json:"group,omitempty"`
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// contains filtered or unexported fields
}

GroupUserEdges holds the relations/edges for other nodes in the graph.

func (GroupUserEdges) GroupOrErr

func (e GroupUserEdges) GroupOrErr() (*Group, error)

GroupOrErr returns the Group value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (GroupUserEdges) UserOrErr

func (e GroupUserEdges) UserOrErr() (*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type GroupUserGroupBy

type GroupUserGroupBy struct {
	// contains filtered or unexported fields
}

GroupUserGroupBy is the group-by builder for GroupUser entities.

func (*GroupUserGroupBy) Aggregate

func (gugb *GroupUserGroupBy) Aggregate(fns ...AggregateFunc) *GroupUserGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*GroupUserGroupBy) Bool

func (s *GroupUserGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*GroupUserGroupBy) BoolX

func (s *GroupUserGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*GroupUserGroupBy) Bools

func (s *GroupUserGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*GroupUserGroupBy) BoolsX

func (s *GroupUserGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*GroupUserGroupBy) Float64

func (s *GroupUserGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*GroupUserGroupBy) Float64X

func (s *GroupUserGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*GroupUserGroupBy) Float64s

func (s *GroupUserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*GroupUserGroupBy) Float64sX

func (s *GroupUserGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*GroupUserGroupBy) Int

func (s *GroupUserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*GroupUserGroupBy) IntX

func (s *GroupUserGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*GroupUserGroupBy) Ints

func (s *GroupUserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*GroupUserGroupBy) IntsX

func (s *GroupUserGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*GroupUserGroupBy) Scan

func (gugb *GroupUserGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*GroupUserGroupBy) ScanX

func (s *GroupUserGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*GroupUserGroupBy) String

func (s *GroupUserGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*GroupUserGroupBy) StringX

func (s *GroupUserGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*GroupUserGroupBy) Strings

func (s *GroupUserGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GroupUserGroupBy) StringsX

func (s *GroupUserGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GroupUserMutation

type GroupUserMutation struct {
	// contains filtered or unexported fields
}

GroupUserMutation represents an operation that mutates the GroupUser nodes in the graph.

func (*GroupUserMutation) AddField

func (m *GroupUserMutation) 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 (*GroupUserMutation) AddedEdges

func (m *GroupUserMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*GroupUserMutation) AddedField

func (m *GroupUserMutation) 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 (*GroupUserMutation) AddedFields

func (m *GroupUserMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*GroupUserMutation) AddedIDs

func (m *GroupUserMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*GroupUserMutation) ClearEdge

func (m *GroupUserMutation) 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 (*GroupUserMutation) ClearField

func (m *GroupUserMutation) 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 (*GroupUserMutation) ClearGroup

func (m *GroupUserMutation) ClearGroup()

ClearGroup clears the "group" edge to the Group entity.

func (*GroupUserMutation) ClearUser

func (m *GroupUserMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*GroupUserMutation) ClearedEdges

func (m *GroupUserMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*GroupUserMutation) ClearedFields

func (m *GroupUserMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (GroupUserMutation) Client

func (m GroupUserMutation) 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 (*GroupUserMutation) EdgeCleared

func (m *GroupUserMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*GroupUserMutation) Field

func (m *GroupUserMutation) 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 (*GroupUserMutation) FieldCleared

func (m *GroupUserMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*GroupUserMutation) Fields

func (m *GroupUserMutation) 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 (*GroupUserMutation) GroupCleared

func (m *GroupUserMutation) GroupCleared() bool

GroupCleared reports if the "group" edge to the Group entity was cleared.

func (*GroupUserMutation) GroupID

func (m *GroupUserMutation) GroupID() (r int, exists bool)

GroupID returns the value of the "group_id" field in the mutation.

func (*GroupUserMutation) GroupIDs

func (m *GroupUserMutation) GroupIDs() (ids []int)

GroupIDs returns the "group" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use GroupID instead. It exists only for internal usage by the builders.

func (*GroupUserMutation) OldField

func (m *GroupUserMutation) 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 (*GroupUserMutation) Op

func (m *GroupUserMutation) Op() Op

Op returns the operation name.

func (*GroupUserMutation) RemovedEdges

func (m *GroupUserMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*GroupUserMutation) RemovedIDs

func (m *GroupUserMutation) 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 (*GroupUserMutation) ResetEdge

func (m *GroupUserMutation) 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 (*GroupUserMutation) ResetField

func (m *GroupUserMutation) 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 (*GroupUserMutation) ResetGroup

func (m *GroupUserMutation) ResetGroup()

ResetGroup resets all changes to the "group" edge.

func (*GroupUserMutation) ResetGroupID

func (m *GroupUserMutation) ResetGroupID()

ResetGroupID resets all changes to the "group_id" field.

func (*GroupUserMutation) ResetRole

func (m *GroupUserMutation) ResetRole()

ResetRole resets all changes to the "role" field.

func (*GroupUserMutation) ResetUser

func (m *GroupUserMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*GroupUserMutation) ResetUserID

func (m *GroupUserMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*GroupUserMutation) Role

func (m *GroupUserMutation) Role() (r group.Role, exists bool)

Role returns the value of the "role" field in the mutation.

func (*GroupUserMutation) SetField

func (m *GroupUserMutation) 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 (*GroupUserMutation) SetGroupID

func (m *GroupUserMutation) SetGroupID(i int)

SetGroupID sets the "group_id" field.

func (*GroupUserMutation) SetOp

func (m *GroupUserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*GroupUserMutation) SetRole

func (m *GroupUserMutation) SetRole(gr group.Role)

SetRole sets the "role" field.

func (*GroupUserMutation) SetUserID

func (m *GroupUserMutation) SetUserID(i int)

SetUserID sets the "user_id" field.

func (GroupUserMutation) Tx

func (m GroupUserMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*GroupUserMutation) Type

func (m *GroupUserMutation) Type() string

Type returns the node type of this mutation (GroupUser).

func (*GroupUserMutation) UserCleared

func (m *GroupUserMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*GroupUserMutation) UserID

func (m *GroupUserMutation) UserID() (r int, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*GroupUserMutation) UserIDs

func (m *GroupUserMutation) UserIDs() (ids []int)

UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

func (*GroupUserMutation) Where

func (m *GroupUserMutation) Where(ps ...predicate.GroupUser)

Where appends a list predicates to the GroupUserMutation builder.

func (*GroupUserMutation) WhereP

func (m *GroupUserMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the GroupUserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type GroupUserQuery

type GroupUserQuery struct {
	// contains filtered or unexported fields
}

GroupUserQuery is the builder for querying GroupUser entities.

func (*GroupUserQuery) Aggregate

func (guq *GroupUserQuery) Aggregate(fns ...AggregateFunc) *GroupUserSelect

Aggregate returns a GroupUserSelect configured with the given aggregations.

func (*GroupUserQuery) All

func (guq *GroupUserQuery) All(ctx context.Context) ([]*GroupUser, error)

All executes the query and returns a list of GroupUsers.

func (*GroupUserQuery) AllX

func (guq *GroupUserQuery) AllX(ctx context.Context) []*GroupUser

AllX is like All, but panics if an error occurs.

func (*GroupUserQuery) Clone

func (guq *GroupUserQuery) Clone() *GroupUserQuery

Clone returns a duplicate of the GroupUserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*GroupUserQuery) Count

func (guq *GroupUserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GroupUserQuery) CountX

func (guq *GroupUserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*GroupUserQuery) Exist

func (guq *GroupUserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*GroupUserQuery) ExistX

func (guq *GroupUserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*GroupUserQuery) First

func (guq *GroupUserQuery) First(ctx context.Context) (*GroupUser, error)

First returns the first GroupUser entity from the query. Returns a *NotFoundError when no GroupUser was found.

func (*GroupUserQuery) FirstX

func (guq *GroupUserQuery) FirstX(ctx context.Context) *GroupUser

FirstX is like First, but panics if an error occurs.

func (*GroupUserQuery) GroupBy

func (guq *GroupUserQuery) GroupBy(field string, fields ...string) *GroupUserGroupBy

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 {
	GroupID int `json:"group_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.GroupUser.Query().
	GroupBy(groupuser.FieldGroupID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*GroupUserQuery) Limit

func (guq *GroupUserQuery) Limit(limit int) *GroupUserQuery

Limit the number of records to be returned by this query.

func (*GroupUserQuery) Offset

func (guq *GroupUserQuery) Offset(offset int) *GroupUserQuery

Offset to start from.

func (*GroupUserQuery) Only

func (guq *GroupUserQuery) Only(ctx context.Context) (*GroupUser, error)

Only returns a single GroupUser entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one GroupUser entity is found. Returns a *NotFoundError when no GroupUser entities are found.

func (*GroupUserQuery) OnlyX

func (guq *GroupUserQuery) OnlyX(ctx context.Context) *GroupUser

OnlyX is like Only, but panics if an error occurs.

func (*GroupUserQuery) Order

Order specifies how the records should be ordered.

func (*GroupUserQuery) QueryGroup

func (guq *GroupUserQuery) QueryGroup() *GroupQuery

QueryGroup chains the current query on the "group" edge.

func (*GroupUserQuery) QueryUser

func (guq *GroupUserQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*GroupUserQuery) Select

func (guq *GroupUserQuery) Select(fields ...string) *GroupUserSelect

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 {
	GroupID int `json:"group_id,omitempty"`
}

client.GroupUser.Query().
	Select(groupuser.FieldGroupID).
	Scan(ctx, &v)

func (*GroupUserQuery) Unique

func (guq *GroupUserQuery) Unique(unique bool) *GroupUserQuery

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 (*GroupUserQuery) Where

func (guq *GroupUserQuery) Where(ps ...predicate.GroupUser) *GroupUserQuery

Where adds a new predicate for the GroupUserQuery builder.

func (*GroupUserQuery) WithGroup

func (guq *GroupUserQuery) WithGroup(opts ...func(*GroupQuery)) *GroupUserQuery

WithGroup tells the query-builder to eager-load the nodes that are connected to the "group" edge. The optional arguments are used to configure the query builder of the edge.

func (*GroupUserQuery) WithUser

func (guq *GroupUserQuery) WithUser(opts ...func(*UserQuery)) *GroupUserQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type GroupUserSelect

type GroupUserSelect struct {
	*GroupUserQuery
	// contains filtered or unexported fields
}

GroupUserSelect is the builder for selecting fields of GroupUser entities.

func (*GroupUserSelect) Aggregate

func (gus *GroupUserSelect) Aggregate(fns ...AggregateFunc) *GroupUserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*GroupUserSelect) Bool

func (s *GroupUserSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*GroupUserSelect) BoolX

func (s *GroupUserSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*GroupUserSelect) Bools

func (s *GroupUserSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*GroupUserSelect) BoolsX

func (s *GroupUserSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*GroupUserSelect) Float64

func (s *GroupUserSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*GroupUserSelect) Float64X

func (s *GroupUserSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*GroupUserSelect) Float64s

func (s *GroupUserSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*GroupUserSelect) Float64sX

func (s *GroupUserSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*GroupUserSelect) Int

func (s *GroupUserSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*GroupUserSelect) IntX

func (s *GroupUserSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*GroupUserSelect) Ints

func (s *GroupUserSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*GroupUserSelect) IntsX

func (s *GroupUserSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*GroupUserSelect) Scan

func (gus *GroupUserSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*GroupUserSelect) ScanX

func (s *GroupUserSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*GroupUserSelect) String

func (s *GroupUserSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*GroupUserSelect) StringX

func (s *GroupUserSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*GroupUserSelect) Strings

func (s *GroupUserSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GroupUserSelect) StringsX

func (s *GroupUserSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GroupUserUpdate

type GroupUserUpdate struct {
	// contains filtered or unexported fields
}

GroupUserUpdate is the builder for updating GroupUser entities.

func (*GroupUserUpdate) ClearGroup

func (guu *GroupUserUpdate) ClearGroup() *GroupUserUpdate

ClearGroup clears the "group" edge to the Group entity.

func (*GroupUserUpdate) ClearUser

func (guu *GroupUserUpdate) ClearUser() *GroupUserUpdate

ClearUser clears the "user" edge to the User entity.

func (*GroupUserUpdate) Exec

func (guu *GroupUserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupUserUpdate) ExecX

func (guu *GroupUserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupUserUpdate) Mutation

func (guu *GroupUserUpdate) Mutation() *GroupUserMutation

Mutation returns the GroupUserMutation object of the builder.

func (*GroupUserUpdate) Save

func (guu *GroupUserUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*GroupUserUpdate) SaveX

func (guu *GroupUserUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*GroupUserUpdate) SetGroup

func (guu *GroupUserUpdate) SetGroup(g *Group) *GroupUserUpdate

SetGroup sets the "group" edge to the Group entity.

func (*GroupUserUpdate) SetGroupID

func (guu *GroupUserUpdate) SetGroupID(i int) *GroupUserUpdate

SetGroupID sets the "group_id" field.

func (*GroupUserUpdate) SetRole

func (guu *GroupUserUpdate) SetRole(gr group.Role) *GroupUserUpdate

SetRole sets the "role" field.

func (*GroupUserUpdate) SetUser

func (guu *GroupUserUpdate) SetUser(u *User) *GroupUserUpdate

SetUser sets the "user" edge to the User entity.

func (*GroupUserUpdate) SetUserID

func (guu *GroupUserUpdate) SetUserID(i int) *GroupUserUpdate

SetUserID sets the "user_id" field.

func (*GroupUserUpdate) Where

Where appends a list predicates to the GroupUserUpdate builder.

type GroupUserUpdateOne

type GroupUserUpdateOne struct {
	// contains filtered or unexported fields
}

GroupUserUpdateOne is the builder for updating a single GroupUser entity.

func (*GroupUserUpdateOne) ClearGroup

func (guuo *GroupUserUpdateOne) ClearGroup() *GroupUserUpdateOne

ClearGroup clears the "group" edge to the Group entity.

func (*GroupUserUpdateOne) ClearUser

func (guuo *GroupUserUpdateOne) ClearUser() *GroupUserUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*GroupUserUpdateOne) Exec

func (guuo *GroupUserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GroupUserUpdateOne) ExecX

func (guuo *GroupUserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupUserUpdateOne) Mutation

func (guuo *GroupUserUpdateOne) Mutation() *GroupUserMutation

Mutation returns the GroupUserMutation object of the builder.

func (*GroupUserUpdateOne) Save

func (guuo *GroupUserUpdateOne) Save(ctx context.Context) (*GroupUser, error)

Save executes the query and returns the updated GroupUser entity.

func (*GroupUserUpdateOne) SaveX

func (guuo *GroupUserUpdateOne) SaveX(ctx context.Context) *GroupUser

SaveX is like Save, but panics if an error occurs.

func (*GroupUserUpdateOne) Select

func (guuo *GroupUserUpdateOne) Select(field string, fields ...string) *GroupUserUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*GroupUserUpdateOne) SetGroup

func (guuo *GroupUserUpdateOne) SetGroup(g *Group) *GroupUserUpdateOne

SetGroup sets the "group" edge to the Group entity.

func (*GroupUserUpdateOne) SetGroupID

func (guuo *GroupUserUpdateOne) SetGroupID(i int) *GroupUserUpdateOne

SetGroupID sets the "group_id" field.

func (*GroupUserUpdateOne) SetRole

func (guuo *GroupUserUpdateOne) SetRole(gr group.Role) *GroupUserUpdateOne

SetRole sets the "role" field.

func (*GroupUserUpdateOne) SetUser

func (guuo *GroupUserUpdateOne) SetUser(u *User) *GroupUserUpdateOne

SetUser sets the "user" edge to the User entity.

func (*GroupUserUpdateOne) SetUserID

func (guuo *GroupUserUpdateOne) SetUserID(i int) *GroupUserUpdateOne

SetUserID sets the "user_id" field.

func (*GroupUserUpdateOne) Where

Where appends a list predicates to the GroupUserUpdate builder.

type GroupUserUpsert

type GroupUserUpsert struct {
	*sql.UpdateSet
}

GroupUserUpsert is the "OnConflict" setter.

func (*GroupUserUpsert) SetGroupID

func (u *GroupUserUpsert) SetGroupID(v int) *GroupUserUpsert

SetGroupID sets the "group_id" field.

func (*GroupUserUpsert) SetRole

func (u *GroupUserUpsert) SetRole(v group.Role) *GroupUserUpsert

SetRole sets the "role" field.

func (*GroupUserUpsert) SetUserID

func (u *GroupUserUpsert) SetUserID(v int) *GroupUserUpsert

SetUserID sets the "user_id" field.

func (*GroupUserUpsert) UpdateGroupID

func (u *GroupUserUpsert) UpdateGroupID() *GroupUserUpsert

UpdateGroupID sets the "group_id" field to the value that was provided on create.

func (*GroupUserUpsert) UpdateRole

func (u *GroupUserUpsert) UpdateRole() *GroupUserUpsert

UpdateRole sets the "role" field to the value that was provided on create.

func (*GroupUserUpsert) UpdateUserID

func (u *GroupUserUpsert) UpdateUserID() *GroupUserUpsert

UpdateUserID sets the "user_id" field to the value that was provided on create.

type GroupUserUpsertBulk

type GroupUserUpsertBulk struct {
	// contains filtered or unexported fields
}

GroupUserUpsertBulk is the builder for "upsert"-ing a bulk of GroupUser nodes.

func (*GroupUserUpsertBulk) DoNothing

func (u *GroupUserUpsertBulk) DoNothing() *GroupUserUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*GroupUserUpsertBulk) Exec

Exec executes the query.

func (*GroupUserUpsertBulk) ExecX

func (u *GroupUserUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupUserUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.GroupUser.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*GroupUserUpsertBulk) SetGroupID

func (u *GroupUserUpsertBulk) SetGroupID(v int) *GroupUserUpsertBulk

SetGroupID sets the "group_id" field.

func (*GroupUserUpsertBulk) SetRole

SetRole sets the "role" field.

func (*GroupUserUpsertBulk) SetUserID

func (u *GroupUserUpsertBulk) SetUserID(v int) *GroupUserUpsertBulk

SetUserID sets the "user_id" field.

func (*GroupUserUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the GroupUserCreateBulk.OnConflict documentation for more info.

func (*GroupUserUpsertBulk) UpdateGroupID

func (u *GroupUserUpsertBulk) UpdateGroupID() *GroupUserUpsertBulk

UpdateGroupID sets the "group_id" field to the value that was provided on create.

func (*GroupUserUpsertBulk) UpdateNewValues

func (u *GroupUserUpsertBulk) UpdateNewValues() *GroupUserUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.GroupUser.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*GroupUserUpsertBulk) UpdateRole

func (u *GroupUserUpsertBulk) UpdateRole() *GroupUserUpsertBulk

UpdateRole sets the "role" field to the value that was provided on create.

func (*GroupUserUpsertBulk) UpdateUserID

func (u *GroupUserUpsertBulk) UpdateUserID() *GroupUserUpsertBulk

UpdateUserID sets the "user_id" field to the value that was provided on create.

type GroupUserUpsertOne

type GroupUserUpsertOne struct {
	// contains filtered or unexported fields
}

GroupUserUpsertOne is the builder for "upsert"-ing

one GroupUser node.

func (*GroupUserUpsertOne) DoNothing

func (u *GroupUserUpsertOne) DoNothing() *GroupUserUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*GroupUserUpsertOne) Exec

func (u *GroupUserUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupUserUpsertOne) ExecX

func (u *GroupUserUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupUserUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.GroupUser.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*GroupUserUpsertOne) SetGroupID

func (u *GroupUserUpsertOne) SetGroupID(v int) *GroupUserUpsertOne

SetGroupID sets the "group_id" field.

func (*GroupUserUpsertOne) SetRole

SetRole sets the "role" field.

func (*GroupUserUpsertOne) SetUserID

func (u *GroupUserUpsertOne) SetUserID(v int) *GroupUserUpsertOne

SetUserID sets the "user_id" field.

func (*GroupUserUpsertOne) Update

func (u *GroupUserUpsertOne) Update(set func(*GroupUserUpsert)) *GroupUserUpsertOne

Update allows overriding fields `UPDATE` values. See the GroupUserCreate.OnConflict documentation for more info.

func (*GroupUserUpsertOne) UpdateGroupID

func (u *GroupUserUpsertOne) UpdateGroupID() *GroupUserUpsertOne

UpdateGroupID sets the "group_id" field to the value that was provided on create.

func (*GroupUserUpsertOne) UpdateNewValues

func (u *GroupUserUpsertOne) UpdateNewValues() *GroupUserUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.GroupUser.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*GroupUserUpsertOne) UpdateRole

func (u *GroupUserUpsertOne) UpdateRole() *GroupUserUpsertOne

UpdateRole sets the "role" field to the value that was provided on create.

func (*GroupUserUpsertOne) UpdateUserID

func (u *GroupUserUpsertOne) UpdateUserID() *GroupUserUpsertOne

UpdateUserID sets the "user_id" field to the value that was provided on create.

type GroupUsers

type GroupUsers []*GroupUser

GroupUsers is a parsable slice of GroupUser.

type Groups

type Groups []*Group

Groups is a parsable slice of Group.

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

type Institution

type Institution struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name of the institution
	Name string `json:"name,omitempty"`
	// Short name of the institution (example: np)
	ShortName string `json:"short_name,omitempty"`
	// Description of the institution
	Description string `json:"Description,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the InstitutionQuery when eager-loading is set.
	Edges InstitutionEdges `json:"edges"`
	// contains filtered or unexported fields
}

Institution is the model entity for the Institution schema.

func (*Institution) QueryAccessories

func (i *Institution) QueryAccessories() *AccessoryQuery

QueryAccessories queries the "accessories" edge of the Institution entity.

func (*Institution) QueryGroups

func (i *Institution) QueryGroups() *GroupQuery

QueryGroups queries the "groups" edge of the Institution entity.

func (*Institution) QueryInvites

func (i *Institution) QueryInvites() *InstitutionInviteLinkQuery

QueryInvites queries the "invites" edge of the Institution entity.

func (*Institution) QueryUsers

func (i *Institution) QueryUsers() *UserQuery

QueryUsers queries the "users" edge of the Institution entity.

func (*Institution) QueryVouchers

func (i *Institution) QueryVouchers() *VoucherQuery

QueryVouchers queries the "vouchers" edge of the Institution entity.

func (*Institution) String

func (i *Institution) String() string

String implements the fmt.Stringer.

func (*Institution) Unwrap

func (i *Institution) Unwrap() *Institution

Unwrap unwraps the Institution 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 (*Institution) Update

func (i *Institution) Update() *InstitutionUpdateOne

Update returns a builder for updating this Institution. Note that you need to call Institution.Unwrap() before calling this method if this Institution was returned from a transaction, and the transaction was committed or rolled back.

func (*Institution) Value

func (i *Institution) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Institution. This includes values selected through modifiers, order, etc.

type InstitutionClient

type InstitutionClient struct {
	// contains filtered or unexported fields
}

InstitutionClient is a client for the Institution schema.

func NewInstitutionClient

func NewInstitutionClient(c config) *InstitutionClient

NewInstitutionClient returns a client for the Institution from the given config.

func (*InstitutionClient) Create

func (c *InstitutionClient) Create() *InstitutionCreate

Create returns a builder for creating a Institution entity.

func (*InstitutionClient) CreateBulk

func (c *InstitutionClient) CreateBulk(builders ...*InstitutionCreate) *InstitutionCreateBulk

CreateBulk returns a builder for creating a bulk of Institution entities.

func (*InstitutionClient) Delete

func (c *InstitutionClient) Delete() *InstitutionDelete

Delete returns a delete builder for Institution.

func (*InstitutionClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*InstitutionClient) DeleteOneID

func (c *InstitutionClient) DeleteOneID(id int) *InstitutionDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*InstitutionClient) Get

func (c *InstitutionClient) Get(ctx context.Context, id int) (*Institution, error)

Get returns a Institution entity by its id.

func (*InstitutionClient) GetX

func (c *InstitutionClient) GetX(ctx context.Context, id int) *Institution

GetX is like Get, but panics if an error occurs.

func (*InstitutionClient) Hooks

func (c *InstitutionClient) Hooks() []Hook

Hooks returns the client hooks.

func (*InstitutionClient) Intercept

func (c *InstitutionClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `entinstitution.Intercept(f(g(h())))`.

func (*InstitutionClient) Interceptors

func (c *InstitutionClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*InstitutionClient) Query

func (c *InstitutionClient) Query() *InstitutionQuery

Query returns a query builder for Institution.

func (*InstitutionClient) QueryAccessories

func (c *InstitutionClient) QueryAccessories(i *Institution) *AccessoryQuery

QueryAccessories queries the accessories edge of a Institution.

func (*InstitutionClient) QueryGroups

func (c *InstitutionClient) QueryGroups(i *Institution) *GroupQuery

QueryGroups queries the groups edge of a Institution.

func (*InstitutionClient) QueryInvites

QueryInvites queries the invites edge of a Institution.

func (*InstitutionClient) QueryUsers

func (c *InstitutionClient) QueryUsers(i *Institution) *UserQuery

QueryUsers queries the users edge of a Institution.

func (*InstitutionClient) QueryVouchers

func (c *InstitutionClient) QueryVouchers(i *Institution) *VoucherQuery

QueryVouchers queries the vouchers edge of a Institution.

func (*InstitutionClient) Update

func (c *InstitutionClient) Update() *InstitutionUpdate

Update returns an update builder for Institution.

func (*InstitutionClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*InstitutionClient) UpdateOneID

func (c *InstitutionClient) UpdateOneID(id int) *InstitutionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*InstitutionClient) Use

func (c *InstitutionClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `entinstitution.Hooks(f(g(h())))`.

type InstitutionCreate

type InstitutionCreate struct {
	// contains filtered or unexported fields
}

InstitutionCreate is the builder for creating a Institution entity.

func (*InstitutionCreate) AddAccessories

func (ic *InstitutionCreate) AddAccessories(a ...*Accessory) *InstitutionCreate

AddAccessories adds the "accessories" edges to the Accessory entity.

func (*InstitutionCreate) AddAccessoryIDs

func (ic *InstitutionCreate) AddAccessoryIDs(ids ...int) *InstitutionCreate

AddAccessoryIDs adds the "accessories" edge to the Accessory entity by IDs.

func (*InstitutionCreate) AddGroupIDs

func (ic *InstitutionCreate) AddGroupIDs(ids ...int) *InstitutionCreate

AddGroupIDs adds the "groups" edge to the Group entity by IDs.

func (*InstitutionCreate) AddGroups

func (ic *InstitutionCreate) AddGroups(g ...*Group) *InstitutionCreate

AddGroups adds the "groups" edges to the Group entity.

func (*InstitutionCreate) AddInviteIDs

func (ic *InstitutionCreate) AddInviteIDs(ids ...int) *InstitutionCreate

AddInviteIDs adds the "invites" edge to the InstitutionInviteLink entity by IDs.

func (*InstitutionCreate) AddInvites

AddInvites adds the "invites" edges to the InstitutionInviteLink entity.

func (*InstitutionCreate) AddUserIDs

func (ic *InstitutionCreate) AddUserIDs(ids ...int) *InstitutionCreate

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*InstitutionCreate) AddUsers

func (ic *InstitutionCreate) AddUsers(u ...*User) *InstitutionCreate

AddUsers adds the "users" edges to the User entity.

func (*InstitutionCreate) AddVoucherIDs

func (ic *InstitutionCreate) AddVoucherIDs(ids ...int) *InstitutionCreate

AddVoucherIDs adds the "vouchers" edge to the Voucher entity by IDs.

func (*InstitutionCreate) AddVouchers

func (ic *InstitutionCreate) AddVouchers(v ...*Voucher) *InstitutionCreate

AddVouchers adds the "vouchers" edges to the Voucher entity.

func (*InstitutionCreate) Exec

func (ic *InstitutionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*InstitutionCreate) ExecX

func (ic *InstitutionCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*InstitutionCreate) Mutation

func (ic *InstitutionCreate) Mutation() *InstitutionMutation

Mutation returns the InstitutionMutation object of the builder.

func (*InstitutionCreate) OnConflict

func (ic *InstitutionCreate) OnConflict(opts ...sql.ConflictOption) *InstitutionUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Institution.Create().
	SetName(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.InstitutionUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*InstitutionCreate) OnConflictColumns

func (ic *InstitutionCreate) OnConflictColumns(columns ...string) *InstitutionUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Institution.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*InstitutionCreate) Save

Save creates the Institution in the database.

func (*InstitutionCreate) SaveX

func (ic *InstitutionCreate) SaveX(ctx context.Context) *Institution

SaveX calls Save and panics if Save returns an error.

func (*InstitutionCreate) SetDescription

func (ic *InstitutionCreate) SetDescription(s string) *InstitutionCreate

SetDescription sets the "Description" field.

func (*InstitutionCreate) SetName

func (ic *InstitutionCreate) SetName(s string) *InstitutionCreate

SetName sets the "name" field.

func (*InstitutionCreate) SetNillableDescription

func (ic *InstitutionCreate) SetNillableDescription(s *string) *InstitutionCreate

SetNillableDescription sets the "Description" field if the given value is not nil.

func (*InstitutionCreate) SetShortName

func (ic *InstitutionCreate) SetShortName(s string) *InstitutionCreate

SetShortName sets the "short_name" field.

type InstitutionCreateBulk

type InstitutionCreateBulk struct {
	// contains filtered or unexported fields
}

InstitutionCreateBulk is the builder for creating many Institution entities in bulk.

func (*InstitutionCreateBulk) Exec

func (icb *InstitutionCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*InstitutionCreateBulk) ExecX

func (icb *InstitutionCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*InstitutionCreateBulk) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Institution.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.InstitutionUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*InstitutionCreateBulk) OnConflictColumns

func (icb *InstitutionCreateBulk) OnConflictColumns(columns ...string) *InstitutionUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Institution.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*InstitutionCreateBulk) Save

func (icb *InstitutionCreateBulk) Save(ctx context.Context) ([]*Institution, error)

Save creates the Institution entities in the database.

func (*InstitutionCreateBulk) SaveX

func (icb *InstitutionCreateBulk) SaveX(ctx context.Context) []*Institution

SaveX is like Save, but panics if an error occurs.

type InstitutionDelete

type InstitutionDelete struct {
	// contains filtered or unexported fields
}

InstitutionDelete is the builder for deleting a Institution entity.

func (*InstitutionDelete) Exec

func (id *InstitutionDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*InstitutionDelete) ExecX

func (id *InstitutionDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*InstitutionDelete) Where

Where appends a list predicates to the InstitutionDelete builder.

type InstitutionDeleteOne

type InstitutionDeleteOne struct {
	// contains filtered or unexported fields
}

InstitutionDeleteOne is the builder for deleting a single Institution entity.

func (*InstitutionDeleteOne) Exec

func (ido *InstitutionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*InstitutionDeleteOne) ExecX

func (ido *InstitutionDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*InstitutionDeleteOne) Where

Where appends a list predicates to the InstitutionDelete builder.

type InstitutionEdges

type InstitutionEdges struct {
	// Prizes (vouchers) available to be redeemed by users of the institution
	Vouchers []*Voucher `json:"vouchers,omitempty"`
	// Prizes (accessories) available to be redeemed by users of the institution
	Accessories []*Accessory `json:"accessories,omitempty"`
	// Groups under the institution
	Groups []*Group `json:"groups,omitempty"`
	// Invite links for the institution
	Invites []*InstitutionInviteLink `json:"invites,omitempty"`
	// Users under the institution
	Users []*User `json:"users,omitempty"`
	// contains filtered or unexported fields
}

InstitutionEdges holds the relations/edges for other nodes in the graph.

func (InstitutionEdges) AccessoriesOrErr

func (e InstitutionEdges) AccessoriesOrErr() ([]*Accessory, error)

AccessoriesOrErr returns the Accessories value or an error if the edge was not loaded in eager-loading.

func (InstitutionEdges) GroupsOrErr

func (e InstitutionEdges) GroupsOrErr() ([]*Group, error)

GroupsOrErr returns the Groups value or an error if the edge was not loaded in eager-loading.

func (InstitutionEdges) InvitesOrErr

func (e InstitutionEdges) InvitesOrErr() ([]*InstitutionInviteLink, error)

InvitesOrErr returns the Invites value or an error if the edge was not loaded in eager-loading.

func (InstitutionEdges) UsersOrErr

func (e InstitutionEdges) UsersOrErr() ([]*User, error)

UsersOrErr returns the Users value or an error if the edge was not loaded in eager-loading.

func (InstitutionEdges) VouchersOrErr

func (e InstitutionEdges) VouchersOrErr() ([]*Voucher, error)

VouchersOrErr returns the Vouchers value or an error if the edge was not loaded in eager-loading.

type InstitutionGroupBy

type InstitutionGroupBy struct {
	// contains filtered or unexported fields
}

InstitutionGroupBy is the group-by builder for Institution entities.

func (*InstitutionGroupBy) Aggregate

func (igb *InstitutionGroupBy) Aggregate(fns ...AggregateFunc) *InstitutionGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*InstitutionGroupBy) Bool

func (s *InstitutionGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*InstitutionGroupBy) BoolX

func (s *InstitutionGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*InstitutionGroupBy) Bools

func (s *InstitutionGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*InstitutionGroupBy) BoolsX

func (s *InstitutionGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*InstitutionGroupBy) Float64

func (s *InstitutionGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*InstitutionGroupBy) Float64X

func (s *InstitutionGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*InstitutionGroupBy) Float64s

func (s *InstitutionGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*InstitutionGroupBy) Float64sX

func (s *InstitutionGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*InstitutionGroupBy) Int

func (s *InstitutionGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*InstitutionGroupBy) IntX

func (s *InstitutionGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*InstitutionGroupBy) Ints

func (s *InstitutionGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*InstitutionGroupBy) IntsX

func (s *InstitutionGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*InstitutionGroupBy) Scan

func (igb *InstitutionGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*InstitutionGroupBy) ScanX

func (s *InstitutionGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*InstitutionGroupBy) String

func (s *InstitutionGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*InstitutionGroupBy) StringX

func (s *InstitutionGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*InstitutionGroupBy) Strings

func (s *InstitutionGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*InstitutionGroupBy) StringsX

func (s *InstitutionGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type InstitutionInviteLink struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Code used in the invite link
	Code string `json:"code,omitempty"`
	// Role granted in the invite
	Role institution.Role `json:"role,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the InstitutionInviteLinkQuery when eager-loading is set.
	Edges InstitutionInviteLinkEdges `json:"edges"`
	// contains filtered or unexported fields
}

InstitutionInviteLink is the model entity for the InstitutionInviteLink schema.

func (*InstitutionInviteLink) QueryInstitution

func (iil *InstitutionInviteLink) QueryInstitution() *InstitutionQuery

QueryInstitution queries the "institution" edge of the InstitutionInviteLink entity.

func (*InstitutionInviteLink) String

func (iil *InstitutionInviteLink) String() string

String implements the fmt.Stringer.

func (*InstitutionInviteLink) Unwrap

Unwrap unwraps the InstitutionInviteLink 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 (*InstitutionInviteLink) Update

Update returns a builder for updating this InstitutionInviteLink. Note that you need to call InstitutionInviteLink.Unwrap() before calling this method if this InstitutionInviteLink was returned from a transaction, and the transaction was committed or rolled back.

func (*InstitutionInviteLink) Value

func (iil *InstitutionInviteLink) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the InstitutionInviteLink. This includes values selected through modifiers, order, etc.

type InstitutionInviteLinkClient

type InstitutionInviteLinkClient struct {
	// contains filtered or unexported fields
}

InstitutionInviteLinkClient is a client for the InstitutionInviteLink schema.

func NewInstitutionInviteLinkClient

func NewInstitutionInviteLinkClient(c config) *InstitutionInviteLinkClient

NewInstitutionInviteLinkClient returns a client for the InstitutionInviteLink from the given config.

func (*InstitutionInviteLinkClient) Create

Create returns a builder for creating a InstitutionInviteLink entity.

func (*InstitutionInviteLinkClient) CreateBulk

CreateBulk returns a builder for creating a bulk of InstitutionInviteLink entities.

func (*InstitutionInviteLinkClient) Delete

Delete returns a delete builder for InstitutionInviteLink.

func (*InstitutionInviteLinkClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*InstitutionInviteLinkClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*InstitutionInviteLinkClient) Get

Get returns a InstitutionInviteLink entity by its id.

func (*InstitutionInviteLinkClient) GetX

GetX is like Get, but panics if an error occurs.

func (*InstitutionInviteLinkClient) Hooks

func (c *InstitutionInviteLinkClient) Hooks() []Hook

Hooks returns the client hooks.

func (*InstitutionInviteLinkClient) Intercept

func (c *InstitutionInviteLinkClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `institutioninvitelink.Intercept(f(g(h())))`.

func (*InstitutionInviteLinkClient) Interceptors

func (c *InstitutionInviteLinkClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*InstitutionInviteLinkClient) Query

Query returns a query builder for InstitutionInviteLink.

func (*InstitutionInviteLinkClient) QueryInstitution

QueryInstitution queries the institution edge of a InstitutionInviteLink.

func (*InstitutionInviteLinkClient) Update

Update returns an update builder for InstitutionInviteLink.

func (*InstitutionInviteLinkClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*InstitutionInviteLinkClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*InstitutionInviteLinkClient) Use

func (c *InstitutionInviteLinkClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `institutioninvitelink.Hooks(f(g(h())))`.

type InstitutionInviteLinkCreate

type InstitutionInviteLinkCreate struct {
	// contains filtered or unexported fields
}

InstitutionInviteLinkCreate is the builder for creating a InstitutionInviteLink entity.

func (*InstitutionInviteLinkCreate) Exec

Exec executes the query.

func (*InstitutionInviteLinkCreate) ExecX

func (iilc *InstitutionInviteLinkCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*InstitutionInviteLinkCreate) Mutation

Mutation returns the InstitutionInviteLinkMutation object of the builder.

func (*InstitutionInviteLinkCreate) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.InstitutionInviteLink.Create().
	SetCode(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.InstitutionInviteLinkUpsert) {
		SetCode(v+v).
	}).
	Exec(ctx)

func (*InstitutionInviteLinkCreate) OnConflictColumns

func (iilc *InstitutionInviteLinkCreate) OnConflictColumns(columns ...string) *InstitutionInviteLinkUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.InstitutionInviteLink.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*InstitutionInviteLinkCreate) Save

Save creates the InstitutionInviteLink in the database.

func (*InstitutionInviteLinkCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*InstitutionInviteLinkCreate) SetCode

SetCode sets the "code" field.

func (*InstitutionInviteLinkCreate) SetInstitution

SetInstitution sets the "institution" edge to the Institution entity.

func (*InstitutionInviteLinkCreate) SetInstitutionID

func (iilc *InstitutionInviteLinkCreate) SetInstitutionID(id int) *InstitutionInviteLinkCreate

SetInstitutionID sets the "institution" edge to the Institution entity by ID.

func (*InstitutionInviteLinkCreate) SetRole

SetRole sets the "role" field.

type InstitutionInviteLinkCreateBulk

type InstitutionInviteLinkCreateBulk struct {
	// contains filtered or unexported fields
}

InstitutionInviteLinkCreateBulk is the builder for creating many InstitutionInviteLink entities in bulk.

func (*InstitutionInviteLinkCreateBulk) Exec

Exec executes the query.

func (*InstitutionInviteLinkCreateBulk) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*InstitutionInviteLinkCreateBulk) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.InstitutionInviteLink.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.InstitutionInviteLinkUpsert) {
		SetCode(v+v).
	}).
	Exec(ctx)

func (*InstitutionInviteLinkCreateBulk) OnConflictColumns

func (iilcb *InstitutionInviteLinkCreateBulk) OnConflictColumns(columns ...string) *InstitutionInviteLinkUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.InstitutionInviteLink.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*InstitutionInviteLinkCreateBulk) Save

Save creates the InstitutionInviteLink entities in the database.

func (*InstitutionInviteLinkCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type InstitutionInviteLinkDelete

type InstitutionInviteLinkDelete struct {
	// contains filtered or unexported fields
}

InstitutionInviteLinkDelete is the builder for deleting a InstitutionInviteLink entity.

func (*InstitutionInviteLinkDelete) Exec

Exec executes the deletion query and returns how many vertices were deleted.

func (*InstitutionInviteLinkDelete) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*InstitutionInviteLinkDelete) Where

Where appends a list predicates to the InstitutionInviteLinkDelete builder.

type InstitutionInviteLinkDeleteOne

type InstitutionInviteLinkDeleteOne struct {
	// contains filtered or unexported fields
}

InstitutionInviteLinkDeleteOne is the builder for deleting a single InstitutionInviteLink entity.

func (*InstitutionInviteLinkDeleteOne) Exec

Exec executes the deletion query.

func (*InstitutionInviteLinkDeleteOne) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*InstitutionInviteLinkDeleteOne) Where

Where appends a list predicates to the InstitutionInviteLinkDelete builder.

type InstitutionInviteLinkEdges

type InstitutionInviteLinkEdges struct {
	// Institution holds the value of the institution edge.
	Institution *Institution `json:"institution,omitempty"`
	// contains filtered or unexported fields
}

InstitutionInviteLinkEdges holds the relations/edges for other nodes in the graph.

func (InstitutionInviteLinkEdges) InstitutionOrErr

func (e InstitutionInviteLinkEdges) InstitutionOrErr() (*Institution, error)

InstitutionOrErr returns the Institution value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type InstitutionInviteLinkGroupBy

type InstitutionInviteLinkGroupBy struct {
	// contains filtered or unexported fields
}

InstitutionInviteLinkGroupBy is the group-by builder for InstitutionInviteLink entities.

func (*InstitutionInviteLinkGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*InstitutionInviteLinkGroupBy) Bool

func (s *InstitutionInviteLinkGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*InstitutionInviteLinkGroupBy) BoolX

func (s *InstitutionInviteLinkGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*InstitutionInviteLinkGroupBy) Bools

func (s *InstitutionInviteLinkGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*InstitutionInviteLinkGroupBy) BoolsX

func (s *InstitutionInviteLinkGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*InstitutionInviteLinkGroupBy) Float64

func (s *InstitutionInviteLinkGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*InstitutionInviteLinkGroupBy) Float64X

func (s *InstitutionInviteLinkGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*InstitutionInviteLinkGroupBy) Float64s

func (s *InstitutionInviteLinkGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*InstitutionInviteLinkGroupBy) Float64sX

func (s *InstitutionInviteLinkGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*InstitutionInviteLinkGroupBy) Int

func (s *InstitutionInviteLinkGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*InstitutionInviteLinkGroupBy) IntX

func (s *InstitutionInviteLinkGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*InstitutionInviteLinkGroupBy) Ints

func (s *InstitutionInviteLinkGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*InstitutionInviteLinkGroupBy) IntsX

func (s *InstitutionInviteLinkGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*InstitutionInviteLinkGroupBy) Scan

Scan applies the selector query and scans the result into the given value.

func (*InstitutionInviteLinkGroupBy) ScanX

func (s *InstitutionInviteLinkGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*InstitutionInviteLinkGroupBy) String

func (s *InstitutionInviteLinkGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*InstitutionInviteLinkGroupBy) StringX

func (s *InstitutionInviteLinkGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*InstitutionInviteLinkGroupBy) Strings

func (s *InstitutionInviteLinkGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*InstitutionInviteLinkGroupBy) StringsX

func (s *InstitutionInviteLinkGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type InstitutionInviteLinkMutation

type InstitutionInviteLinkMutation struct {
	// contains filtered or unexported fields
}

InstitutionInviteLinkMutation represents an operation that mutates the InstitutionInviteLink nodes in the graph.

func (*InstitutionInviteLinkMutation) AddField

func (m *InstitutionInviteLinkMutation) 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 (*InstitutionInviteLinkMutation) AddedEdges

func (m *InstitutionInviteLinkMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*InstitutionInviteLinkMutation) AddedField

func (m *InstitutionInviteLinkMutation) 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 (*InstitutionInviteLinkMutation) AddedFields

func (m *InstitutionInviteLinkMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*InstitutionInviteLinkMutation) AddedIDs

func (m *InstitutionInviteLinkMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*InstitutionInviteLinkMutation) ClearEdge

func (m *InstitutionInviteLinkMutation) 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 (*InstitutionInviteLinkMutation) ClearField

func (m *InstitutionInviteLinkMutation) 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 (*InstitutionInviteLinkMutation) ClearInstitution

func (m *InstitutionInviteLinkMutation) ClearInstitution()

ClearInstitution clears the "institution" edge to the Institution entity.

func (*InstitutionInviteLinkMutation) ClearedEdges

func (m *InstitutionInviteLinkMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*InstitutionInviteLinkMutation) ClearedFields

func (m *InstitutionInviteLinkMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (InstitutionInviteLinkMutation) 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 (*InstitutionInviteLinkMutation) Code

func (m *InstitutionInviteLinkMutation) Code() (r string, exists bool)

Code returns the value of the "code" field in the mutation.

func (*InstitutionInviteLinkMutation) EdgeCleared

func (m *InstitutionInviteLinkMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*InstitutionInviteLinkMutation) Field

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 (*InstitutionInviteLinkMutation) FieldCleared

func (m *InstitutionInviteLinkMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*InstitutionInviteLinkMutation) Fields

func (m *InstitutionInviteLinkMutation) 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 (*InstitutionInviteLinkMutation) ID

func (m *InstitutionInviteLinkMutation) ID() (id int, 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 (*InstitutionInviteLinkMutation) 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 (*InstitutionInviteLinkMutation) InstitutionCleared

func (m *InstitutionInviteLinkMutation) InstitutionCleared() bool

InstitutionCleared reports if the "institution" edge to the Institution entity was cleared.

func (*InstitutionInviteLinkMutation) InstitutionID

func (m *InstitutionInviteLinkMutation) InstitutionID() (id int, exists bool)

InstitutionID returns the "institution" edge ID in the mutation.

func (*InstitutionInviteLinkMutation) InstitutionIDs

func (m *InstitutionInviteLinkMutation) InstitutionIDs() (ids []int)

InstitutionIDs returns the "institution" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use InstitutionID instead. It exists only for internal usage by the builders.

func (*InstitutionInviteLinkMutation) OldCode

func (m *InstitutionInviteLinkMutation) OldCode(ctx context.Context) (v string, err error)

OldCode returns the old "code" field's value of the InstitutionInviteLink entity. If the InstitutionInviteLink 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 (*InstitutionInviteLinkMutation) OldField

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*InstitutionInviteLinkMutation) OldRole

OldRole returns the old "role" field's value of the InstitutionInviteLink entity. If the InstitutionInviteLink 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 (*InstitutionInviteLinkMutation) Op

Op returns the operation name.

func (*InstitutionInviteLinkMutation) RemovedEdges

func (m *InstitutionInviteLinkMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*InstitutionInviteLinkMutation) RemovedIDs

func (m *InstitutionInviteLinkMutation) 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 (*InstitutionInviteLinkMutation) ResetCode

func (m *InstitutionInviteLinkMutation) ResetCode()

ResetCode resets all changes to the "code" field.

func (*InstitutionInviteLinkMutation) ResetEdge

func (m *InstitutionInviteLinkMutation) 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 (*InstitutionInviteLinkMutation) ResetField

func (m *InstitutionInviteLinkMutation) 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 (*InstitutionInviteLinkMutation) ResetInstitution

func (m *InstitutionInviteLinkMutation) ResetInstitution()

ResetInstitution resets all changes to the "institution" edge.

func (*InstitutionInviteLinkMutation) ResetRole

func (m *InstitutionInviteLinkMutation) ResetRole()

ResetRole resets all changes to the "role" field.

func (*InstitutionInviteLinkMutation) Role

func (m *InstitutionInviteLinkMutation) Role() (r institution.Role, exists bool)

Role returns the value of the "role" field in the mutation.

func (*InstitutionInviteLinkMutation) SetCode

func (m *InstitutionInviteLinkMutation) SetCode(s string)

SetCode sets the "code" field.

func (*InstitutionInviteLinkMutation) SetField

func (m *InstitutionInviteLinkMutation) 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 (*InstitutionInviteLinkMutation) SetInstitutionID

func (m *InstitutionInviteLinkMutation) SetInstitutionID(id int)

SetInstitutionID sets the "institution" edge to the Institution entity by id.

func (*InstitutionInviteLinkMutation) SetOp

func (m *InstitutionInviteLinkMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*InstitutionInviteLinkMutation) SetRole

SetRole sets the "role" field.

func (InstitutionInviteLinkMutation) Tx

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*InstitutionInviteLinkMutation) Type

Type returns the node type of this mutation (InstitutionInviteLink).

func (*InstitutionInviteLinkMutation) Where

Where appends a list predicates to the InstitutionInviteLinkMutation builder.

func (*InstitutionInviteLinkMutation) WhereP

func (m *InstitutionInviteLinkMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the InstitutionInviteLinkMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type InstitutionInviteLinkQuery

type InstitutionInviteLinkQuery struct {
	// contains filtered or unexported fields
}

InstitutionInviteLinkQuery is the builder for querying InstitutionInviteLink entities.

func (*InstitutionInviteLinkQuery) Aggregate

Aggregate returns a InstitutionInviteLinkSelect configured with the given aggregations.

func (*InstitutionInviteLinkQuery) All

All executes the query and returns a list of InstitutionInviteLinks.

func (*InstitutionInviteLinkQuery) AllX

AllX is like All, but panics if an error occurs.

func (*InstitutionInviteLinkQuery) Clone

Clone returns a duplicate of the InstitutionInviteLinkQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*InstitutionInviteLinkQuery) Count

func (iilq *InstitutionInviteLinkQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*InstitutionInviteLinkQuery) CountX

func (iilq *InstitutionInviteLinkQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*InstitutionInviteLinkQuery) Exist

func (iilq *InstitutionInviteLinkQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*InstitutionInviteLinkQuery) ExistX

func (iilq *InstitutionInviteLinkQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*InstitutionInviteLinkQuery) First

First returns the first InstitutionInviteLink entity from the query. Returns a *NotFoundError when no InstitutionInviteLink was found.

func (*InstitutionInviteLinkQuery) FirstID

func (iilq *InstitutionInviteLinkQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first InstitutionInviteLink ID from the query. Returns a *NotFoundError when no InstitutionInviteLink ID was found.

func (*InstitutionInviteLinkQuery) FirstIDX

func (iilq *InstitutionInviteLinkQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*InstitutionInviteLinkQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*InstitutionInviteLinkQuery) GroupBy

func (iilq *InstitutionInviteLinkQuery) GroupBy(field string, fields ...string) *InstitutionInviteLinkGroupBy

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 {
	Code string `json:"code,omitempty"`
	Count int `json:"count,omitempty"`
}

client.InstitutionInviteLink.Query().
	GroupBy(institutioninvitelink.FieldCode).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*InstitutionInviteLinkQuery) IDs

func (iilq *InstitutionInviteLinkQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of InstitutionInviteLink IDs.

func (*InstitutionInviteLinkQuery) IDsX

func (iilq *InstitutionInviteLinkQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*InstitutionInviteLinkQuery) Limit

Limit the number of records to be returned by this query.

func (*InstitutionInviteLinkQuery) Offset

Offset to start from.

func (*InstitutionInviteLinkQuery) Only

Only returns a single InstitutionInviteLink entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one InstitutionInviteLink entity is found. Returns a *NotFoundError when no InstitutionInviteLink entities are found.

func (*InstitutionInviteLinkQuery) OnlyID

func (iilq *InstitutionInviteLinkQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only InstitutionInviteLink ID in the query. Returns a *NotSingularError when more than one InstitutionInviteLink ID is found. Returns a *NotFoundError when no entities are found.

func (*InstitutionInviteLinkQuery) OnlyIDX

func (iilq *InstitutionInviteLinkQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*InstitutionInviteLinkQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*InstitutionInviteLinkQuery) Order

Order specifies how the records should be ordered.

func (*InstitutionInviteLinkQuery) QueryInstitution

func (iilq *InstitutionInviteLinkQuery) QueryInstitution() *InstitutionQuery

QueryInstitution chains the current query on the "institution" edge.

func (*InstitutionInviteLinkQuery) Select

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 {
	Code string `json:"code,omitempty"`
}

client.InstitutionInviteLink.Query().
	Select(institutioninvitelink.FieldCode).
	Scan(ctx, &v)

func (*InstitutionInviteLinkQuery) Unique

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 (*InstitutionInviteLinkQuery) Where

Where adds a new predicate for the InstitutionInviteLinkQuery builder.

func (*InstitutionInviteLinkQuery) WithInstitution

func (iilq *InstitutionInviteLinkQuery) WithInstitution(opts ...func(*InstitutionQuery)) *InstitutionInviteLinkQuery

WithInstitution tells the query-builder to eager-load the nodes that are connected to the "institution" edge. The optional arguments are used to configure the query builder of the edge.

type InstitutionInviteLinkSelect

type InstitutionInviteLinkSelect struct {
	*InstitutionInviteLinkQuery
	// contains filtered or unexported fields
}

InstitutionInviteLinkSelect is the builder for selecting fields of InstitutionInviteLink entities.

func (*InstitutionInviteLinkSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*InstitutionInviteLinkSelect) Bool

func (s *InstitutionInviteLinkSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*InstitutionInviteLinkSelect) BoolX

func (s *InstitutionInviteLinkSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*InstitutionInviteLinkSelect) Bools

func (s *InstitutionInviteLinkSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*InstitutionInviteLinkSelect) BoolsX

func (s *InstitutionInviteLinkSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*InstitutionInviteLinkSelect) Float64

func (s *InstitutionInviteLinkSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*InstitutionInviteLinkSelect) Float64X

func (s *InstitutionInviteLinkSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*InstitutionInviteLinkSelect) Float64s

func (s *InstitutionInviteLinkSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*InstitutionInviteLinkSelect) Float64sX

func (s *InstitutionInviteLinkSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*InstitutionInviteLinkSelect) Int

func (s *InstitutionInviteLinkSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*InstitutionInviteLinkSelect) IntX

func (s *InstitutionInviteLinkSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*InstitutionInviteLinkSelect) Ints

func (s *InstitutionInviteLinkSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*InstitutionInviteLinkSelect) IntsX

func (s *InstitutionInviteLinkSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*InstitutionInviteLinkSelect) Scan

Scan applies the selector query and scans the result into the given value.

func (*InstitutionInviteLinkSelect) ScanX

func (s *InstitutionInviteLinkSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*InstitutionInviteLinkSelect) String

func (s *InstitutionInviteLinkSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*InstitutionInviteLinkSelect) StringX

func (s *InstitutionInviteLinkSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*InstitutionInviteLinkSelect) Strings

func (s *InstitutionInviteLinkSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*InstitutionInviteLinkSelect) StringsX

func (s *InstitutionInviteLinkSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type InstitutionInviteLinkUpdate

type InstitutionInviteLinkUpdate struct {
	// contains filtered or unexported fields
}

InstitutionInviteLinkUpdate is the builder for updating InstitutionInviteLink entities.

func (*InstitutionInviteLinkUpdate) ClearInstitution

func (iilu *InstitutionInviteLinkUpdate) ClearInstitution() *InstitutionInviteLinkUpdate

ClearInstitution clears the "institution" edge to the Institution entity.

func (*InstitutionInviteLinkUpdate) Exec

Exec executes the query.

func (*InstitutionInviteLinkUpdate) ExecX

func (iilu *InstitutionInviteLinkUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*InstitutionInviteLinkUpdate) Mutation

Mutation returns the InstitutionInviteLinkMutation object of the builder.

func (*InstitutionInviteLinkUpdate) Save

Save executes the query and returns the number of nodes affected by the update operation.

func (*InstitutionInviteLinkUpdate) SaveX

SaveX is like Save, but panics if an error occurs.

func (*InstitutionInviteLinkUpdate) SetCode

SetCode sets the "code" field.

func (*InstitutionInviteLinkUpdate) SetInstitution

SetInstitution sets the "institution" edge to the Institution entity.

func (*InstitutionInviteLinkUpdate) SetInstitutionID

func (iilu *InstitutionInviteLinkUpdate) SetInstitutionID(id int) *InstitutionInviteLinkUpdate

SetInstitutionID sets the "institution" edge to the Institution entity by ID.

func (*InstitutionInviteLinkUpdate) SetRole

SetRole sets the "role" field.

func (*InstitutionInviteLinkUpdate) Where

Where appends a list predicates to the InstitutionInviteLinkUpdate builder.

type InstitutionInviteLinkUpdateOne

type InstitutionInviteLinkUpdateOne struct {
	// contains filtered or unexported fields
}

InstitutionInviteLinkUpdateOne is the builder for updating a single InstitutionInviteLink entity.

func (*InstitutionInviteLinkUpdateOne) ClearInstitution

ClearInstitution clears the "institution" edge to the Institution entity.

func (*InstitutionInviteLinkUpdateOne) Exec

Exec executes the query on the entity.

func (*InstitutionInviteLinkUpdateOne) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*InstitutionInviteLinkUpdateOne) Mutation

Mutation returns the InstitutionInviteLinkMutation object of the builder.

func (*InstitutionInviteLinkUpdateOne) Save

Save executes the query and returns the updated InstitutionInviteLink entity.

func (*InstitutionInviteLinkUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*InstitutionInviteLinkUpdateOne) Select

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*InstitutionInviteLinkUpdateOne) SetCode

SetCode sets the "code" field.

func (*InstitutionInviteLinkUpdateOne) SetInstitution

SetInstitution sets the "institution" edge to the Institution entity.

func (*InstitutionInviteLinkUpdateOne) SetInstitutionID

SetInstitutionID sets the "institution" edge to the Institution entity by ID.

func (*InstitutionInviteLinkUpdateOne) SetRole

SetRole sets the "role" field.

func (*InstitutionInviteLinkUpdateOne) Where

Where appends a list predicates to the InstitutionInviteLinkUpdate builder.

type InstitutionInviteLinkUpsert

type InstitutionInviteLinkUpsert struct {
	*sql.UpdateSet
}

InstitutionInviteLinkUpsert is the "OnConflict" setter.

func (*InstitutionInviteLinkUpsert) SetCode

SetCode sets the "code" field.

func (*InstitutionInviteLinkUpsert) SetRole

SetRole sets the "role" field.

func (*InstitutionInviteLinkUpsert) UpdateCode

UpdateCode sets the "code" field to the value that was provided on create.

func (*InstitutionInviteLinkUpsert) UpdateRole

UpdateRole sets the "role" field to the value that was provided on create.

type InstitutionInviteLinkUpsertBulk

type InstitutionInviteLinkUpsertBulk struct {
	// contains filtered or unexported fields
}

InstitutionInviteLinkUpsertBulk is the builder for "upsert"-ing a bulk of InstitutionInviteLink nodes.

func (*InstitutionInviteLinkUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*InstitutionInviteLinkUpsertBulk) Exec

Exec executes the query.

func (*InstitutionInviteLinkUpsertBulk) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*InstitutionInviteLinkUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.InstitutionInviteLink.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*InstitutionInviteLinkUpsertBulk) SetCode

SetCode sets the "code" field.

func (*InstitutionInviteLinkUpsertBulk) SetRole

SetRole sets the "role" field.

func (*InstitutionInviteLinkUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the InstitutionInviteLinkCreateBulk.OnConflict documentation for more info.

func (*InstitutionInviteLinkUpsertBulk) UpdateCode

UpdateCode sets the "code" field to the value that was provided on create.

func (*InstitutionInviteLinkUpsertBulk) UpdateNewValues

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.InstitutionInviteLink.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*InstitutionInviteLinkUpsertBulk) UpdateRole

UpdateRole sets the "role" field to the value that was provided on create.

type InstitutionInviteLinkUpsertOne

type InstitutionInviteLinkUpsertOne struct {
	// contains filtered or unexported fields
}

InstitutionInviteLinkUpsertOne is the builder for "upsert"-ing

one InstitutionInviteLink node.

func (*InstitutionInviteLinkUpsertOne) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*InstitutionInviteLinkUpsertOne) Exec

Exec executes the query.

func (*InstitutionInviteLinkUpsertOne) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*InstitutionInviteLinkUpsertOne) ID

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*InstitutionInviteLinkUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*InstitutionInviteLinkUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.InstitutionInviteLink.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*InstitutionInviteLinkUpsertOne) SetCode

SetCode sets the "code" field.

func (*InstitutionInviteLinkUpsertOne) SetRole

SetRole sets the "role" field.

func (*InstitutionInviteLinkUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the InstitutionInviteLinkCreate.OnConflict documentation for more info.

func (*InstitutionInviteLinkUpsertOne) UpdateCode

UpdateCode sets the "code" field to the value that was provided on create.

func (*InstitutionInviteLinkUpsertOne) UpdateNewValues

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.InstitutionInviteLink.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*InstitutionInviteLinkUpsertOne) UpdateRole

UpdateRole sets the "role" field to the value that was provided on create.

type InstitutionInviteLinks []*InstitutionInviteLink

InstitutionInviteLinks is a parsable slice of InstitutionInviteLink.

type InstitutionMutation

type InstitutionMutation struct {
	// contains filtered or unexported fields
}

InstitutionMutation represents an operation that mutates the Institution nodes in the graph.

func (*InstitutionMutation) AccessoriesCleared

func (m *InstitutionMutation) AccessoriesCleared() bool

AccessoriesCleared reports if the "accessories" edge to the Accessory entity was cleared.

func (*InstitutionMutation) AccessoriesIDs

func (m *InstitutionMutation) AccessoriesIDs() (ids []int)

AccessoriesIDs returns the "accessories" edge IDs in the mutation.

func (*InstitutionMutation) AddAccessoryIDs

func (m *InstitutionMutation) AddAccessoryIDs(ids ...int)

AddAccessoryIDs adds the "accessories" edge to the Accessory entity by ids.

func (*InstitutionMutation) AddField

func (m *InstitutionMutation) 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 (*InstitutionMutation) AddGroupIDs

func (m *InstitutionMutation) AddGroupIDs(ids ...int)

AddGroupIDs adds the "groups" edge to the Group entity by ids.

func (*InstitutionMutation) AddInviteIDs

func (m *InstitutionMutation) AddInviteIDs(ids ...int)

AddInviteIDs adds the "invites" edge to the InstitutionInviteLink entity by ids.

func (*InstitutionMutation) AddUserIDs

func (m *InstitutionMutation) AddUserIDs(ids ...int)

AddUserIDs adds the "users" edge to the User entity by ids.

func (*InstitutionMutation) AddVoucherIDs

func (m *InstitutionMutation) AddVoucherIDs(ids ...int)

AddVoucherIDs adds the "vouchers" edge to the Voucher entity by ids.

func (*InstitutionMutation) AddedEdges

func (m *InstitutionMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*InstitutionMutation) AddedField

func (m *InstitutionMutation) 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 (*InstitutionMutation) AddedFields

func (m *InstitutionMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*InstitutionMutation) AddedIDs

func (m *InstitutionMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*InstitutionMutation) ClearAccessories

func (m *InstitutionMutation) ClearAccessories()

ClearAccessories clears the "accessories" edge to the Accessory entity.

func (*InstitutionMutation) ClearEdge

func (m *InstitutionMutation) 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 (*InstitutionMutation) ClearField

func (m *InstitutionMutation) 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 (*InstitutionMutation) ClearGroups

func (m *InstitutionMutation) ClearGroups()

ClearGroups clears the "groups" edge to the Group entity.

func (*InstitutionMutation) ClearInvites

func (m *InstitutionMutation) ClearInvites()

ClearInvites clears the "invites" edge to the InstitutionInviteLink entity.

func (*InstitutionMutation) ClearUsers

func (m *InstitutionMutation) ClearUsers()

ClearUsers clears the "users" edge to the User entity.

func (*InstitutionMutation) ClearVouchers

func (m *InstitutionMutation) ClearVouchers()

ClearVouchers clears the "vouchers" edge to the Voucher entity.

func (*InstitutionMutation) ClearedEdges

func (m *InstitutionMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*InstitutionMutation) ClearedFields

func (m *InstitutionMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (InstitutionMutation) Client

func (m InstitutionMutation) 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 (*InstitutionMutation) Description

func (m *InstitutionMutation) Description() (r string, exists bool)

Description returns the value of the "Description" field in the mutation.

func (*InstitutionMutation) EdgeCleared

func (m *InstitutionMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*InstitutionMutation) Field

func (m *InstitutionMutation) 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 (*InstitutionMutation) FieldCleared

func (m *InstitutionMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*InstitutionMutation) Fields

func (m *InstitutionMutation) 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 (*InstitutionMutation) GroupsCleared

func (m *InstitutionMutation) GroupsCleared() bool

GroupsCleared reports if the "groups" edge to the Group entity was cleared.

func (*InstitutionMutation) GroupsIDs

func (m *InstitutionMutation) GroupsIDs() (ids []int)

GroupsIDs returns the "groups" edge IDs in the mutation.

func (*InstitutionMutation) ID

func (m *InstitutionMutation) ID() (id int, 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 (*InstitutionMutation) IDs

func (m *InstitutionMutation) IDs(ctx context.Context) ([]int, 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 (*InstitutionMutation) InvitesCleared

func (m *InstitutionMutation) InvitesCleared() bool

InvitesCleared reports if the "invites" edge to the InstitutionInviteLink entity was cleared.

func (*InstitutionMutation) InvitesIDs

func (m *InstitutionMutation) InvitesIDs() (ids []int)

InvitesIDs returns the "invites" edge IDs in the mutation.

func (*InstitutionMutation) Name

func (m *InstitutionMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*InstitutionMutation) OldDescription

func (m *InstitutionMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "Description" field's value of the Institution entity. If the Institution 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 (*InstitutionMutation) OldField

func (m *InstitutionMutation) 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 (*InstitutionMutation) OldName

func (m *InstitutionMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Institution entity. If the Institution 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 (*InstitutionMutation) OldShortName

func (m *InstitutionMutation) OldShortName(ctx context.Context) (v string, err error)

OldShortName returns the old "short_name" field's value of the Institution entity. If the Institution 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 (*InstitutionMutation) Op

func (m *InstitutionMutation) Op() Op

Op returns the operation name.

func (*InstitutionMutation) RemoveAccessoryIDs

func (m *InstitutionMutation) RemoveAccessoryIDs(ids ...int)

RemoveAccessoryIDs removes the "accessories" edge to the Accessory entity by IDs.

func (*InstitutionMutation) RemoveGroupIDs

func (m *InstitutionMutation) RemoveGroupIDs(ids ...int)

RemoveGroupIDs removes the "groups" edge to the Group entity by IDs.

func (*InstitutionMutation) RemoveInviteIDs

func (m *InstitutionMutation) RemoveInviteIDs(ids ...int)

RemoveInviteIDs removes the "invites" edge to the InstitutionInviteLink entity by IDs.

func (*InstitutionMutation) RemoveUserIDs

func (m *InstitutionMutation) RemoveUserIDs(ids ...int)

RemoveUserIDs removes the "users" edge to the User entity by IDs.

func (*InstitutionMutation) RemoveVoucherIDs

func (m *InstitutionMutation) RemoveVoucherIDs(ids ...int)

RemoveVoucherIDs removes the "vouchers" edge to the Voucher entity by IDs.

func (*InstitutionMutation) RemovedAccessoriesIDs

func (m *InstitutionMutation) RemovedAccessoriesIDs() (ids []int)

RemovedAccessories returns the removed IDs of the "accessories" edge to the Accessory entity.

func (*InstitutionMutation) RemovedEdges

func (m *InstitutionMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*InstitutionMutation) RemovedGroupsIDs

func (m *InstitutionMutation) RemovedGroupsIDs() (ids []int)

RemovedGroups returns the removed IDs of the "groups" edge to the Group entity.

func (*InstitutionMutation) RemovedIDs

func (m *InstitutionMutation) 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 (*InstitutionMutation) RemovedInvitesIDs

func (m *InstitutionMutation) RemovedInvitesIDs() (ids []int)

RemovedInvites returns the removed IDs of the "invites" edge to the InstitutionInviteLink entity.

func (*InstitutionMutation) RemovedUsersIDs

func (m *InstitutionMutation) RemovedUsersIDs() (ids []int)

RemovedUsers returns the removed IDs of the "users" edge to the User entity.

func (*InstitutionMutation) RemovedVouchersIDs

func (m *InstitutionMutation) RemovedVouchersIDs() (ids []int)

RemovedVouchers returns the removed IDs of the "vouchers" edge to the Voucher entity.

func (*InstitutionMutation) ResetAccessories

func (m *InstitutionMutation) ResetAccessories()

ResetAccessories resets all changes to the "accessories" edge.

func (*InstitutionMutation) ResetDescription

func (m *InstitutionMutation) ResetDescription()

ResetDescription resets all changes to the "Description" field.

func (*InstitutionMutation) ResetEdge

func (m *InstitutionMutation) 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 (*InstitutionMutation) ResetField

func (m *InstitutionMutation) 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 (*InstitutionMutation) ResetGroups

func (m *InstitutionMutation) ResetGroups()

ResetGroups resets all changes to the "groups" edge.

func (*InstitutionMutation) ResetInvites

func (m *InstitutionMutation) ResetInvites()

ResetInvites resets all changes to the "invites" edge.

func (*InstitutionMutation) ResetName

func (m *InstitutionMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*InstitutionMutation) ResetShortName

func (m *InstitutionMutation) ResetShortName()

ResetShortName resets all changes to the "short_name" field.

func (*InstitutionMutation) ResetUsers

func (m *InstitutionMutation) ResetUsers()

ResetUsers resets all changes to the "users" edge.

func (*InstitutionMutation) ResetVouchers

func (m *InstitutionMutation) ResetVouchers()

ResetVouchers resets all changes to the "vouchers" edge.

func (*InstitutionMutation) SetDescription

func (m *InstitutionMutation) SetDescription(s string)

SetDescription sets the "Description" field.

func (*InstitutionMutation) SetField

func (m *InstitutionMutation) 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 (*InstitutionMutation) SetName

func (m *InstitutionMutation) SetName(s string)

SetName sets the "name" field.

func (*InstitutionMutation) SetOp

func (m *InstitutionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*InstitutionMutation) SetShortName

func (m *InstitutionMutation) SetShortName(s string)

SetShortName sets the "short_name" field.

func (*InstitutionMutation) ShortName

func (m *InstitutionMutation) ShortName() (r string, exists bool)

ShortName returns the value of the "short_name" field in the mutation.

func (InstitutionMutation) Tx

func (m InstitutionMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*InstitutionMutation) Type

func (m *InstitutionMutation) Type() string

Type returns the node type of this mutation (Institution).

func (*InstitutionMutation) UsersCleared

func (m *InstitutionMutation) UsersCleared() bool

UsersCleared reports if the "users" edge to the User entity was cleared.

func (*InstitutionMutation) UsersIDs

func (m *InstitutionMutation) UsersIDs() (ids []int)

UsersIDs returns the "users" edge IDs in the mutation.

func (*InstitutionMutation) VouchersCleared

func (m *InstitutionMutation) VouchersCleared() bool

VouchersCleared reports if the "vouchers" edge to the Voucher entity was cleared.

func (*InstitutionMutation) VouchersIDs

func (m *InstitutionMutation) VouchersIDs() (ids []int)

VouchersIDs returns the "vouchers" edge IDs in the mutation.

func (*InstitutionMutation) Where

func (m *InstitutionMutation) Where(ps ...predicate.Institution)

Where appends a list predicates to the InstitutionMutation builder.

func (*InstitutionMutation) WhereP

func (m *InstitutionMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the InstitutionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type InstitutionQuery

type InstitutionQuery struct {
	// contains filtered or unexported fields
}

InstitutionQuery is the builder for querying Institution entities.

func (*InstitutionQuery) Aggregate

func (iq *InstitutionQuery) Aggregate(fns ...AggregateFunc) *InstitutionSelect

Aggregate returns a InstitutionSelect configured with the given aggregations.

func (*InstitutionQuery) All

func (iq *InstitutionQuery) All(ctx context.Context) ([]*Institution, error)

All executes the query and returns a list of Institutions.

func (*InstitutionQuery) AllX

func (iq *InstitutionQuery) AllX(ctx context.Context) []*Institution

AllX is like All, but panics if an error occurs.

func (*InstitutionQuery) Clone

func (iq *InstitutionQuery) Clone() *InstitutionQuery

Clone returns a duplicate of the InstitutionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*InstitutionQuery) Count

func (iq *InstitutionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*InstitutionQuery) CountX

func (iq *InstitutionQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*InstitutionQuery) Exist

func (iq *InstitutionQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*InstitutionQuery) ExistX

func (iq *InstitutionQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*InstitutionQuery) First

func (iq *InstitutionQuery) First(ctx context.Context) (*Institution, error)

First returns the first Institution entity from the query. Returns a *NotFoundError when no Institution was found.

func (*InstitutionQuery) FirstID

func (iq *InstitutionQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Institution ID from the query. Returns a *NotFoundError when no Institution ID was found.

func (*InstitutionQuery) FirstIDX

func (iq *InstitutionQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*InstitutionQuery) FirstX

func (iq *InstitutionQuery) FirstX(ctx context.Context) *Institution

FirstX is like First, but panics if an error occurs.

func (*InstitutionQuery) GroupBy

func (iq *InstitutionQuery) GroupBy(field string, fields ...string) *InstitutionGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Institution.Query().
	GroupBy(entinstitution.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*InstitutionQuery) IDs

func (iq *InstitutionQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Institution IDs.

func (*InstitutionQuery) IDsX

func (iq *InstitutionQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*InstitutionQuery) Limit

func (iq *InstitutionQuery) Limit(limit int) *InstitutionQuery

Limit the number of records to be returned by this query.

func (*InstitutionQuery) Offset

func (iq *InstitutionQuery) Offset(offset int) *InstitutionQuery

Offset to start from.

func (*InstitutionQuery) Only

func (iq *InstitutionQuery) Only(ctx context.Context) (*Institution, error)

Only returns a single Institution entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Institution entity is found. Returns a *NotFoundError when no Institution entities are found.

func (*InstitutionQuery) OnlyID

func (iq *InstitutionQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Institution ID in the query. Returns a *NotSingularError when more than one Institution ID is found. Returns a *NotFoundError when no entities are found.

func (*InstitutionQuery) OnlyIDX

func (iq *InstitutionQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*InstitutionQuery) OnlyX

func (iq *InstitutionQuery) OnlyX(ctx context.Context) *Institution

OnlyX is like Only, but panics if an error occurs.

func (*InstitutionQuery) Order

Order specifies how the records should be ordered.

func (*InstitutionQuery) QueryAccessories

func (iq *InstitutionQuery) QueryAccessories() *AccessoryQuery

QueryAccessories chains the current query on the "accessories" edge.

func (*InstitutionQuery) QueryGroups

func (iq *InstitutionQuery) QueryGroups() *GroupQuery

QueryGroups chains the current query on the "groups" edge.

func (*InstitutionQuery) QueryInvites

func (iq *InstitutionQuery) QueryInvites() *InstitutionInviteLinkQuery

QueryInvites chains the current query on the "invites" edge.

func (*InstitutionQuery) QueryUsers

func (iq *InstitutionQuery) QueryUsers() *UserQuery

QueryUsers chains the current query on the "users" edge.

func (*InstitutionQuery) QueryVouchers

func (iq *InstitutionQuery) QueryVouchers() *VoucherQuery

QueryVouchers chains the current query on the "vouchers" edge.

func (*InstitutionQuery) Select

func (iq *InstitutionQuery) Select(fields ...string) *InstitutionSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.Institution.Query().
	Select(entinstitution.FieldName).
	Scan(ctx, &v)

func (*InstitutionQuery) Unique

func (iq *InstitutionQuery) Unique(unique bool) *InstitutionQuery

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 (*InstitutionQuery) Where

Where adds a new predicate for the InstitutionQuery builder.

func (*InstitutionQuery) WithAccessories

func (iq *InstitutionQuery) WithAccessories(opts ...func(*AccessoryQuery)) *InstitutionQuery

WithAccessories tells the query-builder to eager-load the nodes that are connected to the "accessories" edge. The optional arguments are used to configure the query builder of the edge.

func (*InstitutionQuery) WithGroups

func (iq *InstitutionQuery) WithGroups(opts ...func(*GroupQuery)) *InstitutionQuery

WithGroups tells the query-builder to eager-load the nodes that are connected to the "groups" edge. The optional arguments are used to configure the query builder of the edge.

func (*InstitutionQuery) WithInvites

func (iq *InstitutionQuery) WithInvites(opts ...func(*InstitutionInviteLinkQuery)) *InstitutionQuery

WithInvites tells the query-builder to eager-load the nodes that are connected to the "invites" edge. The optional arguments are used to configure the query builder of the edge.

func (*InstitutionQuery) WithUsers

func (iq *InstitutionQuery) WithUsers(opts ...func(*UserQuery)) *InstitutionQuery

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.

func (*InstitutionQuery) WithVouchers

func (iq *InstitutionQuery) WithVouchers(opts ...func(*VoucherQuery)) *InstitutionQuery

WithVouchers tells the query-builder to eager-load the nodes that are connected to the "vouchers" edge. The optional arguments are used to configure the query builder of the edge.

type InstitutionSelect

type InstitutionSelect struct {
	*InstitutionQuery
	// contains filtered or unexported fields
}

InstitutionSelect is the builder for selecting fields of Institution entities.

func (*InstitutionSelect) Aggregate

func (is *InstitutionSelect) Aggregate(fns ...AggregateFunc) *InstitutionSelect

Aggregate adds the given aggregation functions to the selector query.

func (*InstitutionSelect) Bool

func (s *InstitutionSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*InstitutionSelect) BoolX

func (s *InstitutionSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*InstitutionSelect) Bools

func (s *InstitutionSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*InstitutionSelect) BoolsX

func (s *InstitutionSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*InstitutionSelect) Float64

func (s *InstitutionSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*InstitutionSelect) Float64X

func (s *InstitutionSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*InstitutionSelect) Float64s

func (s *InstitutionSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*InstitutionSelect) Float64sX

func (s *InstitutionSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*InstitutionSelect) Int

func (s *InstitutionSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*InstitutionSelect) IntX

func (s *InstitutionSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*InstitutionSelect) Ints

func (s *InstitutionSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*InstitutionSelect) IntsX

func (s *InstitutionSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*InstitutionSelect) Scan

func (is *InstitutionSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*InstitutionSelect) ScanX

func (s *InstitutionSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*InstitutionSelect) String

func (s *InstitutionSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*InstitutionSelect) StringX

func (s *InstitutionSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*InstitutionSelect) Strings

func (s *InstitutionSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*InstitutionSelect) StringsX

func (s *InstitutionSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type InstitutionUpdate

type InstitutionUpdate struct {
	// contains filtered or unexported fields
}

InstitutionUpdate is the builder for updating Institution entities.

func (*InstitutionUpdate) AddAccessories

func (iu *InstitutionUpdate) AddAccessories(a ...*Accessory) *InstitutionUpdate

AddAccessories adds the "accessories" edges to the Accessory entity.

func (*InstitutionUpdate) AddAccessoryIDs

func (iu *InstitutionUpdate) AddAccessoryIDs(ids ...int) *InstitutionUpdate

AddAccessoryIDs adds the "accessories" edge to the Accessory entity by IDs.

func (*InstitutionUpdate) AddGroupIDs

func (iu *InstitutionUpdate) AddGroupIDs(ids ...int) *InstitutionUpdate

AddGroupIDs adds the "groups" edge to the Group entity by IDs.

func (*InstitutionUpdate) AddGroups

func (iu *InstitutionUpdate) AddGroups(g ...*Group) *InstitutionUpdate

AddGroups adds the "groups" edges to the Group entity.

func (*InstitutionUpdate) AddInviteIDs

func (iu *InstitutionUpdate) AddInviteIDs(ids ...int) *InstitutionUpdate

AddInviteIDs adds the "invites" edge to the InstitutionInviteLink entity by IDs.

func (*InstitutionUpdate) AddInvites

AddInvites adds the "invites" edges to the InstitutionInviteLink entity.

func (*InstitutionUpdate) AddUserIDs

func (iu *InstitutionUpdate) AddUserIDs(ids ...int) *InstitutionUpdate

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*InstitutionUpdate) AddUsers

func (iu *InstitutionUpdate) AddUsers(u ...*User) *InstitutionUpdate

AddUsers adds the "users" edges to the User entity.

func (*InstitutionUpdate) AddVoucherIDs

func (iu *InstitutionUpdate) AddVoucherIDs(ids ...int) *InstitutionUpdate

AddVoucherIDs adds the "vouchers" edge to the Voucher entity by IDs.

func (*InstitutionUpdate) AddVouchers

func (iu *InstitutionUpdate) AddVouchers(v ...*Voucher) *InstitutionUpdate

AddVouchers adds the "vouchers" edges to the Voucher entity.

func (*InstitutionUpdate) ClearAccessories

func (iu *InstitutionUpdate) ClearAccessories() *InstitutionUpdate

ClearAccessories clears all "accessories" edges to the Accessory entity.

func (*InstitutionUpdate) ClearGroups

func (iu *InstitutionUpdate) ClearGroups() *InstitutionUpdate

ClearGroups clears all "groups" edges to the Group entity.

func (*InstitutionUpdate) ClearInvites

func (iu *InstitutionUpdate) ClearInvites() *InstitutionUpdate

ClearInvites clears all "invites" edges to the InstitutionInviteLink entity.

func (*InstitutionUpdate) ClearUsers

func (iu *InstitutionUpdate) ClearUsers() *InstitutionUpdate

ClearUsers clears all "users" edges to the User entity.

func (*InstitutionUpdate) ClearVouchers

func (iu *InstitutionUpdate) ClearVouchers() *InstitutionUpdate

ClearVouchers clears all "vouchers" edges to the Voucher entity.

func (*InstitutionUpdate) Exec

func (iu *InstitutionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*InstitutionUpdate) ExecX

func (iu *InstitutionUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*InstitutionUpdate) Mutation

func (iu *InstitutionUpdate) Mutation() *InstitutionMutation

Mutation returns the InstitutionMutation object of the builder.

func (*InstitutionUpdate) RemoveAccessories

func (iu *InstitutionUpdate) RemoveAccessories(a ...*Accessory) *InstitutionUpdate

RemoveAccessories removes "accessories" edges to Accessory entities.

func (*InstitutionUpdate) RemoveAccessoryIDs

func (iu *InstitutionUpdate) RemoveAccessoryIDs(ids ...int) *InstitutionUpdate

RemoveAccessoryIDs removes the "accessories" edge to Accessory entities by IDs.

func (*InstitutionUpdate) RemoveGroupIDs

func (iu *InstitutionUpdate) RemoveGroupIDs(ids ...int) *InstitutionUpdate

RemoveGroupIDs removes the "groups" edge to Group entities by IDs.

func (*InstitutionUpdate) RemoveGroups

func (iu *InstitutionUpdate) RemoveGroups(g ...*Group) *InstitutionUpdate

RemoveGroups removes "groups" edges to Group entities.

func (*InstitutionUpdate) RemoveInviteIDs

func (iu *InstitutionUpdate) RemoveInviteIDs(ids ...int) *InstitutionUpdate

RemoveInviteIDs removes the "invites" edge to InstitutionInviteLink entities by IDs.

func (*InstitutionUpdate) RemoveInvites

func (iu *InstitutionUpdate) RemoveInvites(i ...*InstitutionInviteLink) *InstitutionUpdate

RemoveInvites removes "invites" edges to InstitutionInviteLink entities.

func (*InstitutionUpdate) RemoveUserIDs

func (iu *InstitutionUpdate) RemoveUserIDs(ids ...int) *InstitutionUpdate

RemoveUserIDs removes the "users" edge to User entities by IDs.

func (*InstitutionUpdate) RemoveUsers

func (iu *InstitutionUpdate) RemoveUsers(u ...*User) *InstitutionUpdate

RemoveUsers removes "users" edges to User entities.

func (*InstitutionUpdate) RemoveVoucherIDs

func (iu *InstitutionUpdate) RemoveVoucherIDs(ids ...int) *InstitutionUpdate

RemoveVoucherIDs removes the "vouchers" edge to Voucher entities by IDs.

func (*InstitutionUpdate) RemoveVouchers

func (iu *InstitutionUpdate) RemoveVouchers(v ...*Voucher) *InstitutionUpdate

RemoveVouchers removes "vouchers" edges to Voucher entities.

func (*InstitutionUpdate) Save

func (iu *InstitutionUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*InstitutionUpdate) SaveX

func (iu *InstitutionUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*InstitutionUpdate) SetDescription

func (iu *InstitutionUpdate) SetDescription(s string) *InstitutionUpdate

SetDescription sets the "Description" field.

func (*InstitutionUpdate) SetName

func (iu *InstitutionUpdate) SetName(s string) *InstitutionUpdate

SetName sets the "name" field.

func (*InstitutionUpdate) SetNillableDescription

func (iu *InstitutionUpdate) SetNillableDescription(s *string) *InstitutionUpdate

SetNillableDescription sets the "Description" field if the given value is not nil.

func (*InstitutionUpdate) SetShortName

func (iu *InstitutionUpdate) SetShortName(s string) *InstitutionUpdate

SetShortName sets the "short_name" field.

func (*InstitutionUpdate) Where

Where appends a list predicates to the InstitutionUpdate builder.

type InstitutionUpdateOne

type InstitutionUpdateOne struct {
	// contains filtered or unexported fields
}

InstitutionUpdateOne is the builder for updating a single Institution entity.

func (*InstitutionUpdateOne) AddAccessories

func (iuo *InstitutionUpdateOne) AddAccessories(a ...*Accessory) *InstitutionUpdateOne

AddAccessories adds the "accessories" edges to the Accessory entity.

func (*InstitutionUpdateOne) AddAccessoryIDs

func (iuo *InstitutionUpdateOne) AddAccessoryIDs(ids ...int) *InstitutionUpdateOne

AddAccessoryIDs adds the "accessories" edge to the Accessory entity by IDs.

func (*InstitutionUpdateOne) AddGroupIDs

func (iuo *InstitutionUpdateOne) AddGroupIDs(ids ...int) *InstitutionUpdateOne

AddGroupIDs adds the "groups" edge to the Group entity by IDs.

func (*InstitutionUpdateOne) AddGroups

func (iuo *InstitutionUpdateOne) AddGroups(g ...*Group) *InstitutionUpdateOne

AddGroups adds the "groups" edges to the Group entity.

func (*InstitutionUpdateOne) AddInviteIDs

func (iuo *InstitutionUpdateOne) AddInviteIDs(ids ...int) *InstitutionUpdateOne

AddInviteIDs adds the "invites" edge to the InstitutionInviteLink entity by IDs.

func (*InstitutionUpdateOne) AddInvites

AddInvites adds the "invites" edges to the InstitutionInviteLink entity.

func (*InstitutionUpdateOne) AddUserIDs

func (iuo *InstitutionUpdateOne) AddUserIDs(ids ...int) *InstitutionUpdateOne

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*InstitutionUpdateOne) AddUsers

func (iuo *InstitutionUpdateOne) AddUsers(u ...*User) *InstitutionUpdateOne

AddUsers adds the "users" edges to the User entity.

func (*InstitutionUpdateOne) AddVoucherIDs

func (iuo *InstitutionUpdateOne) AddVoucherIDs(ids ...int) *InstitutionUpdateOne

AddVoucherIDs adds the "vouchers" edge to the Voucher entity by IDs.

func (*InstitutionUpdateOne) AddVouchers

func (iuo *InstitutionUpdateOne) AddVouchers(v ...*Voucher) *InstitutionUpdateOne

AddVouchers adds the "vouchers" edges to the Voucher entity.

func (*InstitutionUpdateOne) ClearAccessories

func (iuo *InstitutionUpdateOne) ClearAccessories() *InstitutionUpdateOne

ClearAccessories clears all "accessories" edges to the Accessory entity.

func (*InstitutionUpdateOne) ClearGroups

func (iuo *InstitutionUpdateOne) ClearGroups() *InstitutionUpdateOne

ClearGroups clears all "groups" edges to the Group entity.

func (*InstitutionUpdateOne) ClearInvites

func (iuo *InstitutionUpdateOne) ClearInvites() *InstitutionUpdateOne

ClearInvites clears all "invites" edges to the InstitutionInviteLink entity.

func (*InstitutionUpdateOne) ClearUsers

func (iuo *InstitutionUpdateOne) ClearUsers() *InstitutionUpdateOne

ClearUsers clears all "users" edges to the User entity.

func (*InstitutionUpdateOne) ClearVouchers

func (iuo *InstitutionUpdateOne) ClearVouchers() *InstitutionUpdateOne

ClearVouchers clears all "vouchers" edges to the Voucher entity.

func (*InstitutionUpdateOne) Exec

func (iuo *InstitutionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*InstitutionUpdateOne) ExecX

func (iuo *InstitutionUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*InstitutionUpdateOne) Mutation

func (iuo *InstitutionUpdateOne) Mutation() *InstitutionMutation

Mutation returns the InstitutionMutation object of the builder.

func (*InstitutionUpdateOne) RemoveAccessories

func (iuo *InstitutionUpdateOne) RemoveAccessories(a ...*Accessory) *InstitutionUpdateOne

RemoveAccessories removes "accessories" edges to Accessory entities.

func (*InstitutionUpdateOne) RemoveAccessoryIDs

func (iuo *InstitutionUpdateOne) RemoveAccessoryIDs(ids ...int) *InstitutionUpdateOne

RemoveAccessoryIDs removes the "accessories" edge to Accessory entities by IDs.

func (*InstitutionUpdateOne) RemoveGroupIDs

func (iuo *InstitutionUpdateOne) RemoveGroupIDs(ids ...int) *InstitutionUpdateOne

RemoveGroupIDs removes the "groups" edge to Group entities by IDs.

func (*InstitutionUpdateOne) RemoveGroups

func (iuo *InstitutionUpdateOne) RemoveGroups(g ...*Group) *InstitutionUpdateOne

RemoveGroups removes "groups" edges to Group entities.

func (*InstitutionUpdateOne) RemoveInviteIDs

func (iuo *InstitutionUpdateOne) RemoveInviteIDs(ids ...int) *InstitutionUpdateOne

RemoveInviteIDs removes the "invites" edge to InstitutionInviteLink entities by IDs.

func (*InstitutionUpdateOne) RemoveInvites

RemoveInvites removes "invites" edges to InstitutionInviteLink entities.

func (*InstitutionUpdateOne) RemoveUserIDs

func (iuo *InstitutionUpdateOne) RemoveUserIDs(ids ...int) *InstitutionUpdateOne

RemoveUserIDs removes the "users" edge to User entities by IDs.

func (*InstitutionUpdateOne) RemoveUsers

func (iuo *InstitutionUpdateOne) RemoveUsers(u ...*User) *InstitutionUpdateOne

RemoveUsers removes "users" edges to User entities.

func (*InstitutionUpdateOne) RemoveVoucherIDs

func (iuo *InstitutionUpdateOne) RemoveVoucherIDs(ids ...int) *InstitutionUpdateOne

RemoveVoucherIDs removes the "vouchers" edge to Voucher entities by IDs.

func (*InstitutionUpdateOne) RemoveVouchers

func (iuo *InstitutionUpdateOne) RemoveVouchers(v ...*Voucher) *InstitutionUpdateOne

RemoveVouchers removes "vouchers" edges to Voucher entities.

func (*InstitutionUpdateOne) Save

Save executes the query and returns the updated Institution entity.

func (*InstitutionUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*InstitutionUpdateOne) Select

func (iuo *InstitutionUpdateOne) Select(field string, fields ...string) *InstitutionUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*InstitutionUpdateOne) SetDescription

func (iuo *InstitutionUpdateOne) SetDescription(s string) *InstitutionUpdateOne

SetDescription sets the "Description" field.

func (*InstitutionUpdateOne) SetName

SetName sets the "name" field.

func (*InstitutionUpdateOne) SetNillableDescription

func (iuo *InstitutionUpdateOne) SetNillableDescription(s *string) *InstitutionUpdateOne

SetNillableDescription sets the "Description" field if the given value is not nil.

func (*InstitutionUpdateOne) SetShortName

func (iuo *InstitutionUpdateOne) SetShortName(s string) *InstitutionUpdateOne

SetShortName sets the "short_name" field.

func (*InstitutionUpdateOne) Where

Where appends a list predicates to the InstitutionUpdate builder.

type InstitutionUpsert

type InstitutionUpsert struct {
	*sql.UpdateSet
}

InstitutionUpsert is the "OnConflict" setter.

func (*InstitutionUpsert) SetDescription

func (u *InstitutionUpsert) SetDescription(v string) *InstitutionUpsert

SetDescription sets the "Description" field.

func (*InstitutionUpsert) SetName

SetName sets the "name" field.

func (*InstitutionUpsert) SetShortName

func (u *InstitutionUpsert) SetShortName(v string) *InstitutionUpsert

SetShortName sets the "short_name" field.

func (*InstitutionUpsert) UpdateDescription

func (u *InstitutionUpsert) UpdateDescription() *InstitutionUpsert

UpdateDescription sets the "Description" field to the value that was provided on create.

func (*InstitutionUpsert) UpdateName

func (u *InstitutionUpsert) UpdateName() *InstitutionUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*InstitutionUpsert) UpdateShortName

func (u *InstitutionUpsert) UpdateShortName() *InstitutionUpsert

UpdateShortName sets the "short_name" field to the value that was provided on create.

type InstitutionUpsertBulk

type InstitutionUpsertBulk struct {
	// contains filtered or unexported fields
}

InstitutionUpsertBulk is the builder for "upsert"-ing a bulk of Institution nodes.

func (*InstitutionUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*InstitutionUpsertBulk) Exec

Exec executes the query.

func (*InstitutionUpsertBulk) ExecX

func (u *InstitutionUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*InstitutionUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Institution.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*InstitutionUpsertBulk) SetDescription

func (u *InstitutionUpsertBulk) SetDescription(v string) *InstitutionUpsertBulk

SetDescription sets the "Description" field.

func (*InstitutionUpsertBulk) SetName

SetName sets the "name" field.

func (*InstitutionUpsertBulk) SetShortName

SetShortName sets the "short_name" field.

func (*InstitutionUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the InstitutionCreateBulk.OnConflict documentation for more info.

func (*InstitutionUpsertBulk) UpdateDescription

func (u *InstitutionUpsertBulk) UpdateDescription() *InstitutionUpsertBulk

UpdateDescription sets the "Description" field to the value that was provided on create.

func (*InstitutionUpsertBulk) UpdateName

UpdateName sets the "name" field to the value that was provided on create.

func (*InstitutionUpsertBulk) UpdateNewValues

func (u *InstitutionUpsertBulk) UpdateNewValues() *InstitutionUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Institution.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*InstitutionUpsertBulk) UpdateShortName

func (u *InstitutionUpsertBulk) UpdateShortName() *InstitutionUpsertBulk

UpdateShortName sets the "short_name" field to the value that was provided on create.

type InstitutionUpsertOne

type InstitutionUpsertOne struct {
	// contains filtered or unexported fields
}

InstitutionUpsertOne is the builder for "upsert"-ing

one Institution node.

func (*InstitutionUpsertOne) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*InstitutionUpsertOne) Exec

Exec executes the query.

func (*InstitutionUpsertOne) ExecX

func (u *InstitutionUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*InstitutionUpsertOne) ID

func (u *InstitutionUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*InstitutionUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*InstitutionUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Institution.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*InstitutionUpsertOne) SetDescription

func (u *InstitutionUpsertOne) SetDescription(v string) *InstitutionUpsertOne

SetDescription sets the "Description" field.

func (*InstitutionUpsertOne) SetName

SetName sets the "name" field.

func (*InstitutionUpsertOne) SetShortName

func (u *InstitutionUpsertOne) SetShortName(v string) *InstitutionUpsertOne

SetShortName sets the "short_name" field.

func (*InstitutionUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the InstitutionCreate.OnConflict documentation for more info.

func (*InstitutionUpsertOne) UpdateDescription

func (u *InstitutionUpsertOne) UpdateDescription() *InstitutionUpsertOne

UpdateDescription sets the "Description" field to the value that was provided on create.

func (*InstitutionUpsertOne) UpdateName

func (u *InstitutionUpsertOne) UpdateName() *InstitutionUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*InstitutionUpsertOne) UpdateNewValues

func (u *InstitutionUpsertOne) UpdateNewValues() *InstitutionUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Institution.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*InstitutionUpsertOne) UpdateShortName

func (u *InstitutionUpsertOne) UpdateShortName() *InstitutionUpsertOne

UpdateShortName sets the "short_name" field to the value that was provided on create.

type Institutions

type Institutions []*Institution

Institutions is a parsable slice of Institution.

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 JWTRevocation

type JWTRevocation struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// ID of the revoked JWT
	Jti string `json:"jti,omitempty"`
	// Expiry of the JWT.
	// The revocation can be deleted after the expiry has passed
	Expiry time.Time `json:"expiry,omitempty"`
	// contains filtered or unexported fields
}

JWTRevocation is the model entity for the JWTRevocation schema.

func (*JWTRevocation) String

func (jr *JWTRevocation) String() string

String implements the fmt.Stringer.

func (*JWTRevocation) Unwrap

func (jr *JWTRevocation) Unwrap() *JWTRevocation

Unwrap unwraps the JWTRevocation 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 (*JWTRevocation) Update

func (jr *JWTRevocation) Update() *JWTRevocationUpdateOne

Update returns a builder for updating this JWTRevocation. Note that you need to call JWTRevocation.Unwrap() before calling this method if this JWTRevocation was returned from a transaction, and the transaction was committed or rolled back.

func (*JWTRevocation) Value

func (jr *JWTRevocation) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the JWTRevocation. This includes values selected through modifiers, order, etc.

type JWTRevocationClient

type JWTRevocationClient struct {
	// contains filtered or unexported fields
}

JWTRevocationClient is a client for the JWTRevocation schema.

func NewJWTRevocationClient

func NewJWTRevocationClient(c config) *JWTRevocationClient

NewJWTRevocationClient returns a client for the JWTRevocation from the given config.

func (*JWTRevocationClient) Create

Create returns a builder for creating a JWTRevocation entity.

func (*JWTRevocationClient) CreateBulk

CreateBulk returns a builder for creating a bulk of JWTRevocation entities.

func (*JWTRevocationClient) Delete

Delete returns a delete builder for JWTRevocation.

func (*JWTRevocationClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*JWTRevocationClient) DeleteOneID

func (c *JWTRevocationClient) DeleteOneID(id int) *JWTRevocationDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*JWTRevocationClient) Get

Get returns a JWTRevocation entity by its id.

func (*JWTRevocationClient) GetX

GetX is like Get, but panics if an error occurs.

func (*JWTRevocationClient) Hooks

func (c *JWTRevocationClient) Hooks() []Hook

Hooks returns the client hooks.

func (*JWTRevocationClient) Intercept

func (c *JWTRevocationClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `jwtrevocation.Intercept(f(g(h())))`.

func (*JWTRevocationClient) Interceptors

func (c *JWTRevocationClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*JWTRevocationClient) Query

Query returns a query builder for JWTRevocation.

func (*JWTRevocationClient) Update

Update returns an update builder for JWTRevocation.

func (*JWTRevocationClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*JWTRevocationClient) UpdateOneID

func (c *JWTRevocationClient) UpdateOneID(id int) *JWTRevocationUpdateOne

UpdateOneID returns an update builder for the given id.

func (*JWTRevocationClient) Use

func (c *JWTRevocationClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `jwtrevocation.Hooks(f(g(h())))`.

type JWTRevocationCreate

type JWTRevocationCreate struct {
	// contains filtered or unexported fields
}

JWTRevocationCreate is the builder for creating a JWTRevocation entity.

func (*JWTRevocationCreate) Exec

func (jrc *JWTRevocationCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*JWTRevocationCreate) ExecX

func (jrc *JWTRevocationCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*JWTRevocationCreate) Mutation

func (jrc *JWTRevocationCreate) Mutation() *JWTRevocationMutation

Mutation returns the JWTRevocationMutation object of the builder.

func (*JWTRevocationCreate) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.JWTRevocation.Create().
	SetJti(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.JWTRevocationUpsert) {
		SetJti(v+v).
	}).
	Exec(ctx)

func (*JWTRevocationCreate) OnConflictColumns

func (jrc *JWTRevocationCreate) OnConflictColumns(columns ...string) *JWTRevocationUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.JWTRevocation.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*JWTRevocationCreate) Save

Save creates the JWTRevocation in the database.

func (*JWTRevocationCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*JWTRevocationCreate) SetExpiry

func (jrc *JWTRevocationCreate) SetExpiry(t time.Time) *JWTRevocationCreate

SetExpiry sets the "expiry" field.

func (*JWTRevocationCreate) SetJti

SetJti sets the "jti" field.

type JWTRevocationCreateBulk

type JWTRevocationCreateBulk struct {
	// contains filtered or unexported fields
}

JWTRevocationCreateBulk is the builder for creating many JWTRevocation entities in bulk.

func (*JWTRevocationCreateBulk) Exec

func (jrcb *JWTRevocationCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*JWTRevocationCreateBulk) ExecX

func (jrcb *JWTRevocationCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*JWTRevocationCreateBulk) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.JWTRevocation.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.JWTRevocationUpsert) {
		SetJti(v+v).
	}).
	Exec(ctx)

func (*JWTRevocationCreateBulk) OnConflictColumns

func (jrcb *JWTRevocationCreateBulk) OnConflictColumns(columns ...string) *JWTRevocationUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.JWTRevocation.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*JWTRevocationCreateBulk) Save

Save creates the JWTRevocation entities in the database.

func (*JWTRevocationCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type JWTRevocationDelete

type JWTRevocationDelete struct {
	// contains filtered or unexported fields
}

JWTRevocationDelete is the builder for deleting a JWTRevocation entity.

func (*JWTRevocationDelete) Exec

func (jrd *JWTRevocationDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*JWTRevocationDelete) ExecX

func (jrd *JWTRevocationDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*JWTRevocationDelete) Where

Where appends a list predicates to the JWTRevocationDelete builder.

type JWTRevocationDeleteOne

type JWTRevocationDeleteOne struct {
	// contains filtered or unexported fields
}

JWTRevocationDeleteOne is the builder for deleting a single JWTRevocation entity.

func (*JWTRevocationDeleteOne) Exec

func (jrdo *JWTRevocationDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*JWTRevocationDeleteOne) ExecX

func (jrdo *JWTRevocationDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*JWTRevocationDeleteOne) Where

Where appends a list predicates to the JWTRevocationDelete builder.

type JWTRevocationGroupBy

type JWTRevocationGroupBy struct {
	// contains filtered or unexported fields
}

JWTRevocationGroupBy is the group-by builder for JWTRevocation entities.

func (*JWTRevocationGroupBy) Aggregate

func (jrgb *JWTRevocationGroupBy) Aggregate(fns ...AggregateFunc) *JWTRevocationGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*JWTRevocationGroupBy) Bool

func (s *JWTRevocationGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*JWTRevocationGroupBy) BoolX

func (s *JWTRevocationGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*JWTRevocationGroupBy) Bools

func (s *JWTRevocationGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*JWTRevocationGroupBy) BoolsX

func (s *JWTRevocationGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*JWTRevocationGroupBy) Float64

func (s *JWTRevocationGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*JWTRevocationGroupBy) Float64X

func (s *JWTRevocationGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*JWTRevocationGroupBy) Float64s

func (s *JWTRevocationGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*JWTRevocationGroupBy) Float64sX

func (s *JWTRevocationGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*JWTRevocationGroupBy) Int

func (s *JWTRevocationGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*JWTRevocationGroupBy) IntX

func (s *JWTRevocationGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*JWTRevocationGroupBy) Ints

func (s *JWTRevocationGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*JWTRevocationGroupBy) IntsX

func (s *JWTRevocationGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*JWTRevocationGroupBy) Scan

func (jrgb *JWTRevocationGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*JWTRevocationGroupBy) ScanX

func (s *JWTRevocationGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*JWTRevocationGroupBy) String

func (s *JWTRevocationGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*JWTRevocationGroupBy) StringX

func (s *JWTRevocationGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*JWTRevocationGroupBy) Strings

func (s *JWTRevocationGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*JWTRevocationGroupBy) StringsX

func (s *JWTRevocationGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type JWTRevocationMutation

type JWTRevocationMutation struct {
	// contains filtered or unexported fields
}

JWTRevocationMutation represents an operation that mutates the JWTRevocation nodes in the graph.

func (*JWTRevocationMutation) AddField

func (m *JWTRevocationMutation) 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 (*JWTRevocationMutation) AddedEdges

func (m *JWTRevocationMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*JWTRevocationMutation) AddedField

func (m *JWTRevocationMutation) 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 (*JWTRevocationMutation) AddedFields

func (m *JWTRevocationMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*JWTRevocationMutation) AddedIDs

func (m *JWTRevocationMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*JWTRevocationMutation) ClearEdge

func (m *JWTRevocationMutation) 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 (*JWTRevocationMutation) ClearField

func (m *JWTRevocationMutation) 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 (*JWTRevocationMutation) ClearedEdges

func (m *JWTRevocationMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*JWTRevocationMutation) ClearedFields

func (m *JWTRevocationMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (JWTRevocationMutation) Client

func (m JWTRevocationMutation) 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 (*JWTRevocationMutation) EdgeCleared

func (m *JWTRevocationMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*JWTRevocationMutation) Expiry

func (m *JWTRevocationMutation) Expiry() (r time.Time, exists bool)

Expiry returns the value of the "expiry" field in the mutation.

func (*JWTRevocationMutation) Field

func (m *JWTRevocationMutation) 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 (*JWTRevocationMutation) FieldCleared

func (m *JWTRevocationMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*JWTRevocationMutation) Fields

func (m *JWTRevocationMutation) 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 (*JWTRevocationMutation) ID

func (m *JWTRevocationMutation) ID() (id int, 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 (*JWTRevocationMutation) IDs

func (m *JWTRevocationMutation) IDs(ctx context.Context) ([]int, 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 (*JWTRevocationMutation) Jti

func (m *JWTRevocationMutation) Jti() (r string, exists bool)

Jti returns the value of the "jti" field in the mutation.

func (*JWTRevocationMutation) OldExpiry

func (m *JWTRevocationMutation) OldExpiry(ctx context.Context) (v time.Time, err error)

OldExpiry returns the old "expiry" field's value of the JWTRevocation entity. If the JWTRevocation 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 (*JWTRevocationMutation) OldField

func (m *JWTRevocationMutation) 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 (*JWTRevocationMutation) OldJti

func (m *JWTRevocationMutation) OldJti(ctx context.Context) (v string, err error)

OldJti returns the old "jti" field's value of the JWTRevocation entity. If the JWTRevocation 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 (*JWTRevocationMutation) Op

func (m *JWTRevocationMutation) Op() Op

Op returns the operation name.

func (*JWTRevocationMutation) RemovedEdges

func (m *JWTRevocationMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*JWTRevocationMutation) RemovedIDs

func (m *JWTRevocationMutation) 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 (*JWTRevocationMutation) ResetEdge

func (m *JWTRevocationMutation) 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 (*JWTRevocationMutation) ResetExpiry

func (m *JWTRevocationMutation) ResetExpiry()

ResetExpiry resets all changes to the "expiry" field.

func (*JWTRevocationMutation) ResetField

func (m *JWTRevocationMutation) 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 (*JWTRevocationMutation) ResetJti

func (m *JWTRevocationMutation) ResetJti()

ResetJti resets all changes to the "jti" field.

func (*JWTRevocationMutation) SetExpiry

func (m *JWTRevocationMutation) SetExpiry(t time.Time)

SetExpiry sets the "expiry" field.

func (*JWTRevocationMutation) SetField

func (m *JWTRevocationMutation) 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 (*JWTRevocationMutation) SetJti

func (m *JWTRevocationMutation) SetJti(s string)

SetJti sets the "jti" field.

func (*JWTRevocationMutation) SetOp

func (m *JWTRevocationMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (JWTRevocationMutation) Tx

func (m JWTRevocationMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*JWTRevocationMutation) Type

func (m *JWTRevocationMutation) Type() string

Type returns the node type of this mutation (JWTRevocation).

func (*JWTRevocationMutation) Where

Where appends a list predicates to the JWTRevocationMutation builder.

func (*JWTRevocationMutation) WhereP

func (m *JWTRevocationMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the JWTRevocationMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type JWTRevocationQuery

type JWTRevocationQuery struct {
	// contains filtered or unexported fields
}

JWTRevocationQuery is the builder for querying JWTRevocation entities.

func (*JWTRevocationQuery) Aggregate

func (jrq *JWTRevocationQuery) Aggregate(fns ...AggregateFunc) *JWTRevocationSelect

Aggregate returns a JWTRevocationSelect configured with the given aggregations.

func (*JWTRevocationQuery) All

All executes the query and returns a list of JWTRevocations.

func (*JWTRevocationQuery) AllX

func (jrq *JWTRevocationQuery) AllX(ctx context.Context) []*JWTRevocation

AllX is like All, but panics if an error occurs.

func (*JWTRevocationQuery) Clone

func (jrq *JWTRevocationQuery) Clone() *JWTRevocationQuery

Clone returns a duplicate of the JWTRevocationQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*JWTRevocationQuery) Count

func (jrq *JWTRevocationQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*JWTRevocationQuery) CountX

func (jrq *JWTRevocationQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*JWTRevocationQuery) Exist

func (jrq *JWTRevocationQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*JWTRevocationQuery) ExistX

func (jrq *JWTRevocationQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*JWTRevocationQuery) First

First returns the first JWTRevocation entity from the query. Returns a *NotFoundError when no JWTRevocation was found.

func (*JWTRevocationQuery) FirstID

func (jrq *JWTRevocationQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first JWTRevocation ID from the query. Returns a *NotFoundError when no JWTRevocation ID was found.

func (*JWTRevocationQuery) FirstIDX

func (jrq *JWTRevocationQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*JWTRevocationQuery) FirstX

func (jrq *JWTRevocationQuery) FirstX(ctx context.Context) *JWTRevocation

FirstX is like First, but panics if an error occurs.

func (*JWTRevocationQuery) GroupBy

func (jrq *JWTRevocationQuery) GroupBy(field string, fields ...string) *JWTRevocationGroupBy

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 {
	Jti string `json:"jti,omitempty"`
	Count int `json:"count,omitempty"`
}

client.JWTRevocation.Query().
	GroupBy(jwtrevocation.FieldJti).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*JWTRevocationQuery) IDs

func (jrq *JWTRevocationQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of JWTRevocation IDs.

func (*JWTRevocationQuery) IDsX

func (jrq *JWTRevocationQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*JWTRevocationQuery) Limit

func (jrq *JWTRevocationQuery) Limit(limit int) *JWTRevocationQuery

Limit the number of records to be returned by this query.

func (*JWTRevocationQuery) Offset

func (jrq *JWTRevocationQuery) Offset(offset int) *JWTRevocationQuery

Offset to start from.

func (*JWTRevocationQuery) Only

Only returns a single JWTRevocation entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one JWTRevocation entity is found. Returns a *NotFoundError when no JWTRevocation entities are found.

func (*JWTRevocationQuery) OnlyID

func (jrq *JWTRevocationQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only JWTRevocation ID in the query. Returns a *NotSingularError when more than one JWTRevocation ID is found. Returns a *NotFoundError when no entities are found.

func (*JWTRevocationQuery) OnlyIDX

func (jrq *JWTRevocationQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*JWTRevocationQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*JWTRevocationQuery) Order

Order specifies how the records should be ordered.

func (*JWTRevocationQuery) Select

func (jrq *JWTRevocationQuery) Select(fields ...string) *JWTRevocationSelect

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 {
	Jti string `json:"jti,omitempty"`
}

client.JWTRevocation.Query().
	Select(jwtrevocation.FieldJti).
	Scan(ctx, &v)

func (*JWTRevocationQuery) Unique

func (jrq *JWTRevocationQuery) Unique(unique bool) *JWTRevocationQuery

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 (*JWTRevocationQuery) Where

Where adds a new predicate for the JWTRevocationQuery builder.

type JWTRevocationSelect

type JWTRevocationSelect struct {
	*JWTRevocationQuery
	// contains filtered or unexported fields
}

JWTRevocationSelect is the builder for selecting fields of JWTRevocation entities.

func (*JWTRevocationSelect) Aggregate

func (jrs *JWTRevocationSelect) Aggregate(fns ...AggregateFunc) *JWTRevocationSelect

Aggregate adds the given aggregation functions to the selector query.

func (*JWTRevocationSelect) Bool

func (s *JWTRevocationSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*JWTRevocationSelect) BoolX

func (s *JWTRevocationSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*JWTRevocationSelect) Bools

func (s *JWTRevocationSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*JWTRevocationSelect) BoolsX

func (s *JWTRevocationSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*JWTRevocationSelect) Float64

func (s *JWTRevocationSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*JWTRevocationSelect) Float64X

func (s *JWTRevocationSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*JWTRevocationSelect) Float64s

func (s *JWTRevocationSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*JWTRevocationSelect) Float64sX

func (s *JWTRevocationSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*JWTRevocationSelect) Int

func (s *JWTRevocationSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*JWTRevocationSelect) IntX

func (s *JWTRevocationSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*JWTRevocationSelect) Ints

func (s *JWTRevocationSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*JWTRevocationSelect) IntsX

func (s *JWTRevocationSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*JWTRevocationSelect) Scan

func (jrs *JWTRevocationSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*JWTRevocationSelect) ScanX

func (s *JWTRevocationSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*JWTRevocationSelect) String

func (s *JWTRevocationSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*JWTRevocationSelect) StringX

func (s *JWTRevocationSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*JWTRevocationSelect) Strings

func (s *JWTRevocationSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*JWTRevocationSelect) StringsX

func (s *JWTRevocationSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type JWTRevocationUpdate

type JWTRevocationUpdate struct {
	// contains filtered or unexported fields
}

JWTRevocationUpdate is the builder for updating JWTRevocation entities.

func (*JWTRevocationUpdate) Exec

func (jru *JWTRevocationUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*JWTRevocationUpdate) ExecX

func (jru *JWTRevocationUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*JWTRevocationUpdate) Mutation

func (jru *JWTRevocationUpdate) Mutation() *JWTRevocationMutation

Mutation returns the JWTRevocationMutation object of the builder.

func (*JWTRevocationUpdate) Save

func (jru *JWTRevocationUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*JWTRevocationUpdate) SaveX

func (jru *JWTRevocationUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*JWTRevocationUpdate) Where

Where appends a list predicates to the JWTRevocationUpdate builder.

type JWTRevocationUpdateOne

type JWTRevocationUpdateOne struct {
	// contains filtered or unexported fields
}

JWTRevocationUpdateOne is the builder for updating a single JWTRevocation entity.

func (*JWTRevocationUpdateOne) Exec

func (jruo *JWTRevocationUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*JWTRevocationUpdateOne) ExecX

func (jruo *JWTRevocationUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*JWTRevocationUpdateOne) Mutation

Mutation returns the JWTRevocationMutation object of the builder.

func (*JWTRevocationUpdateOne) Save

Save executes the query and returns the updated JWTRevocation entity.

func (*JWTRevocationUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*JWTRevocationUpdateOne) Select

func (jruo *JWTRevocationUpdateOne) Select(field string, fields ...string) *JWTRevocationUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*JWTRevocationUpdateOne) Where

Where appends a list predicates to the JWTRevocationUpdate builder.

type JWTRevocationUpsert

type JWTRevocationUpsert struct {
	*sql.UpdateSet
}

JWTRevocationUpsert is the "OnConflict" setter.

type JWTRevocationUpsertBulk

type JWTRevocationUpsertBulk struct {
	// contains filtered or unexported fields
}

JWTRevocationUpsertBulk is the builder for "upsert"-ing a bulk of JWTRevocation nodes.

func (*JWTRevocationUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*JWTRevocationUpsertBulk) Exec

Exec executes the query.

func (*JWTRevocationUpsertBulk) ExecX

func (u *JWTRevocationUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*JWTRevocationUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.JWTRevocation.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*JWTRevocationUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the JWTRevocationCreateBulk.OnConflict documentation for more info.

func (*JWTRevocationUpsertBulk) UpdateNewValues

func (u *JWTRevocationUpsertBulk) UpdateNewValues() *JWTRevocationUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.JWTRevocation.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

type JWTRevocationUpsertOne

type JWTRevocationUpsertOne struct {
	// contains filtered or unexported fields
}

JWTRevocationUpsertOne is the builder for "upsert"-ing

one JWTRevocation node.

func (*JWTRevocationUpsertOne) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*JWTRevocationUpsertOne) Exec

Exec executes the query.

func (*JWTRevocationUpsertOne) ExecX

func (u *JWTRevocationUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*JWTRevocationUpsertOne) ID

func (u *JWTRevocationUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*JWTRevocationUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*JWTRevocationUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.JWTRevocation.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*JWTRevocationUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the JWTRevocationCreate.OnConflict documentation for more info.

func (*JWTRevocationUpsertOne) UpdateNewValues

func (u *JWTRevocationUpsertOne) UpdateNewValues() *JWTRevocationUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.JWTRevocation.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

type JWTRevocations

type JWTRevocations []*JWTRevocation

JWTRevocations is a parsable slice of JWTRevocation.

type Milestone

type Milestone struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name of the milestone
	Name string `json:"name,omitempty"`
	// Time when the milestone is should be completed
	TargetCompletionTime time.Time `json:"target_completion_time,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MilestoneQuery when eager-loading is set.
	Edges MilestoneEdges `json:"edges"`
	// contains filtered or unexported fields
}

Milestone is the model entity for the Milestone schema.

func (*Milestone) QueryStudyPlan

func (m *Milestone) QueryStudyPlan() *StudyPlanQuery

QueryStudyPlan queries the "study_plan" edge of the Milestone entity.

func (*Milestone) String

func (m *Milestone) String() string

String implements the fmt.Stringer.

func (*Milestone) Unwrap

func (m *Milestone) Unwrap() *Milestone

Unwrap unwraps the Milestone 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 (*Milestone) Update

func (m *Milestone) Update() *MilestoneUpdateOne

Update returns a builder for updating this Milestone. Note that you need to call Milestone.Unwrap() before calling this method if this Milestone was returned from a transaction, and the transaction was committed or rolled back.

func (*Milestone) Value

func (m *Milestone) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Milestone. This includes values selected through modifiers, order, etc.

type MilestoneClient

type MilestoneClient struct {
	// contains filtered or unexported fields
}

MilestoneClient is a client for the Milestone schema.

func NewMilestoneClient

func NewMilestoneClient(c config) *MilestoneClient

NewMilestoneClient returns a client for the Milestone from the given config.

func (*MilestoneClient) Create

func (c *MilestoneClient) Create() *MilestoneCreate

Create returns a builder for creating a Milestone entity.

func (*MilestoneClient) CreateBulk

func (c *MilestoneClient) CreateBulk(builders ...*MilestoneCreate) *MilestoneCreateBulk

CreateBulk returns a builder for creating a bulk of Milestone entities.

func (*MilestoneClient) Delete

func (c *MilestoneClient) Delete() *MilestoneDelete

Delete returns a delete builder for Milestone.

func (*MilestoneClient) DeleteOne

func (c *MilestoneClient) DeleteOne(m *Milestone) *MilestoneDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MilestoneClient) DeleteOneID

func (c *MilestoneClient) DeleteOneID(id int) *MilestoneDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*MilestoneClient) Get

func (c *MilestoneClient) Get(ctx context.Context, id int) (*Milestone, error)

Get returns a Milestone entity by its id.

func (*MilestoneClient) GetX

func (c *MilestoneClient) GetX(ctx context.Context, id int) *Milestone

GetX is like Get, but panics if an error occurs.

func (*MilestoneClient) Hooks

func (c *MilestoneClient) Hooks() []Hook

Hooks returns the client hooks.

func (*MilestoneClient) Intercept

func (c *MilestoneClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `milestone.Intercept(f(g(h())))`.

func (*MilestoneClient) Interceptors

func (c *MilestoneClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*MilestoneClient) Query

func (c *MilestoneClient) Query() *MilestoneQuery

Query returns a query builder for Milestone.

func (*MilestoneClient) QueryStudyPlan

func (c *MilestoneClient) QueryStudyPlan(m *Milestone) *StudyPlanQuery

QueryStudyPlan queries the study_plan edge of a Milestone.

func (*MilestoneClient) Update

func (c *MilestoneClient) Update() *MilestoneUpdate

Update returns an update builder for Milestone.

func (*MilestoneClient) UpdateOne

func (c *MilestoneClient) UpdateOne(m *Milestone) *MilestoneUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MilestoneClient) UpdateOneID

func (c *MilestoneClient) UpdateOneID(id int) *MilestoneUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MilestoneClient) Use

func (c *MilestoneClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `milestone.Hooks(f(g(h())))`.

type MilestoneCreate

type MilestoneCreate struct {
	// contains filtered or unexported fields
}

MilestoneCreate is the builder for creating a Milestone entity.

func (*MilestoneCreate) Exec

func (mc *MilestoneCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MilestoneCreate) ExecX

func (mc *MilestoneCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MilestoneCreate) Mutation

func (mc *MilestoneCreate) Mutation() *MilestoneMutation

Mutation returns the MilestoneMutation object of the builder.

func (*MilestoneCreate) OnConflict

func (mc *MilestoneCreate) OnConflict(opts ...sql.ConflictOption) *MilestoneUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Milestone.Create().
	SetName(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.MilestoneUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*MilestoneCreate) OnConflictColumns

func (mc *MilestoneCreate) OnConflictColumns(columns ...string) *MilestoneUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Milestone.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*MilestoneCreate) Save

func (mc *MilestoneCreate) Save(ctx context.Context) (*Milestone, error)

Save creates the Milestone in the database.

func (*MilestoneCreate) SaveX

func (mc *MilestoneCreate) SaveX(ctx context.Context) *Milestone

SaveX calls Save and panics if Save returns an error.

func (*MilestoneCreate) SetName

func (mc *MilestoneCreate) SetName(s string) *MilestoneCreate

SetName sets the "name" field.

func (*MilestoneCreate) SetStudyPlan

func (mc *MilestoneCreate) SetStudyPlan(s *StudyPlan) *MilestoneCreate

SetStudyPlan sets the "study_plan" edge to the StudyPlan entity.

func (*MilestoneCreate) SetStudyPlanID

func (mc *MilestoneCreate) SetStudyPlanID(id int) *MilestoneCreate

SetStudyPlanID sets the "study_plan" edge to the StudyPlan entity by ID.

func (*MilestoneCreate) SetTargetCompletionTime

func (mc *MilestoneCreate) SetTargetCompletionTime(t time.Time) *MilestoneCreate

SetTargetCompletionTime sets the "target_completion_time" field.

type MilestoneCreateBulk

type MilestoneCreateBulk struct {
	// contains filtered or unexported fields
}

MilestoneCreateBulk is the builder for creating many Milestone entities in bulk.

func (*MilestoneCreateBulk) Exec

func (mcb *MilestoneCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MilestoneCreateBulk) ExecX

func (mcb *MilestoneCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MilestoneCreateBulk) OnConflict

func (mcb *MilestoneCreateBulk) OnConflict(opts ...sql.ConflictOption) *MilestoneUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Milestone.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.MilestoneUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*MilestoneCreateBulk) OnConflictColumns

func (mcb *MilestoneCreateBulk) OnConflictColumns(columns ...string) *MilestoneUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Milestone.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*MilestoneCreateBulk) Save

func (mcb *MilestoneCreateBulk) Save(ctx context.Context) ([]*Milestone, error)

Save creates the Milestone entities in the database.

func (*MilestoneCreateBulk) SaveX

func (mcb *MilestoneCreateBulk) SaveX(ctx context.Context) []*Milestone

SaveX is like Save, but panics if an error occurs.

type MilestoneDelete

type MilestoneDelete struct {
	// contains filtered or unexported fields
}

MilestoneDelete is the builder for deleting a Milestone entity.

func (*MilestoneDelete) Exec

func (md *MilestoneDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*MilestoneDelete) ExecX

func (md *MilestoneDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*MilestoneDelete) Where

Where appends a list predicates to the MilestoneDelete builder.

type MilestoneDeleteOne

type MilestoneDeleteOne struct {
	// contains filtered or unexported fields
}

MilestoneDeleteOne is the builder for deleting a single Milestone entity.

func (*MilestoneDeleteOne) Exec

func (mdo *MilestoneDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MilestoneDeleteOne) ExecX

func (mdo *MilestoneDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MilestoneDeleteOne) Where

Where appends a list predicates to the MilestoneDelete builder.

type MilestoneEdges

type MilestoneEdges struct {
	// StudyPlan holds the value of the study_plan edge.
	StudyPlan *StudyPlan `json:"study_plan,omitempty"`
	// contains filtered or unexported fields
}

MilestoneEdges holds the relations/edges for other nodes in the graph.

func (MilestoneEdges) StudyPlanOrErr

func (e MilestoneEdges) StudyPlanOrErr() (*StudyPlan, error)

StudyPlanOrErr returns the StudyPlan value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type MilestoneGroupBy

type MilestoneGroupBy struct {
	// contains filtered or unexported fields
}

MilestoneGroupBy is the group-by builder for Milestone entities.

func (*MilestoneGroupBy) Aggregate

func (mgb *MilestoneGroupBy) Aggregate(fns ...AggregateFunc) *MilestoneGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*MilestoneGroupBy) Bool

func (s *MilestoneGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MilestoneGroupBy) BoolX

func (s *MilestoneGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MilestoneGroupBy) Bools

func (s *MilestoneGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MilestoneGroupBy) BoolsX

func (s *MilestoneGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MilestoneGroupBy) Float64

func (s *MilestoneGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MilestoneGroupBy) Float64X

func (s *MilestoneGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MilestoneGroupBy) Float64s

func (s *MilestoneGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MilestoneGroupBy) Float64sX

func (s *MilestoneGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MilestoneGroupBy) Int

func (s *MilestoneGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MilestoneGroupBy) IntX

func (s *MilestoneGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MilestoneGroupBy) Ints

func (s *MilestoneGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MilestoneGroupBy) IntsX

func (s *MilestoneGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MilestoneGroupBy) Scan

func (mgb *MilestoneGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MilestoneGroupBy) ScanX

func (s *MilestoneGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MilestoneGroupBy) String

func (s *MilestoneGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MilestoneGroupBy) StringX

func (s *MilestoneGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MilestoneGroupBy) Strings

func (s *MilestoneGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MilestoneGroupBy) StringsX

func (s *MilestoneGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MilestoneMutation

type MilestoneMutation struct {
	// contains filtered or unexported fields
}

MilestoneMutation represents an operation that mutates the Milestone nodes in the graph.

func (*MilestoneMutation) AddField

func (m *MilestoneMutation) 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 (*MilestoneMutation) AddedEdges

func (m *MilestoneMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*MilestoneMutation) AddedField

func (m *MilestoneMutation) 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 (*MilestoneMutation) AddedFields

func (m *MilestoneMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*MilestoneMutation) AddedIDs

func (m *MilestoneMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*MilestoneMutation) ClearEdge

func (m *MilestoneMutation) 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 (*MilestoneMutation) ClearField

func (m *MilestoneMutation) 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 (*MilestoneMutation) ClearStudyPlan

func (m *MilestoneMutation) ClearStudyPlan()

ClearStudyPlan clears the "study_plan" edge to the StudyPlan entity.

func (*MilestoneMutation) ClearedEdges

func (m *MilestoneMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*MilestoneMutation) ClearedFields

func (m *MilestoneMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (MilestoneMutation) Client

func (m MilestoneMutation) 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 (*MilestoneMutation) EdgeCleared

func (m *MilestoneMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*MilestoneMutation) Field

func (m *MilestoneMutation) 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 (*MilestoneMutation) FieldCleared

func (m *MilestoneMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*MilestoneMutation) Fields

func (m *MilestoneMutation) 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 (*MilestoneMutation) ID

func (m *MilestoneMutation) ID() (id int, 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 (*MilestoneMutation) IDs

func (m *MilestoneMutation) IDs(ctx context.Context) ([]int, 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 (*MilestoneMutation) Name

func (m *MilestoneMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*MilestoneMutation) OldField

func (m *MilestoneMutation) 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 (*MilestoneMutation) OldName

func (m *MilestoneMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Milestone entity. If the Milestone 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 (*MilestoneMutation) OldTargetCompletionTime

func (m *MilestoneMutation) OldTargetCompletionTime(ctx context.Context) (v time.Time, err error)

OldTargetCompletionTime returns the old "target_completion_time" field's value of the Milestone entity. If the Milestone 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 (*MilestoneMutation) Op

func (m *MilestoneMutation) Op() Op

Op returns the operation name.

func (*MilestoneMutation) RemovedEdges

func (m *MilestoneMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*MilestoneMutation) RemovedIDs

func (m *MilestoneMutation) 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 (*MilestoneMutation) ResetEdge

func (m *MilestoneMutation) 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 (*MilestoneMutation) ResetField

func (m *MilestoneMutation) 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 (*MilestoneMutation) ResetName

func (m *MilestoneMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*MilestoneMutation) ResetStudyPlan

func (m *MilestoneMutation) ResetStudyPlan()

ResetStudyPlan resets all changes to the "study_plan" edge.

func (*MilestoneMutation) ResetTargetCompletionTime

func (m *MilestoneMutation) ResetTargetCompletionTime()

ResetTargetCompletionTime resets all changes to the "target_completion_time" field.

func (*MilestoneMutation) SetField

func (m *MilestoneMutation) 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 (*MilestoneMutation) SetName

func (m *MilestoneMutation) SetName(s string)

SetName sets the "name" field.

func (*MilestoneMutation) SetOp

func (m *MilestoneMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*MilestoneMutation) SetStudyPlanID

func (m *MilestoneMutation) SetStudyPlanID(id int)

SetStudyPlanID sets the "study_plan" edge to the StudyPlan entity by id.

func (*MilestoneMutation) SetTargetCompletionTime

func (m *MilestoneMutation) SetTargetCompletionTime(t time.Time)

SetTargetCompletionTime sets the "target_completion_time" field.

func (*MilestoneMutation) StudyPlanCleared

func (m *MilestoneMutation) StudyPlanCleared() bool

StudyPlanCleared reports if the "study_plan" edge to the StudyPlan entity was cleared.

func (*MilestoneMutation) StudyPlanID

func (m *MilestoneMutation) StudyPlanID() (id int, exists bool)

StudyPlanID returns the "study_plan" edge ID in the mutation.

func (*MilestoneMutation) StudyPlanIDs

func (m *MilestoneMutation) StudyPlanIDs() (ids []int)

StudyPlanIDs returns the "study_plan" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use StudyPlanID instead. It exists only for internal usage by the builders.

func (*MilestoneMutation) TargetCompletionTime

func (m *MilestoneMutation) TargetCompletionTime() (r time.Time, exists bool)

TargetCompletionTime returns the value of the "target_completion_time" field in the mutation.

func (MilestoneMutation) Tx

func (m MilestoneMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*MilestoneMutation) Type

func (m *MilestoneMutation) Type() string

Type returns the node type of this mutation (Milestone).

func (*MilestoneMutation) Where

func (m *MilestoneMutation) Where(ps ...predicate.Milestone)

Where appends a list predicates to the MilestoneMutation builder.

func (*MilestoneMutation) WhereP

func (m *MilestoneMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the MilestoneMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type MilestoneQuery

type MilestoneQuery struct {
	// contains filtered or unexported fields
}

MilestoneQuery is the builder for querying Milestone entities.

func (*MilestoneQuery) Aggregate

func (mq *MilestoneQuery) Aggregate(fns ...AggregateFunc) *MilestoneSelect

Aggregate returns a MilestoneSelect configured with the given aggregations.

func (*MilestoneQuery) All

func (mq *MilestoneQuery) All(ctx context.Context) ([]*Milestone, error)

All executes the query and returns a list of Milestones.

func (*MilestoneQuery) AllX

func (mq *MilestoneQuery) AllX(ctx context.Context) []*Milestone

AllX is like All, but panics if an error occurs.

func (*MilestoneQuery) Clone

func (mq *MilestoneQuery) Clone() *MilestoneQuery

Clone returns a duplicate of the MilestoneQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*MilestoneQuery) Count

func (mq *MilestoneQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MilestoneQuery) CountX

func (mq *MilestoneQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*MilestoneQuery) Exist

func (mq *MilestoneQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*MilestoneQuery) ExistX

func (mq *MilestoneQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*MilestoneQuery) First

func (mq *MilestoneQuery) First(ctx context.Context) (*Milestone, error)

First returns the first Milestone entity from the query. Returns a *NotFoundError when no Milestone was found.

func (*MilestoneQuery) FirstID

func (mq *MilestoneQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Milestone ID from the query. Returns a *NotFoundError when no Milestone ID was found.

func (*MilestoneQuery) FirstIDX

func (mq *MilestoneQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*MilestoneQuery) FirstX

func (mq *MilestoneQuery) FirstX(ctx context.Context) *Milestone

FirstX is like First, but panics if an error occurs.

func (*MilestoneQuery) GroupBy

func (mq *MilestoneQuery) GroupBy(field string, fields ...string) *MilestoneGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Milestone.Query().
	GroupBy(milestone.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MilestoneQuery) IDs

func (mq *MilestoneQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Milestone IDs.

func (*MilestoneQuery) IDsX

func (mq *MilestoneQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*MilestoneQuery) Limit

func (mq *MilestoneQuery) Limit(limit int) *MilestoneQuery

Limit the number of records to be returned by this query.

func (*MilestoneQuery) Offset

func (mq *MilestoneQuery) Offset(offset int) *MilestoneQuery

Offset to start from.

func (*MilestoneQuery) Only

func (mq *MilestoneQuery) Only(ctx context.Context) (*Milestone, error)

Only returns a single Milestone entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Milestone entity is found. Returns a *NotFoundError when no Milestone entities are found.

func (*MilestoneQuery) OnlyID

func (mq *MilestoneQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Milestone ID in the query. Returns a *NotSingularError when more than one Milestone ID is found. Returns a *NotFoundError when no entities are found.

func (*MilestoneQuery) OnlyIDX

func (mq *MilestoneQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*MilestoneQuery) OnlyX

func (mq *MilestoneQuery) OnlyX(ctx context.Context) *Milestone

OnlyX is like Only, but panics if an error occurs.

func (*MilestoneQuery) Order

Order specifies how the records should be ordered.

func (*MilestoneQuery) QueryStudyPlan

func (mq *MilestoneQuery) QueryStudyPlan() *StudyPlanQuery

QueryStudyPlan chains the current query on the "study_plan" edge.

func (*MilestoneQuery) Select

func (mq *MilestoneQuery) Select(fields ...string) *MilestoneSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.Milestone.Query().
	Select(milestone.FieldName).
	Scan(ctx, &v)

func (*MilestoneQuery) Unique

func (mq *MilestoneQuery) Unique(unique bool) *MilestoneQuery

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 (*MilestoneQuery) Where

Where adds a new predicate for the MilestoneQuery builder.

func (*MilestoneQuery) WithStudyPlan

func (mq *MilestoneQuery) WithStudyPlan(opts ...func(*StudyPlanQuery)) *MilestoneQuery

WithStudyPlan tells the query-builder to eager-load the nodes that are connected to the "study_plan" edge. The optional arguments are used to configure the query builder of the edge.

type MilestoneSelect

type MilestoneSelect struct {
	*MilestoneQuery
	// contains filtered or unexported fields
}

MilestoneSelect is the builder for selecting fields of Milestone entities.

func (*MilestoneSelect) Aggregate

func (ms *MilestoneSelect) Aggregate(fns ...AggregateFunc) *MilestoneSelect

Aggregate adds the given aggregation functions to the selector query.

func (*MilestoneSelect) Bool

func (s *MilestoneSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MilestoneSelect) BoolX

func (s *MilestoneSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MilestoneSelect) Bools

func (s *MilestoneSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MilestoneSelect) BoolsX

func (s *MilestoneSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MilestoneSelect) Float64

func (s *MilestoneSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MilestoneSelect) Float64X

func (s *MilestoneSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MilestoneSelect) Float64s

func (s *MilestoneSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MilestoneSelect) Float64sX

func (s *MilestoneSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MilestoneSelect) Int

func (s *MilestoneSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MilestoneSelect) IntX

func (s *MilestoneSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MilestoneSelect) Ints

func (s *MilestoneSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MilestoneSelect) IntsX

func (s *MilestoneSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MilestoneSelect) Scan

func (ms *MilestoneSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MilestoneSelect) ScanX

func (s *MilestoneSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MilestoneSelect) String

func (s *MilestoneSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MilestoneSelect) StringX

func (s *MilestoneSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MilestoneSelect) Strings

func (s *MilestoneSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MilestoneSelect) StringsX

func (s *MilestoneSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MilestoneUpdate

type MilestoneUpdate struct {
	// contains filtered or unexported fields
}

MilestoneUpdate is the builder for updating Milestone entities.

func (*MilestoneUpdate) ClearStudyPlan

func (mu *MilestoneUpdate) ClearStudyPlan() *MilestoneUpdate

ClearStudyPlan clears the "study_plan" edge to the StudyPlan entity.

func (*MilestoneUpdate) Exec

func (mu *MilestoneUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MilestoneUpdate) ExecX

func (mu *MilestoneUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MilestoneUpdate) Mutation

func (mu *MilestoneUpdate) Mutation() *MilestoneMutation

Mutation returns the MilestoneMutation object of the builder.

func (*MilestoneUpdate) Save

func (mu *MilestoneUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*MilestoneUpdate) SaveX

func (mu *MilestoneUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*MilestoneUpdate) SetName

func (mu *MilestoneUpdate) SetName(s string) *MilestoneUpdate

SetName sets the "name" field.

func (*MilestoneUpdate) SetStudyPlan

func (mu *MilestoneUpdate) SetStudyPlan(s *StudyPlan) *MilestoneUpdate

SetStudyPlan sets the "study_plan" edge to the StudyPlan entity.

func (*MilestoneUpdate) SetStudyPlanID

func (mu *MilestoneUpdate) SetStudyPlanID(id int) *MilestoneUpdate

SetStudyPlanID sets the "study_plan" edge to the StudyPlan entity by ID.

func (*MilestoneUpdate) SetTargetCompletionTime

func (mu *MilestoneUpdate) SetTargetCompletionTime(t time.Time) *MilestoneUpdate

SetTargetCompletionTime sets the "target_completion_time" field.

func (*MilestoneUpdate) Where

Where appends a list predicates to the MilestoneUpdate builder.

type MilestoneUpdateOne

type MilestoneUpdateOne struct {
	// contains filtered or unexported fields
}

MilestoneUpdateOne is the builder for updating a single Milestone entity.

func (*MilestoneUpdateOne) ClearStudyPlan

func (muo *MilestoneUpdateOne) ClearStudyPlan() *MilestoneUpdateOne

ClearStudyPlan clears the "study_plan" edge to the StudyPlan entity.

func (*MilestoneUpdateOne) Exec

func (muo *MilestoneUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MilestoneUpdateOne) ExecX

func (muo *MilestoneUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MilestoneUpdateOne) Mutation

func (muo *MilestoneUpdateOne) Mutation() *MilestoneMutation

Mutation returns the MilestoneMutation object of the builder.

func (*MilestoneUpdateOne) Save

func (muo *MilestoneUpdateOne) Save(ctx context.Context) (*Milestone, error)

Save executes the query and returns the updated Milestone entity.

func (*MilestoneUpdateOne) SaveX

func (muo *MilestoneUpdateOne) SaveX(ctx context.Context) *Milestone

SaveX is like Save, but panics if an error occurs.

func (*MilestoneUpdateOne) Select

func (muo *MilestoneUpdateOne) Select(field string, fields ...string) *MilestoneUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*MilestoneUpdateOne) SetName

func (muo *MilestoneUpdateOne) SetName(s string) *MilestoneUpdateOne

SetName sets the "name" field.

func (*MilestoneUpdateOne) SetStudyPlan

func (muo *MilestoneUpdateOne) SetStudyPlan(s *StudyPlan) *MilestoneUpdateOne

SetStudyPlan sets the "study_plan" edge to the StudyPlan entity.

func (*MilestoneUpdateOne) SetStudyPlanID

func (muo *MilestoneUpdateOne) SetStudyPlanID(id int) *MilestoneUpdateOne

SetStudyPlanID sets the "study_plan" edge to the StudyPlan entity by ID.

func (*MilestoneUpdateOne) SetTargetCompletionTime

func (muo *MilestoneUpdateOne) SetTargetCompletionTime(t time.Time) *MilestoneUpdateOne

SetTargetCompletionTime sets the "target_completion_time" field.

func (*MilestoneUpdateOne) Where

Where appends a list predicates to the MilestoneUpdate builder.

type MilestoneUpsert

type MilestoneUpsert struct {
	*sql.UpdateSet
}

MilestoneUpsert is the "OnConflict" setter.

func (*MilestoneUpsert) SetName

func (u *MilestoneUpsert) SetName(v string) *MilestoneUpsert

SetName sets the "name" field.

func (*MilestoneUpsert) SetTargetCompletionTime

func (u *MilestoneUpsert) SetTargetCompletionTime(v time.Time) *MilestoneUpsert

SetTargetCompletionTime sets the "target_completion_time" field.

func (*MilestoneUpsert) UpdateName

func (u *MilestoneUpsert) UpdateName() *MilestoneUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*MilestoneUpsert) UpdateTargetCompletionTime

func (u *MilestoneUpsert) UpdateTargetCompletionTime() *MilestoneUpsert

UpdateTargetCompletionTime sets the "target_completion_time" field to the value that was provided on create.

type MilestoneUpsertBulk

type MilestoneUpsertBulk struct {
	// contains filtered or unexported fields
}

MilestoneUpsertBulk is the builder for "upsert"-ing a bulk of Milestone nodes.

func (*MilestoneUpsertBulk) DoNothing

func (u *MilestoneUpsertBulk) DoNothing() *MilestoneUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*MilestoneUpsertBulk) Exec

Exec executes the query.

func (*MilestoneUpsertBulk) ExecX

func (u *MilestoneUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MilestoneUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Milestone.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*MilestoneUpsertBulk) SetName

SetName sets the "name" field.

func (*MilestoneUpsertBulk) SetTargetCompletionTime

func (u *MilestoneUpsertBulk) SetTargetCompletionTime(v time.Time) *MilestoneUpsertBulk

SetTargetCompletionTime sets the "target_completion_time" field.

func (*MilestoneUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the MilestoneCreateBulk.OnConflict documentation for more info.

func (*MilestoneUpsertBulk) UpdateName

func (u *MilestoneUpsertBulk) UpdateName() *MilestoneUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*MilestoneUpsertBulk) UpdateNewValues

func (u *MilestoneUpsertBulk) UpdateNewValues() *MilestoneUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Milestone.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*MilestoneUpsertBulk) UpdateTargetCompletionTime

func (u *MilestoneUpsertBulk) UpdateTargetCompletionTime() *MilestoneUpsertBulk

UpdateTargetCompletionTime sets the "target_completion_time" field to the value that was provided on create.

type MilestoneUpsertOne

type MilestoneUpsertOne struct {
	// contains filtered or unexported fields
}

MilestoneUpsertOne is the builder for "upsert"-ing

one Milestone node.

func (*MilestoneUpsertOne) DoNothing

func (u *MilestoneUpsertOne) DoNothing() *MilestoneUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*MilestoneUpsertOne) Exec

func (u *MilestoneUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*MilestoneUpsertOne) ExecX

func (u *MilestoneUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MilestoneUpsertOne) ID

func (u *MilestoneUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*MilestoneUpsertOne) IDX

func (u *MilestoneUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*MilestoneUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Milestone.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*MilestoneUpsertOne) SetName

SetName sets the "name" field.

func (*MilestoneUpsertOne) SetTargetCompletionTime

func (u *MilestoneUpsertOne) SetTargetCompletionTime(v time.Time) *MilestoneUpsertOne

SetTargetCompletionTime sets the "target_completion_time" field.

func (*MilestoneUpsertOne) Update

func (u *MilestoneUpsertOne) Update(set func(*MilestoneUpsert)) *MilestoneUpsertOne

Update allows overriding fields `UPDATE` values. See the MilestoneCreate.OnConflict documentation for more info.

func (*MilestoneUpsertOne) UpdateName

func (u *MilestoneUpsertOne) UpdateName() *MilestoneUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*MilestoneUpsertOne) UpdateNewValues

func (u *MilestoneUpsertOne) UpdateNewValues() *MilestoneUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Milestone.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*MilestoneUpsertOne) UpdateTargetCompletionTime

func (u *MilestoneUpsertOne) UpdateTargetCompletionTime() *MilestoneUpsertOne

UpdateTargetCompletionTime sets the "target_completion_time" field to the value that was provided on create.

type Milestones

type Milestones []*Milestone

Milestones is a parsable slice of Milestone.

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 Pet

type Pet struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name of the pet
	Name string `json:"name,omitempty"`
	// SVG of the pet
	SvgRaw string `json:"svg_raw,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PetQuery when eager-loading is set.
	Edges PetEdges `json:"edges"`
	// contains filtered or unexported fields
}

Pet is the model entity for the Pet schema.

func (*Pet) QueryOwner

func (pe *Pet) QueryOwner() *UserQuery

QueryOwner queries the "owner" edge of the Pet entity.

func (*Pet) QueryUserPets

func (pe *Pet) QueryUserPets() *UserPetQuery

QueryUserPets queries the "user_pets" edge of the Pet entity.

func (*Pet) String

func (pe *Pet) String() string

String implements the fmt.Stringer.

func (*Pet) Unwrap

func (pe *Pet) Unwrap() *Pet

Unwrap unwraps the Pet 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 (*Pet) Update

func (pe *Pet) Update() *PetUpdateOne

Update returns a builder for updating this Pet. Note that you need to call Pet.Unwrap() before calling this method if this Pet was returned from a transaction, and the transaction was committed or rolled back.

func (*Pet) Value

func (pe *Pet) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Pet. This includes values selected through modifiers, order, etc.

type PetClient

type PetClient struct {
	// contains filtered or unexported fields
}

PetClient is a client for the Pet schema.

func NewPetClient

func NewPetClient(c config) *PetClient

NewPetClient returns a client for the Pet from the given config.

func (*PetClient) Create

func (c *PetClient) Create() *PetCreate

Create returns a builder for creating a Pet entity.

func (*PetClient) CreateBulk

func (c *PetClient) CreateBulk(builders ...*PetCreate) *PetCreateBulk

CreateBulk returns a builder for creating a bulk of Pet entities.

func (*PetClient) Delete

func (c *PetClient) Delete() *PetDelete

Delete returns a delete builder for Pet.

func (*PetClient) DeleteOne

func (c *PetClient) DeleteOne(pe *Pet) *PetDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PetClient) DeleteOneID

func (c *PetClient) DeleteOneID(id int) *PetDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*PetClient) Get

func (c *PetClient) Get(ctx context.Context, id int) (*Pet, error)

Get returns a Pet entity by its id.

func (*PetClient) GetX

func (c *PetClient) GetX(ctx context.Context, id int) *Pet

GetX is like Get, but panics if an error occurs.

func (*PetClient) Hooks

func (c *PetClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PetClient) Intercept

func (c *PetClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `pet.Intercept(f(g(h())))`.

func (*PetClient) Interceptors

func (c *PetClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PetClient) Query

func (c *PetClient) Query() *PetQuery

Query returns a query builder for Pet.

func (*PetClient) QueryOwner

func (c *PetClient) QueryOwner(pe *Pet) *UserQuery

QueryOwner queries the owner edge of a Pet.

func (*PetClient) QueryUserPets

func (c *PetClient) QueryUserPets(pe *Pet) *UserPetQuery

QueryUserPets queries the user_pets edge of a Pet.

func (*PetClient) Update

func (c *PetClient) Update() *PetUpdate

Update returns an update builder for Pet.

func (*PetClient) UpdateOne

func (c *PetClient) UpdateOne(pe *Pet) *PetUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PetClient) UpdateOneID

func (c *PetClient) UpdateOneID(id int) *PetUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PetClient) Use

func (c *PetClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `pet.Hooks(f(g(h())))`.

type PetCreate

type PetCreate struct {
	// contains filtered or unexported fields
}

PetCreate is the builder for creating a Pet entity.

func (*PetCreate) AddOwner

func (pc *PetCreate) AddOwner(u ...*User) *PetCreate

AddOwner adds the "owner" edges to the User entity.

func (*PetCreate) AddOwnerIDs

func (pc *PetCreate) AddOwnerIDs(ids ...int) *PetCreate

AddOwnerIDs adds the "owner" edge to the User entity by IDs.

func (*PetCreate) Exec

func (pc *PetCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PetCreate) ExecX

func (pc *PetCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PetCreate) Mutation

func (pc *PetCreate) Mutation() *PetMutation

Mutation returns the PetMutation object of the builder.

func (*PetCreate) OnConflict

func (pc *PetCreate) OnConflict(opts ...sql.ConflictOption) *PetUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Pet.Create().
	SetName(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.PetUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*PetCreate) OnConflictColumns

func (pc *PetCreate) OnConflictColumns(columns ...string) *PetUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Pet.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*PetCreate) Save

func (pc *PetCreate) Save(ctx context.Context) (*Pet, error)

Save creates the Pet in the database.

func (*PetCreate) SaveX

func (pc *PetCreate) SaveX(ctx context.Context) *Pet

SaveX calls Save and panics if Save returns an error.

func (*PetCreate) SetName

func (pc *PetCreate) SetName(s string) *PetCreate

SetName sets the "name" field.

func (*PetCreate) SetSvgRaw

func (pc *PetCreate) SetSvgRaw(s string) *PetCreate

SetSvgRaw sets the "svg_raw" field.

type PetCreateBulk

type PetCreateBulk struct {
	// contains filtered or unexported fields
}

PetCreateBulk is the builder for creating many Pet entities in bulk.

func (*PetCreateBulk) Exec

func (pcb *PetCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PetCreateBulk) ExecX

func (pcb *PetCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PetCreateBulk) OnConflict

func (pcb *PetCreateBulk) OnConflict(opts ...sql.ConflictOption) *PetUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Pet.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.PetUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*PetCreateBulk) OnConflictColumns

func (pcb *PetCreateBulk) OnConflictColumns(columns ...string) *PetUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Pet.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*PetCreateBulk) Save

func (pcb *PetCreateBulk) Save(ctx context.Context) ([]*Pet, error)

Save creates the Pet entities in the database.

func (*PetCreateBulk) SaveX

func (pcb *PetCreateBulk) SaveX(ctx context.Context) []*Pet

SaveX is like Save, but panics if an error occurs.

type PetDelete

type PetDelete struct {
	// contains filtered or unexported fields
}

PetDelete is the builder for deleting a Pet entity.

func (*PetDelete) Exec

func (pd *PetDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*PetDelete) ExecX

func (pd *PetDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PetDelete) Where

func (pd *PetDelete) Where(ps ...predicate.Pet) *PetDelete

Where appends a list predicates to the PetDelete builder.

type PetDeleteOne

type PetDeleteOne struct {
	// contains filtered or unexported fields
}

PetDeleteOne is the builder for deleting a single Pet entity.

func (*PetDeleteOne) Exec

func (pdo *PetDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PetDeleteOne) ExecX

func (pdo *PetDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PetDeleteOne) Where

func (pdo *PetDeleteOne) Where(ps ...predicate.Pet) *PetDeleteOne

Where appends a list predicates to the PetDelete builder.

type PetEdges

type PetEdges struct {
	// Owner holds the value of the owner edge.
	Owner []*User `json:"owner,omitempty"`
	// UserPets holds the value of the user_pets edge.
	UserPets []*UserPet `json:"user_pets,omitempty"`
	// contains filtered or unexported fields
}

PetEdges holds the relations/edges for other nodes in the graph.

func (PetEdges) OwnerOrErr

func (e PetEdges) OwnerOrErr() ([]*User, error)

OwnerOrErr returns the Owner value or an error if the edge was not loaded in eager-loading.

func (PetEdges) UserPetsOrErr

func (e PetEdges) UserPetsOrErr() ([]*UserPet, error)

UserPetsOrErr returns the UserPets value or an error if the edge was not loaded in eager-loading.

type PetGroupBy

type PetGroupBy struct {
	// contains filtered or unexported fields
}

PetGroupBy is the group-by builder for Pet entities.

func (*PetGroupBy) Aggregate

func (pgb *PetGroupBy) Aggregate(fns ...AggregateFunc) *PetGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*PetGroupBy) Bool

func (s *PetGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PetGroupBy) BoolX

func (s *PetGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PetGroupBy) Bools

func (s *PetGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PetGroupBy) BoolsX

func (s *PetGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PetGroupBy) Float64

func (s *PetGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PetGroupBy) Float64X

func (s *PetGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PetGroupBy) Float64s

func (s *PetGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PetGroupBy) Float64sX

func (s *PetGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PetGroupBy) Int

func (s *PetGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PetGroupBy) IntX

func (s *PetGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PetGroupBy) Ints

func (s *PetGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PetGroupBy) IntsX

func (s *PetGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PetGroupBy) Scan

func (pgb *PetGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PetGroupBy) ScanX

func (s *PetGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PetGroupBy) String

func (s *PetGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PetGroupBy) StringX

func (s *PetGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PetGroupBy) Strings

func (s *PetGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PetGroupBy) StringsX

func (s *PetGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PetMutation

type PetMutation struct {
	// contains filtered or unexported fields
}

PetMutation represents an operation that mutates the Pet nodes in the graph.

func (*PetMutation) AddField

func (m *PetMutation) 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 (*PetMutation) AddOwnerIDs

func (m *PetMutation) AddOwnerIDs(ids ...int)

AddOwnerIDs adds the "owner" edge to the User entity by ids.

func (*PetMutation) AddedEdges

func (m *PetMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PetMutation) AddedField

func (m *PetMutation) 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 (*PetMutation) AddedFields

func (m *PetMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PetMutation) AddedIDs

func (m *PetMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PetMutation) ClearEdge

func (m *PetMutation) 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 (*PetMutation) ClearField

func (m *PetMutation) 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 (*PetMutation) ClearOwner

func (m *PetMutation) ClearOwner()

ClearOwner clears the "owner" edge to the User entity.

func (*PetMutation) ClearedEdges

func (m *PetMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PetMutation) ClearedFields

func (m *PetMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PetMutation) Client

func (m PetMutation) 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 (*PetMutation) EdgeCleared

func (m *PetMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PetMutation) Field

func (m *PetMutation) 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 (*PetMutation) FieldCleared

func (m *PetMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PetMutation) Fields

func (m *PetMutation) 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 (*PetMutation) ID

func (m *PetMutation) ID() (id int, 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 (*PetMutation) IDs

func (m *PetMutation) IDs(ctx context.Context) ([]int, 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 (*PetMutation) Name

func (m *PetMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*PetMutation) OldField

func (m *PetMutation) 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 (*PetMutation) OldName

func (m *PetMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Pet entity. If the Pet 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 (*PetMutation) OldSvgRaw

func (m *PetMutation) OldSvgRaw(ctx context.Context) (v string, err error)

OldSvgRaw returns the old "svg_raw" field's value of the Pet entity. If the Pet 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 (*PetMutation) Op

func (m *PetMutation) Op() Op

Op returns the operation name.

func (*PetMutation) OwnerCleared

func (m *PetMutation) OwnerCleared() bool

OwnerCleared reports if the "owner" edge to the User entity was cleared.

func (*PetMutation) OwnerIDs

func (m *PetMutation) OwnerIDs() (ids []int)

OwnerIDs returns the "owner" edge IDs in the mutation.

func (*PetMutation) RemoveOwnerIDs

func (m *PetMutation) RemoveOwnerIDs(ids ...int)

RemoveOwnerIDs removes the "owner" edge to the User entity by IDs.

func (*PetMutation) RemovedEdges

func (m *PetMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PetMutation) RemovedIDs

func (m *PetMutation) 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 (*PetMutation) RemovedOwnerIDs

func (m *PetMutation) RemovedOwnerIDs() (ids []int)

RemovedOwner returns the removed IDs of the "owner" edge to the User entity.

func (*PetMutation) ResetEdge

func (m *PetMutation) 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 (*PetMutation) ResetField

func (m *PetMutation) 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 (*PetMutation) ResetName

func (m *PetMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*PetMutation) ResetOwner

func (m *PetMutation) ResetOwner()

ResetOwner resets all changes to the "owner" edge.

func (*PetMutation) ResetSvgRaw

func (m *PetMutation) ResetSvgRaw()

ResetSvgRaw resets all changes to the "svg_raw" field.

func (*PetMutation) SetField

func (m *PetMutation) 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 (*PetMutation) SetName

func (m *PetMutation) SetName(s string)

SetName sets the "name" field.

func (*PetMutation) SetOp

func (m *PetMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PetMutation) SetSvgRaw

func (m *PetMutation) SetSvgRaw(s string)

SetSvgRaw sets the "svg_raw" field.

func (*PetMutation) SvgRaw

func (m *PetMutation) SvgRaw() (r string, exists bool)

SvgRaw returns the value of the "svg_raw" field in the mutation.

func (PetMutation) Tx

func (m PetMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PetMutation) Type

func (m *PetMutation) Type() string

Type returns the node type of this mutation (Pet).

func (*PetMutation) Where

func (m *PetMutation) Where(ps ...predicate.Pet)

Where appends a list predicates to the PetMutation builder.

func (*PetMutation) WhereP

func (m *PetMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PetMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type PetQuery

type PetQuery struct {
	// contains filtered or unexported fields
}

PetQuery is the builder for querying Pet entities.

func (*PetQuery) Aggregate

func (pq *PetQuery) Aggregate(fns ...AggregateFunc) *PetSelect

Aggregate returns a PetSelect configured with the given aggregations.

func (*PetQuery) All

func (pq *PetQuery) All(ctx context.Context) ([]*Pet, error)

All executes the query and returns a list of Pets.

func (*PetQuery) AllX

func (pq *PetQuery) AllX(ctx context.Context) []*Pet

AllX is like All, but panics if an error occurs.

func (*PetQuery) Clone

func (pq *PetQuery) Clone() *PetQuery

Clone returns a duplicate of the PetQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PetQuery) Count

func (pq *PetQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PetQuery) CountX

func (pq *PetQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PetQuery) Exist

func (pq *PetQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PetQuery) ExistX

func (pq *PetQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PetQuery) First

func (pq *PetQuery) First(ctx context.Context) (*Pet, error)

First returns the first Pet entity from the query. Returns a *NotFoundError when no Pet was found.

func (*PetQuery) FirstID

func (pq *PetQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Pet ID from the query. Returns a *NotFoundError when no Pet ID was found.

func (*PetQuery) FirstIDX

func (pq *PetQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*PetQuery) FirstX

func (pq *PetQuery) FirstX(ctx context.Context) *Pet

FirstX is like First, but panics if an error occurs.

func (*PetQuery) GroupBy

func (pq *PetQuery) GroupBy(field string, fields ...string) *PetGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Pet.Query().
	GroupBy(pet.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PetQuery) IDs

func (pq *PetQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Pet IDs.

func (*PetQuery) IDsX

func (pq *PetQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*PetQuery) Limit

func (pq *PetQuery) Limit(limit int) *PetQuery

Limit the number of records to be returned by this query.

func (*PetQuery) Offset

func (pq *PetQuery) Offset(offset int) *PetQuery

Offset to start from.

func (*PetQuery) Only

func (pq *PetQuery) Only(ctx context.Context) (*Pet, error)

Only returns a single Pet entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Pet entity is found. Returns a *NotFoundError when no Pet entities are found.

func (*PetQuery) OnlyID

func (pq *PetQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Pet ID in the query. Returns a *NotSingularError when more than one Pet ID is found. Returns a *NotFoundError when no entities are found.

func (*PetQuery) OnlyIDX

func (pq *PetQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PetQuery) OnlyX

func (pq *PetQuery) OnlyX(ctx context.Context) *Pet

OnlyX is like Only, but panics if an error occurs.

func (*PetQuery) Order

func (pq *PetQuery) Order(o ...pet.OrderOption) *PetQuery

Order specifies how the records should be ordered.

func (*PetQuery) QueryOwner

func (pq *PetQuery) QueryOwner() *UserQuery

QueryOwner chains the current query on the "owner" edge.

func (*PetQuery) QueryUserPets

func (pq *PetQuery) QueryUserPets() *UserPetQuery

QueryUserPets chains the current query on the "user_pets" edge.

func (*PetQuery) Select

func (pq *PetQuery) Select(fields ...string) *PetSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.Pet.Query().
	Select(pet.FieldName).
	Scan(ctx, &v)

func (*PetQuery) Unique

func (pq *PetQuery) Unique(unique bool) *PetQuery

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 (*PetQuery) Where

func (pq *PetQuery) Where(ps ...predicate.Pet) *PetQuery

Where adds a new predicate for the PetQuery builder.

func (*PetQuery) WithOwner

func (pq *PetQuery) WithOwner(opts ...func(*UserQuery)) *PetQuery

WithOwner tells the query-builder to eager-load the nodes that are connected to the "owner" edge. The optional arguments are used to configure the query builder of the edge.

func (*PetQuery) WithUserPets

func (pq *PetQuery) WithUserPets(opts ...func(*UserPetQuery)) *PetQuery

WithUserPets tells the query-builder to eager-load the nodes that are connected to the "user_pets" edge. The optional arguments are used to configure the query builder of the edge.

type PetSelect

type PetSelect struct {
	*PetQuery
	// contains filtered or unexported fields
}

PetSelect is the builder for selecting fields of Pet entities.

func (*PetSelect) Aggregate

func (ps *PetSelect) Aggregate(fns ...AggregateFunc) *PetSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PetSelect) Bool

func (s *PetSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PetSelect) BoolX

func (s *PetSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PetSelect) Bools

func (s *PetSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PetSelect) BoolsX

func (s *PetSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PetSelect) Float64

func (s *PetSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PetSelect) Float64X

func (s *PetSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PetSelect) Float64s

func (s *PetSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PetSelect) Float64sX

func (s *PetSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PetSelect) Int

func (s *PetSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PetSelect) IntX

func (s *PetSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PetSelect) Ints

func (s *PetSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PetSelect) IntsX

func (s *PetSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PetSelect) Scan

func (ps *PetSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PetSelect) ScanX

func (s *PetSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PetSelect) String

func (s *PetSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PetSelect) StringX

func (s *PetSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PetSelect) Strings

func (s *PetSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PetSelect) StringsX

func (s *PetSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PetUpdate

type PetUpdate struct {
	// contains filtered or unexported fields
}

PetUpdate is the builder for updating Pet entities.

func (*PetUpdate) AddOwner

func (pu *PetUpdate) AddOwner(u ...*User) *PetUpdate

AddOwner adds the "owner" edges to the User entity.

func (*PetUpdate) AddOwnerIDs

func (pu *PetUpdate) AddOwnerIDs(ids ...int) *PetUpdate

AddOwnerIDs adds the "owner" edge to the User entity by IDs.

func (*PetUpdate) ClearOwner

func (pu *PetUpdate) ClearOwner() *PetUpdate

ClearOwner clears all "owner" edges to the User entity.

func (*PetUpdate) Exec

func (pu *PetUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PetUpdate) ExecX

func (pu *PetUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PetUpdate) Mutation

func (pu *PetUpdate) Mutation() *PetMutation

Mutation returns the PetMutation object of the builder.

func (*PetUpdate) RemoveOwner

func (pu *PetUpdate) RemoveOwner(u ...*User) *PetUpdate

RemoveOwner removes "owner" edges to User entities.

func (*PetUpdate) RemoveOwnerIDs

func (pu *PetUpdate) RemoveOwnerIDs(ids ...int) *PetUpdate

RemoveOwnerIDs removes the "owner" edge to User entities by IDs.

func (*PetUpdate) Save

func (pu *PetUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*PetUpdate) SaveX

func (pu *PetUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PetUpdate) SetName

func (pu *PetUpdate) SetName(s string) *PetUpdate

SetName sets the "name" field.

func (*PetUpdate) SetSvgRaw

func (pu *PetUpdate) SetSvgRaw(s string) *PetUpdate

SetSvgRaw sets the "svg_raw" field.

func (*PetUpdate) Where

func (pu *PetUpdate) Where(ps ...predicate.Pet) *PetUpdate

Where appends a list predicates to the PetUpdate builder.

type PetUpdateOne

type PetUpdateOne struct {
	// contains filtered or unexported fields
}

PetUpdateOne is the builder for updating a single Pet entity.

func (*PetUpdateOne) AddOwner

func (puo *PetUpdateOne) AddOwner(u ...*User) *PetUpdateOne

AddOwner adds the "owner" edges to the User entity.

func (*PetUpdateOne) AddOwnerIDs

func (puo *PetUpdateOne) AddOwnerIDs(ids ...int) *PetUpdateOne

AddOwnerIDs adds the "owner" edge to the User entity by IDs.

func (*PetUpdateOne) ClearOwner

func (puo *PetUpdateOne) ClearOwner() *PetUpdateOne

ClearOwner clears all "owner" edges to the User entity.

func (*PetUpdateOne) Exec

func (puo *PetUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PetUpdateOne) ExecX

func (puo *PetUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PetUpdateOne) Mutation

func (puo *PetUpdateOne) Mutation() *PetMutation

Mutation returns the PetMutation object of the builder.

func (*PetUpdateOne) RemoveOwner

func (puo *PetUpdateOne) RemoveOwner(u ...*User) *PetUpdateOne

RemoveOwner removes "owner" edges to User entities.

func (*PetUpdateOne) RemoveOwnerIDs

func (puo *PetUpdateOne) RemoveOwnerIDs(ids ...int) *PetUpdateOne

RemoveOwnerIDs removes the "owner" edge to User entities by IDs.

func (*PetUpdateOne) Save

func (puo *PetUpdateOne) Save(ctx context.Context) (*Pet, error)

Save executes the query and returns the updated Pet entity.

func (*PetUpdateOne) SaveX

func (puo *PetUpdateOne) SaveX(ctx context.Context) *Pet

SaveX is like Save, but panics if an error occurs.

func (*PetUpdateOne) Select

func (puo *PetUpdateOne) Select(field string, fields ...string) *PetUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PetUpdateOne) SetName

func (puo *PetUpdateOne) SetName(s string) *PetUpdateOne

SetName sets the "name" field.

func (*PetUpdateOne) SetSvgRaw

func (puo *PetUpdateOne) SetSvgRaw(s string) *PetUpdateOne

SetSvgRaw sets the "svg_raw" field.

func (*PetUpdateOne) Where

func (puo *PetUpdateOne) Where(ps ...predicate.Pet) *PetUpdateOne

Where appends a list predicates to the PetUpdate builder.

type PetUpsert

type PetUpsert struct {
	*sql.UpdateSet
}

PetUpsert is the "OnConflict" setter.

func (*PetUpsert) SetName

func (u *PetUpsert) SetName(v string) *PetUpsert

SetName sets the "name" field.

func (*PetUpsert) SetSvgRaw

func (u *PetUpsert) SetSvgRaw(v string) *PetUpsert

SetSvgRaw sets the "svg_raw" field.

func (*PetUpsert) UpdateName

func (u *PetUpsert) UpdateName() *PetUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*PetUpsert) UpdateSvgRaw

func (u *PetUpsert) UpdateSvgRaw() *PetUpsert

UpdateSvgRaw sets the "svg_raw" field to the value that was provided on create.

type PetUpsertBulk

type PetUpsertBulk struct {
	// contains filtered or unexported fields
}

PetUpsertBulk is the builder for "upsert"-ing a bulk of Pet nodes.

func (*PetUpsertBulk) DoNothing

func (u *PetUpsertBulk) DoNothing() *PetUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*PetUpsertBulk) Exec

func (u *PetUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PetUpsertBulk) ExecX

func (u *PetUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PetUpsertBulk) Ignore

func (u *PetUpsertBulk) Ignore() *PetUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Pet.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*PetUpsertBulk) SetName

func (u *PetUpsertBulk) SetName(v string) *PetUpsertBulk

SetName sets the "name" field.

func (*PetUpsertBulk) SetSvgRaw

func (u *PetUpsertBulk) SetSvgRaw(v string) *PetUpsertBulk

SetSvgRaw sets the "svg_raw" field.

func (*PetUpsertBulk) Update

func (u *PetUpsertBulk) Update(set func(*PetUpsert)) *PetUpsertBulk

Update allows overriding fields `UPDATE` values. See the PetCreateBulk.OnConflict documentation for more info.

func (*PetUpsertBulk) UpdateName

func (u *PetUpsertBulk) UpdateName() *PetUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*PetUpsertBulk) UpdateNewValues

func (u *PetUpsertBulk) UpdateNewValues() *PetUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Pet.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*PetUpsertBulk) UpdateSvgRaw

func (u *PetUpsertBulk) UpdateSvgRaw() *PetUpsertBulk

UpdateSvgRaw sets the "svg_raw" field to the value that was provided on create.

type PetUpsertOne

type PetUpsertOne struct {
	// contains filtered or unexported fields
}

PetUpsertOne is the builder for "upsert"-ing

one Pet node.

func (*PetUpsertOne) DoNothing

func (u *PetUpsertOne) DoNothing() *PetUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*PetUpsertOne) Exec

func (u *PetUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*PetUpsertOne) ExecX

func (u *PetUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PetUpsertOne) ID

func (u *PetUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*PetUpsertOne) IDX

func (u *PetUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*PetUpsertOne) Ignore

func (u *PetUpsertOne) Ignore() *PetUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Pet.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*PetUpsertOne) SetName

func (u *PetUpsertOne) SetName(v string) *PetUpsertOne

SetName sets the "name" field.

func (*PetUpsertOne) SetSvgRaw

func (u *PetUpsertOne) SetSvgRaw(v string) *PetUpsertOne

SetSvgRaw sets the "svg_raw" field.

func (*PetUpsertOne) Update

func (u *PetUpsertOne) Update(set func(*PetUpsert)) *PetUpsertOne

Update allows overriding fields `UPDATE` values. See the PetCreate.OnConflict documentation for more info.

func (*PetUpsertOne) UpdateName

func (u *PetUpsertOne) UpdateName() *PetUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*PetUpsertOne) UpdateNewValues

func (u *PetUpsertOne) UpdateNewValues() *PetUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Pet.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*PetUpsertOne) UpdateSvgRaw

func (u *PetUpsertOne) UpdateSvgRaw() *PetUpsertOne

UpdateSvgRaw sets the "svg_raw" field to the value that was provided on create.

type Pets

type Pets []*Pet

Pets is a parsable slice of Pet.

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 Reaction

type Reaction struct {

	// ID of the user that reacted on the post
	UserID int `json:"user_id,omitempty"`
	// ID of the post that was reacted to
	ForumPostID int `json:"forum_post_id,omitempty"`
	// Emoji used for the reaction
	Emoji string `json:"emoji,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ReactionQuery when eager-loading is set.
	Edges ReactionEdges `json:"edges"`
	// contains filtered or unexported fields
}

Reaction is the model entity for the Reaction schema.

func (*Reaction) QueryForumPost

func (r *Reaction) QueryForumPost() *ForumPostQuery

QueryForumPost queries the "forum_post" edge of the Reaction entity.

func (*Reaction) QueryUser

func (r *Reaction) QueryUser() *UserQuery

QueryUser queries the "user" edge of the Reaction entity.

func (*Reaction) String

func (r *Reaction) String() string

String implements the fmt.Stringer.

func (*Reaction) Unwrap

func (r *Reaction) Unwrap() *Reaction

Unwrap unwraps the Reaction 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 (*Reaction) Update

func (r *Reaction) Update() *ReactionUpdateOne

Update returns a builder for updating this Reaction. Note that you need to call Reaction.Unwrap() before calling this method if this Reaction was returned from a transaction, and the transaction was committed or rolled back.

func (*Reaction) Value

func (r *Reaction) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Reaction. This includes values selected through modifiers, order, etc.

type ReactionClient

type ReactionClient struct {
	// contains filtered or unexported fields
}

ReactionClient is a client for the Reaction schema.

func NewReactionClient

func NewReactionClient(c config) *ReactionClient

NewReactionClient returns a client for the Reaction from the given config.

func (*ReactionClient) Create

func (c *ReactionClient) Create() *ReactionCreate

Create returns a builder for creating a Reaction entity.

func (*ReactionClient) CreateBulk

func (c *ReactionClient) CreateBulk(builders ...*ReactionCreate) *ReactionCreateBulk

CreateBulk returns a builder for creating a bulk of Reaction entities.

func (*ReactionClient) Delete

func (c *ReactionClient) Delete() *ReactionDelete

Delete returns a delete builder for Reaction.

func (*ReactionClient) Hooks

func (c *ReactionClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ReactionClient) Intercept

func (c *ReactionClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `reaction.Intercept(f(g(h())))`.

func (*ReactionClient) Interceptors

func (c *ReactionClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ReactionClient) Query

func (c *ReactionClient) Query() *ReactionQuery

Query returns a query builder for Reaction.

func (*ReactionClient) QueryForumPost

func (c *ReactionClient) QueryForumPost(r *Reaction) *ForumPostQuery

QueryForumPost queries the forum_post edge of a Reaction.

func (*ReactionClient) QueryUser

func (c *ReactionClient) QueryUser(r *Reaction) *UserQuery

QueryUser queries the user edge of a Reaction.

func (*ReactionClient) Update

func (c *ReactionClient) Update() *ReactionUpdate

Update returns an update builder for Reaction.

func (*ReactionClient) UpdateOne

func (c *ReactionClient) UpdateOne(r *Reaction) *ReactionUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ReactionClient) Use

func (c *ReactionClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `reaction.Hooks(f(g(h())))`.

type ReactionCreate

type ReactionCreate struct {
	// contains filtered or unexported fields
}

ReactionCreate is the builder for creating a Reaction entity.

func (*ReactionCreate) Exec

func (rc *ReactionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ReactionCreate) ExecX

func (rc *ReactionCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReactionCreate) Mutation

func (rc *ReactionCreate) Mutation() *ReactionMutation

Mutation returns the ReactionMutation object of the builder.

func (*ReactionCreate) OnConflict

func (rc *ReactionCreate) OnConflict(opts ...sql.ConflictOption) *ReactionUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Reaction.Create().
	SetUserID(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.ReactionUpsert) {
		SetUserID(v+v).
	}).
	Exec(ctx)

func (*ReactionCreate) OnConflictColumns

func (rc *ReactionCreate) OnConflictColumns(columns ...string) *ReactionUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Reaction.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*ReactionCreate) Save

func (rc *ReactionCreate) Save(ctx context.Context) (*Reaction, error)

Save creates the Reaction in the database.

func (*ReactionCreate) SaveX

func (rc *ReactionCreate) SaveX(ctx context.Context) *Reaction

SaveX calls Save and panics if Save returns an error.

func (*ReactionCreate) SetEmoji

func (rc *ReactionCreate) SetEmoji(s string) *ReactionCreate

SetEmoji sets the "emoji" field.

func (*ReactionCreate) SetForumPost

func (rc *ReactionCreate) SetForumPost(f *ForumPost) *ReactionCreate

SetForumPost sets the "forum_post" edge to the ForumPost entity.

func (*ReactionCreate) SetForumPostID

func (rc *ReactionCreate) SetForumPostID(i int) *ReactionCreate

SetForumPostID sets the "forum_post_id" field.

func (*ReactionCreate) SetUser

func (rc *ReactionCreate) SetUser(u *User) *ReactionCreate

SetUser sets the "user" edge to the User entity.

func (*ReactionCreate) SetUserID

func (rc *ReactionCreate) SetUserID(i int) *ReactionCreate

SetUserID sets the "user_id" field.

type ReactionCreateBulk

type ReactionCreateBulk struct {
	// contains filtered or unexported fields
}

ReactionCreateBulk is the builder for creating many Reaction entities in bulk.

func (*ReactionCreateBulk) Exec

func (rcb *ReactionCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ReactionCreateBulk) ExecX

func (rcb *ReactionCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReactionCreateBulk) OnConflict

func (rcb *ReactionCreateBulk) OnConflict(opts ...sql.ConflictOption) *ReactionUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Reaction.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.ReactionUpsert) {
		SetUserID(v+v).
	}).
	Exec(ctx)

func (*ReactionCreateBulk) OnConflictColumns

func (rcb *ReactionCreateBulk) OnConflictColumns(columns ...string) *ReactionUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Reaction.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*ReactionCreateBulk) Save

func (rcb *ReactionCreateBulk) Save(ctx context.Context) ([]*Reaction, error)

Save creates the Reaction entities in the database.

func (*ReactionCreateBulk) SaveX

func (rcb *ReactionCreateBulk) SaveX(ctx context.Context) []*Reaction

SaveX is like Save, but panics if an error occurs.

type ReactionDelete

type ReactionDelete struct {
	// contains filtered or unexported fields
}

ReactionDelete is the builder for deleting a Reaction entity.

func (*ReactionDelete) Exec

func (rd *ReactionDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ReactionDelete) ExecX

func (rd *ReactionDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ReactionDelete) Where

func (rd *ReactionDelete) Where(ps ...predicate.Reaction) *ReactionDelete

Where appends a list predicates to the ReactionDelete builder.

type ReactionDeleteOne

type ReactionDeleteOne struct {
	// contains filtered or unexported fields
}

ReactionDeleteOne is the builder for deleting a single Reaction entity.

func (*ReactionDeleteOne) Exec

func (rdo *ReactionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ReactionDeleteOne) ExecX

func (rdo *ReactionDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReactionDeleteOne) Where

Where appends a list predicates to the ReactionDelete builder.

type ReactionEdges

type ReactionEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// ForumPost holds the value of the forum_post edge.
	ForumPost *ForumPost `json:"forum_post,omitempty"`
	// contains filtered or unexported fields
}

ReactionEdges holds the relations/edges for other nodes in the graph.

func (ReactionEdges) ForumPostOrErr

func (e ReactionEdges) ForumPostOrErr() (*ForumPost, error)

ForumPostOrErr returns the ForumPost value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (ReactionEdges) UserOrErr

func (e ReactionEdges) UserOrErr() (*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type ReactionGroupBy

type ReactionGroupBy struct {
	// contains filtered or unexported fields
}

ReactionGroupBy is the group-by builder for Reaction entities.

func (*ReactionGroupBy) Aggregate

func (rgb *ReactionGroupBy) Aggregate(fns ...AggregateFunc) *ReactionGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ReactionGroupBy) Bool

func (s *ReactionGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ReactionGroupBy) BoolX

func (s *ReactionGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ReactionGroupBy) Bools

func (s *ReactionGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ReactionGroupBy) BoolsX

func (s *ReactionGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ReactionGroupBy) Float64

func (s *ReactionGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ReactionGroupBy) Float64X

func (s *ReactionGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ReactionGroupBy) Float64s

func (s *ReactionGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ReactionGroupBy) Float64sX

func (s *ReactionGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ReactionGroupBy) Int

func (s *ReactionGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ReactionGroupBy) IntX

func (s *ReactionGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ReactionGroupBy) Ints

func (s *ReactionGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ReactionGroupBy) IntsX

func (s *ReactionGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ReactionGroupBy) Scan

func (rgb *ReactionGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ReactionGroupBy) ScanX

func (s *ReactionGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ReactionGroupBy) String

func (s *ReactionGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ReactionGroupBy) StringX

func (s *ReactionGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ReactionGroupBy) Strings

func (s *ReactionGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ReactionGroupBy) StringsX

func (s *ReactionGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ReactionMutation

type ReactionMutation struct {
	// contains filtered or unexported fields
}

ReactionMutation represents an operation that mutates the Reaction nodes in the graph.

func (*ReactionMutation) AddField

func (m *ReactionMutation) 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 (*ReactionMutation) AddedEdges

func (m *ReactionMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ReactionMutation) AddedField

func (m *ReactionMutation) 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 (*ReactionMutation) AddedFields

func (m *ReactionMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ReactionMutation) AddedIDs

func (m *ReactionMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ReactionMutation) ClearEdge

func (m *ReactionMutation) 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 (*ReactionMutation) ClearField

func (m *ReactionMutation) 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 (*ReactionMutation) ClearForumPost

func (m *ReactionMutation) ClearForumPost()

ClearForumPost clears the "forum_post" edge to the ForumPost entity.

func (*ReactionMutation) ClearUser

func (m *ReactionMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*ReactionMutation) ClearedEdges

func (m *ReactionMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ReactionMutation) ClearedFields

func (m *ReactionMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ReactionMutation) Client

func (m ReactionMutation) 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 (*ReactionMutation) EdgeCleared

func (m *ReactionMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ReactionMutation) Emoji

func (m *ReactionMutation) Emoji() (r string, exists bool)

Emoji returns the value of the "emoji" field in the mutation.

func (*ReactionMutation) Field

func (m *ReactionMutation) 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 (*ReactionMutation) FieldCleared

func (m *ReactionMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ReactionMutation) Fields

func (m *ReactionMutation) 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 (*ReactionMutation) ForumPostCleared

func (m *ReactionMutation) ForumPostCleared() bool

ForumPostCleared reports if the "forum_post" edge to the ForumPost entity was cleared.

func (*ReactionMutation) ForumPostID

func (m *ReactionMutation) ForumPostID() (r int, exists bool)

ForumPostID returns the value of the "forum_post_id" field in the mutation.

func (*ReactionMutation) ForumPostIDs

func (m *ReactionMutation) ForumPostIDs() (ids []int)

ForumPostIDs returns the "forum_post" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ForumPostID instead. It exists only for internal usage by the builders.

func (*ReactionMutation) OldField

func (m *ReactionMutation) 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 (*ReactionMutation) Op

func (m *ReactionMutation) Op() Op

Op returns the operation name.

func (*ReactionMutation) RemovedEdges

func (m *ReactionMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ReactionMutation) RemovedIDs

func (m *ReactionMutation) 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 (*ReactionMutation) ResetEdge

func (m *ReactionMutation) 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 (*ReactionMutation) ResetEmoji

func (m *ReactionMutation) ResetEmoji()

ResetEmoji resets all changes to the "emoji" field.

func (*ReactionMutation) ResetField

func (m *ReactionMutation) 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 (*ReactionMutation) ResetForumPost

func (m *ReactionMutation) ResetForumPost()

ResetForumPost resets all changes to the "forum_post" edge.

func (*ReactionMutation) ResetForumPostID

func (m *ReactionMutation) ResetForumPostID()

ResetForumPostID resets all changes to the "forum_post_id" field.

func (*ReactionMutation) ResetUser

func (m *ReactionMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*ReactionMutation) ResetUserID

func (m *ReactionMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*ReactionMutation) SetEmoji

func (m *ReactionMutation) SetEmoji(s string)

SetEmoji sets the "emoji" field.

func (*ReactionMutation) SetField

func (m *ReactionMutation) 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 (*ReactionMutation) SetForumPostID

func (m *ReactionMutation) SetForumPostID(i int)

SetForumPostID sets the "forum_post_id" field.

func (*ReactionMutation) SetOp

func (m *ReactionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ReactionMutation) SetUserID

func (m *ReactionMutation) SetUserID(i int)

SetUserID sets the "user_id" field.

func (ReactionMutation) Tx

func (m ReactionMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ReactionMutation) Type

func (m *ReactionMutation) Type() string

Type returns the node type of this mutation (Reaction).

func (*ReactionMutation) UserCleared

func (m *ReactionMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*ReactionMutation) UserID

func (m *ReactionMutation) UserID() (r int, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*ReactionMutation) UserIDs

func (m *ReactionMutation) UserIDs() (ids []int)

UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

func (*ReactionMutation) Where

func (m *ReactionMutation) Where(ps ...predicate.Reaction)

Where appends a list predicates to the ReactionMutation builder.

func (*ReactionMutation) WhereP

func (m *ReactionMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ReactionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ReactionQuery

type ReactionQuery struct {
	// contains filtered or unexported fields
}

ReactionQuery is the builder for querying Reaction entities.

func (*ReactionQuery) Aggregate

func (rq *ReactionQuery) Aggregate(fns ...AggregateFunc) *ReactionSelect

Aggregate returns a ReactionSelect configured with the given aggregations.

func (*ReactionQuery) All

func (rq *ReactionQuery) All(ctx context.Context) ([]*Reaction, error)

All executes the query and returns a list of Reactions.

func (*ReactionQuery) AllX

func (rq *ReactionQuery) AllX(ctx context.Context) []*Reaction

AllX is like All, but panics if an error occurs.

func (*ReactionQuery) Clone

func (rq *ReactionQuery) Clone() *ReactionQuery

Clone returns a duplicate of the ReactionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ReactionQuery) Count

func (rq *ReactionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ReactionQuery) CountX

func (rq *ReactionQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ReactionQuery) Exist

func (rq *ReactionQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ReactionQuery) ExistX

func (rq *ReactionQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ReactionQuery) First

func (rq *ReactionQuery) First(ctx context.Context) (*Reaction, error)

First returns the first Reaction entity from the query. Returns a *NotFoundError when no Reaction was found.

func (*ReactionQuery) FirstX

func (rq *ReactionQuery) FirstX(ctx context.Context) *Reaction

FirstX is like First, but panics if an error occurs.

func (*ReactionQuery) GroupBy

func (rq *ReactionQuery) GroupBy(field string, fields ...string) *ReactionGroupBy

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 {
	UserID int `json:"user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Reaction.Query().
	GroupBy(reaction.FieldUserID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ReactionQuery) Limit

func (rq *ReactionQuery) Limit(limit int) *ReactionQuery

Limit the number of records to be returned by this query.

func (*ReactionQuery) Offset

func (rq *ReactionQuery) Offset(offset int) *ReactionQuery

Offset to start from.

func (*ReactionQuery) Only

func (rq *ReactionQuery) Only(ctx context.Context) (*Reaction, error)

Only returns a single Reaction entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Reaction entity is found. Returns a *NotFoundError when no Reaction entities are found.

func (*ReactionQuery) OnlyX

func (rq *ReactionQuery) OnlyX(ctx context.Context) *Reaction

OnlyX is like Only, but panics if an error occurs.

func (*ReactionQuery) Order

Order specifies how the records should be ordered.

func (*ReactionQuery) QueryForumPost

func (rq *ReactionQuery) QueryForumPost() *ForumPostQuery

QueryForumPost chains the current query on the "forum_post" edge.

func (*ReactionQuery) QueryUser

func (rq *ReactionQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*ReactionQuery) Select

func (rq *ReactionQuery) Select(fields ...string) *ReactionSelect

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 {
	UserID int `json:"user_id,omitempty"`
}

client.Reaction.Query().
	Select(reaction.FieldUserID).
	Scan(ctx, &v)

func (*ReactionQuery) Unique

func (rq *ReactionQuery) Unique(unique bool) *ReactionQuery

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 (*ReactionQuery) Where

func (rq *ReactionQuery) Where(ps ...predicate.Reaction) *ReactionQuery

Where adds a new predicate for the ReactionQuery builder.

func (*ReactionQuery) WithForumPost

func (rq *ReactionQuery) WithForumPost(opts ...func(*ForumPostQuery)) *ReactionQuery

WithForumPost tells the query-builder to eager-load the nodes that are connected to the "forum_post" edge. The optional arguments are used to configure the query builder of the edge.

func (*ReactionQuery) WithUser

func (rq *ReactionQuery) WithUser(opts ...func(*UserQuery)) *ReactionQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type ReactionSelect

type ReactionSelect struct {
	*ReactionQuery
	// contains filtered or unexported fields
}

ReactionSelect is the builder for selecting fields of Reaction entities.

func (*ReactionSelect) Aggregate

func (rs *ReactionSelect) Aggregate(fns ...AggregateFunc) *ReactionSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ReactionSelect) Bool

func (s *ReactionSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ReactionSelect) BoolX

func (s *ReactionSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ReactionSelect) Bools

func (s *ReactionSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ReactionSelect) BoolsX

func (s *ReactionSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ReactionSelect) Float64

func (s *ReactionSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ReactionSelect) Float64X

func (s *ReactionSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ReactionSelect) Float64s

func (s *ReactionSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ReactionSelect) Float64sX

func (s *ReactionSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ReactionSelect) Int

func (s *ReactionSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ReactionSelect) IntX

func (s *ReactionSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ReactionSelect) Ints

func (s *ReactionSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ReactionSelect) IntsX

func (s *ReactionSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ReactionSelect) Scan

func (rs *ReactionSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ReactionSelect) ScanX

func (s *ReactionSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ReactionSelect) String

func (s *ReactionSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ReactionSelect) StringX

func (s *ReactionSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ReactionSelect) Strings

func (s *ReactionSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ReactionSelect) StringsX

func (s *ReactionSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ReactionUpdate

type ReactionUpdate struct {
	// contains filtered or unexported fields
}

ReactionUpdate is the builder for updating Reaction entities.

func (*ReactionUpdate) ClearForumPost

func (ru *ReactionUpdate) ClearForumPost() *ReactionUpdate

ClearForumPost clears the "forum_post" edge to the ForumPost entity.

func (*ReactionUpdate) ClearUser

func (ru *ReactionUpdate) ClearUser() *ReactionUpdate

ClearUser clears the "user" edge to the User entity.

func (*ReactionUpdate) Exec

func (ru *ReactionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ReactionUpdate) ExecX

func (ru *ReactionUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReactionUpdate) Mutation

func (ru *ReactionUpdate) Mutation() *ReactionMutation

Mutation returns the ReactionMutation object of the builder.

func (*ReactionUpdate) Save

func (ru *ReactionUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ReactionUpdate) SaveX

func (ru *ReactionUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ReactionUpdate) SetEmoji

func (ru *ReactionUpdate) SetEmoji(s string) *ReactionUpdate

SetEmoji sets the "emoji" field.

func (*ReactionUpdate) SetForumPost

func (ru *ReactionUpdate) SetForumPost(f *ForumPost) *ReactionUpdate

SetForumPost sets the "forum_post" edge to the ForumPost entity.

func (*ReactionUpdate) SetForumPostID

func (ru *ReactionUpdate) SetForumPostID(i int) *ReactionUpdate

SetForumPostID sets the "forum_post_id" field.

func (*ReactionUpdate) SetUser

func (ru *ReactionUpdate) SetUser(u *User) *ReactionUpdate

SetUser sets the "user" edge to the User entity.

func (*ReactionUpdate) SetUserID

func (ru *ReactionUpdate) SetUserID(i int) *ReactionUpdate

SetUserID sets the "user_id" field.

func (*ReactionUpdate) Where

func (ru *ReactionUpdate) Where(ps ...predicate.Reaction) *ReactionUpdate

Where appends a list predicates to the ReactionUpdate builder.

type ReactionUpdateOne

type ReactionUpdateOne struct {
	// contains filtered or unexported fields
}

ReactionUpdateOne is the builder for updating a single Reaction entity.

func (*ReactionUpdateOne) ClearForumPost

func (ruo *ReactionUpdateOne) ClearForumPost() *ReactionUpdateOne

ClearForumPost clears the "forum_post" edge to the ForumPost entity.

func (*ReactionUpdateOne) ClearUser

func (ruo *ReactionUpdateOne) ClearUser() *ReactionUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*ReactionUpdateOne) Exec

func (ruo *ReactionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ReactionUpdateOne) ExecX

func (ruo *ReactionUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReactionUpdateOne) Mutation

func (ruo *ReactionUpdateOne) Mutation() *ReactionMutation

Mutation returns the ReactionMutation object of the builder.

func (*ReactionUpdateOne) Save

func (ruo *ReactionUpdateOne) Save(ctx context.Context) (*Reaction, error)

Save executes the query and returns the updated Reaction entity.

func (*ReactionUpdateOne) SaveX

func (ruo *ReactionUpdateOne) SaveX(ctx context.Context) *Reaction

SaveX is like Save, but panics if an error occurs.

func (*ReactionUpdateOne) Select

func (ruo *ReactionUpdateOne) Select(field string, fields ...string) *ReactionUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ReactionUpdateOne) SetEmoji

func (ruo *ReactionUpdateOne) SetEmoji(s string) *ReactionUpdateOne

SetEmoji sets the "emoji" field.

func (*ReactionUpdateOne) SetForumPost

func (ruo *ReactionUpdateOne) SetForumPost(f *ForumPost) *ReactionUpdateOne

SetForumPost sets the "forum_post" edge to the ForumPost entity.

func (*ReactionUpdateOne) SetForumPostID

func (ruo *ReactionUpdateOne) SetForumPostID(i int) *ReactionUpdateOne

SetForumPostID sets the "forum_post_id" field.

func (*ReactionUpdateOne) SetUser

func (ruo *ReactionUpdateOne) SetUser(u *User) *ReactionUpdateOne

SetUser sets the "user" edge to the User entity.

func (*ReactionUpdateOne) SetUserID

func (ruo *ReactionUpdateOne) SetUserID(i int) *ReactionUpdateOne

SetUserID sets the "user_id" field.

func (*ReactionUpdateOne) Where

Where appends a list predicates to the ReactionUpdate builder.

type ReactionUpsert

type ReactionUpsert struct {
	*sql.UpdateSet
}

ReactionUpsert is the "OnConflict" setter.

func (*ReactionUpsert) SetEmoji

func (u *ReactionUpsert) SetEmoji(v string) *ReactionUpsert

SetEmoji sets the "emoji" field.

func (*ReactionUpsert) SetForumPostID

func (u *ReactionUpsert) SetForumPostID(v int) *ReactionUpsert

SetForumPostID sets the "forum_post_id" field.

func (*ReactionUpsert) SetUserID

func (u *ReactionUpsert) SetUserID(v int) *ReactionUpsert

SetUserID sets the "user_id" field.

func (*ReactionUpsert) UpdateEmoji

func (u *ReactionUpsert) UpdateEmoji() *ReactionUpsert

UpdateEmoji sets the "emoji" field to the value that was provided on create.

func (*ReactionUpsert) UpdateForumPostID

func (u *ReactionUpsert) UpdateForumPostID() *ReactionUpsert

UpdateForumPostID sets the "forum_post_id" field to the value that was provided on create.

func (*ReactionUpsert) UpdateUserID

func (u *ReactionUpsert) UpdateUserID() *ReactionUpsert

UpdateUserID sets the "user_id" field to the value that was provided on create.

type ReactionUpsertBulk

type ReactionUpsertBulk struct {
	// contains filtered or unexported fields
}

ReactionUpsertBulk is the builder for "upsert"-ing a bulk of Reaction nodes.

func (*ReactionUpsertBulk) DoNothing

func (u *ReactionUpsertBulk) DoNothing() *ReactionUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ReactionUpsertBulk) Exec

func (u *ReactionUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ReactionUpsertBulk) ExecX

func (u *ReactionUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReactionUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Reaction.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*ReactionUpsertBulk) SetEmoji

SetEmoji sets the "emoji" field.

func (*ReactionUpsertBulk) SetForumPostID

func (u *ReactionUpsertBulk) SetForumPostID(v int) *ReactionUpsertBulk

SetForumPostID sets the "forum_post_id" field.

func (*ReactionUpsertBulk) SetUserID

func (u *ReactionUpsertBulk) SetUserID(v int) *ReactionUpsertBulk

SetUserID sets the "user_id" field.

func (*ReactionUpsertBulk) Update

func (u *ReactionUpsertBulk) Update(set func(*ReactionUpsert)) *ReactionUpsertBulk

Update allows overriding fields `UPDATE` values. See the ReactionCreateBulk.OnConflict documentation for more info.

func (*ReactionUpsertBulk) UpdateEmoji

func (u *ReactionUpsertBulk) UpdateEmoji() *ReactionUpsertBulk

UpdateEmoji sets the "emoji" field to the value that was provided on create.

func (*ReactionUpsertBulk) UpdateForumPostID

func (u *ReactionUpsertBulk) UpdateForumPostID() *ReactionUpsertBulk

UpdateForumPostID sets the "forum_post_id" field to the value that was provided on create.

func (*ReactionUpsertBulk) UpdateNewValues

func (u *ReactionUpsertBulk) UpdateNewValues() *ReactionUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Reaction.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*ReactionUpsertBulk) UpdateUserID

func (u *ReactionUpsertBulk) UpdateUserID() *ReactionUpsertBulk

UpdateUserID sets the "user_id" field to the value that was provided on create.

type ReactionUpsertOne

type ReactionUpsertOne struct {
	// contains filtered or unexported fields
}

ReactionUpsertOne is the builder for "upsert"-ing

one Reaction node.

func (*ReactionUpsertOne) DoNothing

func (u *ReactionUpsertOne) DoNothing() *ReactionUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ReactionUpsertOne) Exec

func (u *ReactionUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*ReactionUpsertOne) ExecX

func (u *ReactionUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReactionUpsertOne) Ignore

func (u *ReactionUpsertOne) Ignore() *ReactionUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Reaction.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*ReactionUpsertOne) SetEmoji

func (u *ReactionUpsertOne) SetEmoji(v string) *ReactionUpsertOne

SetEmoji sets the "emoji" field.

func (*ReactionUpsertOne) SetForumPostID

func (u *ReactionUpsertOne) SetForumPostID(v int) *ReactionUpsertOne

SetForumPostID sets the "forum_post_id" field.

func (*ReactionUpsertOne) SetUserID

func (u *ReactionUpsertOne) SetUserID(v int) *ReactionUpsertOne

SetUserID sets the "user_id" field.

func (*ReactionUpsertOne) Update

func (u *ReactionUpsertOne) Update(set func(*ReactionUpsert)) *ReactionUpsertOne

Update allows overriding fields `UPDATE` values. See the ReactionCreate.OnConflict documentation for more info.

func (*ReactionUpsertOne) UpdateEmoji

func (u *ReactionUpsertOne) UpdateEmoji() *ReactionUpsertOne

UpdateEmoji sets the "emoji" field to the value that was provided on create.

func (*ReactionUpsertOne) UpdateForumPostID

func (u *ReactionUpsertOne) UpdateForumPostID() *ReactionUpsertOne

UpdateForumPostID sets the "forum_post_id" field to the value that was provided on create.

func (*ReactionUpsertOne) UpdateNewValues

func (u *ReactionUpsertOne) UpdateNewValues() *ReactionUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Reaction.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*ReactionUpsertOne) UpdateUserID

func (u *ReactionUpsertOne) UpdateUserID() *ReactionUpsertOne

UpdateUserID sets the "user_id" field to the value that was provided on create.

type Reactions

type Reactions []*Reaction

Reactions is a parsable slice of Reaction.

type Redemption

type Redemption struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Time when the prize was redeemed
	RedeemedAt time.Time `json:"redeemed_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the RedemptionQuery when eager-loading is set.
	Edges RedemptionEdges `json:"edges"`
	// contains filtered or unexported fields
}

Redemption is the model entity for the Redemption schema.

func (*Redemption) QueryAccessory

func (r *Redemption) QueryAccessory() *AccessoryQuery

QueryAccessory queries the "accessory" edge of the Redemption entity.

func (*Redemption) QueryUser

func (r *Redemption) QueryUser() *UserQuery

QueryUser queries the "user" edge of the Redemption entity.

func (*Redemption) QueryVoucher

func (r *Redemption) QueryVoucher() *VoucherQuery

QueryVoucher queries the "voucher" edge of the Redemption entity.

func (*Redemption) String

func (r *Redemption) String() string

String implements the fmt.Stringer.

func (*Redemption) Unwrap

func (r *Redemption) Unwrap() *Redemption

Unwrap unwraps the Redemption 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 (*Redemption) Update

func (r *Redemption) Update() *RedemptionUpdateOne

Update returns a builder for updating this Redemption. Note that you need to call Redemption.Unwrap() before calling this method if this Redemption was returned from a transaction, and the transaction was committed or rolled back.

func (*Redemption) Value

func (r *Redemption) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Redemption. This includes values selected through modifiers, order, etc.

type RedemptionClient

type RedemptionClient struct {
	// contains filtered or unexported fields
}

RedemptionClient is a client for the Redemption schema.

func NewRedemptionClient

func NewRedemptionClient(c config) *RedemptionClient

NewRedemptionClient returns a client for the Redemption from the given config.

func (*RedemptionClient) Create

func (c *RedemptionClient) Create() *RedemptionCreate

Create returns a builder for creating a Redemption entity.

func (*RedemptionClient) CreateBulk

func (c *RedemptionClient) CreateBulk(builders ...*RedemptionCreate) *RedemptionCreateBulk

CreateBulk returns a builder for creating a bulk of Redemption entities.

func (*RedemptionClient) Delete

func (c *RedemptionClient) Delete() *RedemptionDelete

Delete returns a delete builder for Redemption.

func (*RedemptionClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*RedemptionClient) DeleteOneID

func (c *RedemptionClient) DeleteOneID(id int) *RedemptionDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*RedemptionClient) Get

func (c *RedemptionClient) Get(ctx context.Context, id int) (*Redemption, error)

Get returns a Redemption entity by its id.

func (*RedemptionClient) GetX

func (c *RedemptionClient) GetX(ctx context.Context, id int) *Redemption

GetX is like Get, but panics if an error occurs.

func (*RedemptionClient) Hooks

func (c *RedemptionClient) Hooks() []Hook

Hooks returns the client hooks.

func (*RedemptionClient) Intercept

func (c *RedemptionClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `redemption.Intercept(f(g(h())))`.

func (*RedemptionClient) Interceptors

func (c *RedemptionClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*RedemptionClient) Query

func (c *RedemptionClient) Query() *RedemptionQuery

Query returns a query builder for Redemption.

func (*RedemptionClient) QueryAccessory

func (c *RedemptionClient) QueryAccessory(r *Redemption) *AccessoryQuery

QueryAccessory queries the accessory edge of a Redemption.

func (*RedemptionClient) QueryUser

func (c *RedemptionClient) QueryUser(r *Redemption) *UserQuery

QueryUser queries the user edge of a Redemption.

func (*RedemptionClient) QueryVoucher

func (c *RedemptionClient) QueryVoucher(r *Redemption) *VoucherQuery

QueryVoucher queries the voucher edge of a Redemption.

func (*RedemptionClient) Update

func (c *RedemptionClient) Update() *RedemptionUpdate

Update returns an update builder for Redemption.

func (*RedemptionClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*RedemptionClient) UpdateOneID

func (c *RedemptionClient) UpdateOneID(id int) *RedemptionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*RedemptionClient) Use

func (c *RedemptionClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `redemption.Hooks(f(g(h())))`.

type RedemptionCreate

type RedemptionCreate struct {
	// contains filtered or unexported fields
}

RedemptionCreate is the builder for creating a Redemption entity.

func (*RedemptionCreate) Exec

func (rc *RedemptionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*RedemptionCreate) ExecX

func (rc *RedemptionCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RedemptionCreate) Mutation

func (rc *RedemptionCreate) Mutation() *RedemptionMutation

Mutation returns the RedemptionMutation object of the builder.

func (*RedemptionCreate) OnConflict

func (rc *RedemptionCreate) OnConflict(opts ...sql.ConflictOption) *RedemptionUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Redemption.Create().
	SetRedeemedAt(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.RedemptionUpsert) {
		SetRedeemedAt(v+v).
	}).
	Exec(ctx)

func (*RedemptionCreate) OnConflictColumns

func (rc *RedemptionCreate) OnConflictColumns(columns ...string) *RedemptionUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Redemption.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*RedemptionCreate) Save

func (rc *RedemptionCreate) Save(ctx context.Context) (*Redemption, error)

Save creates the Redemption in the database.

func (*RedemptionCreate) SaveX

func (rc *RedemptionCreate) SaveX(ctx context.Context) *Redemption

SaveX calls Save and panics if Save returns an error.

func (*RedemptionCreate) SetAccessory

func (rc *RedemptionCreate) SetAccessory(a *Accessory) *RedemptionCreate

SetAccessory sets the "accessory" edge to the Accessory entity.

func (*RedemptionCreate) SetAccessoryID

func (rc *RedemptionCreate) SetAccessoryID(id int) *RedemptionCreate

SetAccessoryID sets the "accessory" edge to the Accessory entity by ID.

func (*RedemptionCreate) SetNillableAccessoryID

func (rc *RedemptionCreate) SetNillableAccessoryID(id *int) *RedemptionCreate

SetNillableAccessoryID sets the "accessory" edge to the Accessory entity by ID if the given value is not nil.

func (*RedemptionCreate) SetNillableVoucherID

func (rc *RedemptionCreate) SetNillableVoucherID(id *int) *RedemptionCreate

SetNillableVoucherID sets the "voucher" edge to the Voucher entity by ID if the given value is not nil.

func (*RedemptionCreate) SetRedeemedAt

func (rc *RedemptionCreate) SetRedeemedAt(t time.Time) *RedemptionCreate

SetRedeemedAt sets the "redeemed_at" field.

func (*RedemptionCreate) SetUser

func (rc *RedemptionCreate) SetUser(u *User) *RedemptionCreate

SetUser sets the "user" edge to the User entity.

func (*RedemptionCreate) SetUserID

func (rc *RedemptionCreate) SetUserID(id int) *RedemptionCreate

SetUserID sets the "user" edge to the User entity by ID.

func (*RedemptionCreate) SetVoucher

func (rc *RedemptionCreate) SetVoucher(v *Voucher) *RedemptionCreate

SetVoucher sets the "voucher" edge to the Voucher entity.

func (*RedemptionCreate) SetVoucherID

func (rc *RedemptionCreate) SetVoucherID(id int) *RedemptionCreate

SetVoucherID sets the "voucher" edge to the Voucher entity by ID.

type RedemptionCreateBulk

type RedemptionCreateBulk struct {
	// contains filtered or unexported fields
}

RedemptionCreateBulk is the builder for creating many Redemption entities in bulk.

func (*RedemptionCreateBulk) Exec

func (rcb *RedemptionCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*RedemptionCreateBulk) ExecX

func (rcb *RedemptionCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RedemptionCreateBulk) OnConflict

func (rcb *RedemptionCreateBulk) OnConflict(opts ...sql.ConflictOption) *RedemptionUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Redemption.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.RedemptionUpsert) {
		SetRedeemedAt(v+v).
	}).
	Exec(ctx)

func (*RedemptionCreateBulk) OnConflictColumns

func (rcb *RedemptionCreateBulk) OnConflictColumns(columns ...string) *RedemptionUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Redemption.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*RedemptionCreateBulk) Save

func (rcb *RedemptionCreateBulk) Save(ctx context.Context) ([]*Redemption, error)

Save creates the Redemption entities in the database.

func (*RedemptionCreateBulk) SaveX

func (rcb *RedemptionCreateBulk) SaveX(ctx context.Context) []*Redemption

SaveX is like Save, but panics if an error occurs.

type RedemptionDelete

type RedemptionDelete struct {
	// contains filtered or unexported fields
}

RedemptionDelete is the builder for deleting a Redemption entity.

func (*RedemptionDelete) Exec

func (rd *RedemptionDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*RedemptionDelete) ExecX

func (rd *RedemptionDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*RedemptionDelete) Where

Where appends a list predicates to the RedemptionDelete builder.

type RedemptionDeleteOne

type RedemptionDeleteOne struct {
	// contains filtered or unexported fields
}

RedemptionDeleteOne is the builder for deleting a single Redemption entity.

func (*RedemptionDeleteOne) Exec

func (rdo *RedemptionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*RedemptionDeleteOne) ExecX

func (rdo *RedemptionDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RedemptionDeleteOne) Where

Where appends a list predicates to the RedemptionDelete builder.

type RedemptionEdges

type RedemptionEdges struct {
	// Voucher holds the value of the voucher edge.
	Voucher *Voucher `json:"voucher,omitempty"`
	// Accessory holds the value of the accessory edge.
	Accessory *Accessory `json:"accessory,omitempty"`
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// contains filtered or unexported fields
}

RedemptionEdges holds the relations/edges for other nodes in the graph.

func (RedemptionEdges) AccessoryOrErr

func (e RedemptionEdges) AccessoryOrErr() (*Accessory, error)

AccessoryOrErr returns the Accessory value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (RedemptionEdges) UserOrErr

func (e RedemptionEdges) UserOrErr() (*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (RedemptionEdges) VoucherOrErr

func (e RedemptionEdges) VoucherOrErr() (*Voucher, error)

VoucherOrErr returns the Voucher value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type RedemptionGroupBy

type RedemptionGroupBy struct {
	// contains filtered or unexported fields
}

RedemptionGroupBy is the group-by builder for Redemption entities.

func (*RedemptionGroupBy) Aggregate

func (rgb *RedemptionGroupBy) Aggregate(fns ...AggregateFunc) *RedemptionGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*RedemptionGroupBy) Bool

func (s *RedemptionGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RedemptionGroupBy) BoolX

func (s *RedemptionGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RedemptionGroupBy) Bools

func (s *RedemptionGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RedemptionGroupBy) BoolsX

func (s *RedemptionGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RedemptionGroupBy) Float64

func (s *RedemptionGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RedemptionGroupBy) Float64X

func (s *RedemptionGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RedemptionGroupBy) Float64s

func (s *RedemptionGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RedemptionGroupBy) Float64sX

func (s *RedemptionGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RedemptionGroupBy) Int

func (s *RedemptionGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RedemptionGroupBy) IntX

func (s *RedemptionGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RedemptionGroupBy) Ints

func (s *RedemptionGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RedemptionGroupBy) IntsX

func (s *RedemptionGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RedemptionGroupBy) Scan

func (rgb *RedemptionGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*RedemptionGroupBy) ScanX

func (s *RedemptionGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*RedemptionGroupBy) String

func (s *RedemptionGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RedemptionGroupBy) StringX

func (s *RedemptionGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RedemptionGroupBy) Strings

func (s *RedemptionGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RedemptionGroupBy) StringsX

func (s *RedemptionGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RedemptionMutation

type RedemptionMutation struct {
	// contains filtered or unexported fields
}

RedemptionMutation represents an operation that mutates the Redemption nodes in the graph.

func (*RedemptionMutation) AccessoryCleared

func (m *RedemptionMutation) AccessoryCleared() bool

AccessoryCleared reports if the "accessory" edge to the Accessory entity was cleared.

func (*RedemptionMutation) AccessoryID

func (m *RedemptionMutation) AccessoryID() (id int, exists bool)

AccessoryID returns the "accessory" edge ID in the mutation.

func (*RedemptionMutation) AccessoryIDs

func (m *RedemptionMutation) AccessoryIDs() (ids []int)

AccessoryIDs returns the "accessory" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use AccessoryID instead. It exists only for internal usage by the builders.

func (*RedemptionMutation) AddField

func (m *RedemptionMutation) 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 (*RedemptionMutation) AddedEdges

func (m *RedemptionMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*RedemptionMutation) AddedField

func (m *RedemptionMutation) 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 (*RedemptionMutation) AddedFields

func (m *RedemptionMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*RedemptionMutation) AddedIDs

func (m *RedemptionMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*RedemptionMutation) ClearAccessory

func (m *RedemptionMutation) ClearAccessory()

ClearAccessory clears the "accessory" edge to the Accessory entity.

func (*RedemptionMutation) ClearEdge

func (m *RedemptionMutation) 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 (*RedemptionMutation) ClearField

func (m *RedemptionMutation) 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 (*RedemptionMutation) ClearUser

func (m *RedemptionMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*RedemptionMutation) ClearVoucher

func (m *RedemptionMutation) ClearVoucher()

ClearVoucher clears the "voucher" edge to the Voucher entity.

func (*RedemptionMutation) ClearedEdges

func (m *RedemptionMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*RedemptionMutation) ClearedFields

func (m *RedemptionMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (RedemptionMutation) Client

func (m RedemptionMutation) 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 (*RedemptionMutation) EdgeCleared

func (m *RedemptionMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*RedemptionMutation) Field

func (m *RedemptionMutation) 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 (*RedemptionMutation) FieldCleared

func (m *RedemptionMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*RedemptionMutation) Fields

func (m *RedemptionMutation) 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 (*RedemptionMutation) ID

func (m *RedemptionMutation) ID() (id int, 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 (*RedemptionMutation) IDs

func (m *RedemptionMutation) IDs(ctx context.Context) ([]int, 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 (*RedemptionMutation) OldField

func (m *RedemptionMutation) 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 (*RedemptionMutation) OldRedeemedAt

func (m *RedemptionMutation) OldRedeemedAt(ctx context.Context) (v time.Time, err error)

OldRedeemedAt returns the old "redeemed_at" field's value of the Redemption entity. If the Redemption 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 (*RedemptionMutation) Op

func (m *RedemptionMutation) Op() Op

Op returns the operation name.

func (*RedemptionMutation) RedeemedAt

func (m *RedemptionMutation) RedeemedAt() (r time.Time, exists bool)

RedeemedAt returns the value of the "redeemed_at" field in the mutation.

func (*RedemptionMutation) RemovedEdges

func (m *RedemptionMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*RedemptionMutation) RemovedIDs

func (m *RedemptionMutation) 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 (*RedemptionMutation) ResetAccessory

func (m *RedemptionMutation) ResetAccessory()

ResetAccessory resets all changes to the "accessory" edge.

func (*RedemptionMutation) ResetEdge

func (m *RedemptionMutation) 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 (*RedemptionMutation) ResetField

func (m *RedemptionMutation) 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 (*RedemptionMutation) ResetRedeemedAt

func (m *RedemptionMutation) ResetRedeemedAt()

ResetRedeemedAt resets all changes to the "redeemed_at" field.

func (*RedemptionMutation) ResetUser

func (m *RedemptionMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*RedemptionMutation) ResetVoucher

func (m *RedemptionMutation) ResetVoucher()

ResetVoucher resets all changes to the "voucher" edge.

func (*RedemptionMutation) SetAccessoryID

func (m *RedemptionMutation) SetAccessoryID(id int)

SetAccessoryID sets the "accessory" edge to the Accessory entity by id.

func (*RedemptionMutation) SetField

func (m *RedemptionMutation) 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 (*RedemptionMutation) SetOp

func (m *RedemptionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*RedemptionMutation) SetRedeemedAt

func (m *RedemptionMutation) SetRedeemedAt(t time.Time)

SetRedeemedAt sets the "redeemed_at" field.

func (*RedemptionMutation) SetUserID

func (m *RedemptionMutation) SetUserID(id int)

SetUserID sets the "user" edge to the User entity by id.

func (*RedemptionMutation) SetVoucherID

func (m *RedemptionMutation) SetVoucherID(id int)

SetVoucherID sets the "voucher" edge to the Voucher entity by id.

func (RedemptionMutation) Tx

func (m RedemptionMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*RedemptionMutation) Type

func (m *RedemptionMutation) Type() string

Type returns the node type of this mutation (Redemption).

func (*RedemptionMutation) UserCleared

func (m *RedemptionMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*RedemptionMutation) UserID

func (m *RedemptionMutation) UserID() (id int, exists bool)

UserID returns the "user" edge ID in the mutation.

func (*RedemptionMutation) UserIDs

func (m *RedemptionMutation) UserIDs() (ids []int)

UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

func (*RedemptionMutation) VoucherCleared

func (m *RedemptionMutation) VoucherCleared() bool

VoucherCleared reports if the "voucher" edge to the Voucher entity was cleared.

func (*RedemptionMutation) VoucherID

func (m *RedemptionMutation) VoucherID() (id int, exists bool)

VoucherID returns the "voucher" edge ID in the mutation.

func (*RedemptionMutation) VoucherIDs

func (m *RedemptionMutation) VoucherIDs() (ids []int)

VoucherIDs returns the "voucher" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use VoucherID instead. It exists only for internal usage by the builders.

func (*RedemptionMutation) Where

func (m *RedemptionMutation) Where(ps ...predicate.Redemption)

Where appends a list predicates to the RedemptionMutation builder.

func (*RedemptionMutation) WhereP

func (m *RedemptionMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the RedemptionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type RedemptionQuery

type RedemptionQuery struct {
	// contains filtered or unexported fields
}

RedemptionQuery is the builder for querying Redemption entities.

func (*RedemptionQuery) Aggregate

func (rq *RedemptionQuery) Aggregate(fns ...AggregateFunc) *RedemptionSelect

Aggregate returns a RedemptionSelect configured with the given aggregations.

func (*RedemptionQuery) All

func (rq *RedemptionQuery) All(ctx context.Context) ([]*Redemption, error)

All executes the query and returns a list of Redemptions.

func (*RedemptionQuery) AllX

func (rq *RedemptionQuery) AllX(ctx context.Context) []*Redemption

AllX is like All, but panics if an error occurs.

func (*RedemptionQuery) Clone

func (rq *RedemptionQuery) Clone() *RedemptionQuery

Clone returns a duplicate of the RedemptionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*RedemptionQuery) Count

func (rq *RedemptionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RedemptionQuery) CountX

func (rq *RedemptionQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*RedemptionQuery) Exist

func (rq *RedemptionQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*RedemptionQuery) ExistX

func (rq *RedemptionQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*RedemptionQuery) First

func (rq *RedemptionQuery) First(ctx context.Context) (*Redemption, error)

First returns the first Redemption entity from the query. Returns a *NotFoundError when no Redemption was found.

func (*RedemptionQuery) FirstID

func (rq *RedemptionQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Redemption ID from the query. Returns a *NotFoundError when no Redemption ID was found.

func (*RedemptionQuery) FirstIDX

func (rq *RedemptionQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*RedemptionQuery) FirstX

func (rq *RedemptionQuery) FirstX(ctx context.Context) *Redemption

FirstX is like First, but panics if an error occurs.

func (*RedemptionQuery) GroupBy

func (rq *RedemptionQuery) GroupBy(field string, fields ...string) *RedemptionGroupBy

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 {
	RedeemedAt time.Time `json:"redeemed_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Redemption.Query().
	GroupBy(redemption.FieldRedeemedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*RedemptionQuery) IDs

func (rq *RedemptionQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Redemption IDs.

func (*RedemptionQuery) IDsX

func (rq *RedemptionQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*RedemptionQuery) Limit

func (rq *RedemptionQuery) Limit(limit int) *RedemptionQuery

Limit the number of records to be returned by this query.

func (*RedemptionQuery) Offset

func (rq *RedemptionQuery) Offset(offset int) *RedemptionQuery

Offset to start from.

func (*RedemptionQuery) Only

func (rq *RedemptionQuery) Only(ctx context.Context) (*Redemption, error)

Only returns a single Redemption entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Redemption entity is found. Returns a *NotFoundError when no Redemption entities are found.

func (*RedemptionQuery) OnlyID

func (rq *RedemptionQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Redemption ID in the query. Returns a *NotSingularError when more than one Redemption ID is found. Returns a *NotFoundError when no entities are found.

func (*RedemptionQuery) OnlyIDX

func (rq *RedemptionQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*RedemptionQuery) OnlyX

func (rq *RedemptionQuery) OnlyX(ctx context.Context) *Redemption

OnlyX is like Only, but panics if an error occurs.

func (*RedemptionQuery) Order

Order specifies how the records should be ordered.

func (*RedemptionQuery) QueryAccessory

func (rq *RedemptionQuery) QueryAccessory() *AccessoryQuery

QueryAccessory chains the current query on the "accessory" edge.

func (*RedemptionQuery) QueryUser

func (rq *RedemptionQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*RedemptionQuery) QueryVoucher

func (rq *RedemptionQuery) QueryVoucher() *VoucherQuery

QueryVoucher chains the current query on the "voucher" edge.

func (*RedemptionQuery) Select

func (rq *RedemptionQuery) Select(fields ...string) *RedemptionSelect

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 {
	RedeemedAt time.Time `json:"redeemed_at,omitempty"`
}

client.Redemption.Query().
	Select(redemption.FieldRedeemedAt).
	Scan(ctx, &v)

func (*RedemptionQuery) Unique

func (rq *RedemptionQuery) Unique(unique bool) *RedemptionQuery

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 (*RedemptionQuery) Where

Where adds a new predicate for the RedemptionQuery builder.

func (*RedemptionQuery) WithAccessory

func (rq *RedemptionQuery) WithAccessory(opts ...func(*AccessoryQuery)) *RedemptionQuery

WithAccessory tells the query-builder to eager-load the nodes that are connected to the "accessory" edge. The optional arguments are used to configure the query builder of the edge.

func (*RedemptionQuery) WithUser

func (rq *RedemptionQuery) WithUser(opts ...func(*UserQuery)) *RedemptionQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

func (*RedemptionQuery) WithVoucher

func (rq *RedemptionQuery) WithVoucher(opts ...func(*VoucherQuery)) *RedemptionQuery

WithVoucher tells the query-builder to eager-load the nodes that are connected to the "voucher" edge. The optional arguments are used to configure the query builder of the edge.

type RedemptionSelect

type RedemptionSelect struct {
	*RedemptionQuery
	// contains filtered or unexported fields
}

RedemptionSelect is the builder for selecting fields of Redemption entities.

func (*RedemptionSelect) Aggregate

func (rs *RedemptionSelect) Aggregate(fns ...AggregateFunc) *RedemptionSelect

Aggregate adds the given aggregation functions to the selector query.

func (*RedemptionSelect) Bool

func (s *RedemptionSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RedemptionSelect) BoolX

func (s *RedemptionSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RedemptionSelect) Bools

func (s *RedemptionSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RedemptionSelect) BoolsX

func (s *RedemptionSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RedemptionSelect) Float64

func (s *RedemptionSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RedemptionSelect) Float64X

func (s *RedemptionSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RedemptionSelect) Float64s

func (s *RedemptionSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RedemptionSelect) Float64sX

func (s *RedemptionSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RedemptionSelect) Int

func (s *RedemptionSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RedemptionSelect) IntX

func (s *RedemptionSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RedemptionSelect) Ints

func (s *RedemptionSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RedemptionSelect) IntsX

func (s *RedemptionSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RedemptionSelect) Scan

func (rs *RedemptionSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*RedemptionSelect) ScanX

func (s *RedemptionSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*RedemptionSelect) String

func (s *RedemptionSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RedemptionSelect) StringX

func (s *RedemptionSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RedemptionSelect) Strings

func (s *RedemptionSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RedemptionSelect) StringsX

func (s *RedemptionSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RedemptionUpdate

type RedemptionUpdate struct {
	// contains filtered or unexported fields
}

RedemptionUpdate is the builder for updating Redemption entities.

func (*RedemptionUpdate) ClearAccessory

func (ru *RedemptionUpdate) ClearAccessory() *RedemptionUpdate

ClearAccessory clears the "accessory" edge to the Accessory entity.

func (*RedemptionUpdate) ClearUser

func (ru *RedemptionUpdate) ClearUser() *RedemptionUpdate

ClearUser clears the "user" edge to the User entity.

func (*RedemptionUpdate) ClearVoucher

func (ru *RedemptionUpdate) ClearVoucher() *RedemptionUpdate

ClearVoucher clears the "voucher" edge to the Voucher entity.

func (*RedemptionUpdate) Exec

func (ru *RedemptionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*RedemptionUpdate) ExecX

func (ru *RedemptionUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RedemptionUpdate) Mutation

func (ru *RedemptionUpdate) Mutation() *RedemptionMutation

Mutation returns the RedemptionMutation object of the builder.

func (*RedemptionUpdate) Save

func (ru *RedemptionUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*RedemptionUpdate) SaveX

func (ru *RedemptionUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*RedemptionUpdate) SetAccessory

func (ru *RedemptionUpdate) SetAccessory(a *Accessory) *RedemptionUpdate

SetAccessory sets the "accessory" edge to the Accessory entity.

func (*RedemptionUpdate) SetAccessoryID

func (ru *RedemptionUpdate) SetAccessoryID(id int) *RedemptionUpdate

SetAccessoryID sets the "accessory" edge to the Accessory entity by ID.

func (*RedemptionUpdate) SetNillableAccessoryID

func (ru *RedemptionUpdate) SetNillableAccessoryID(id *int) *RedemptionUpdate

SetNillableAccessoryID sets the "accessory" edge to the Accessory entity by ID if the given value is not nil.

func (*RedemptionUpdate) SetNillableVoucherID

func (ru *RedemptionUpdate) SetNillableVoucherID(id *int) *RedemptionUpdate

SetNillableVoucherID sets the "voucher" edge to the Voucher entity by ID if the given value is not nil.

func (*RedemptionUpdate) SetRedeemedAt

func (ru *RedemptionUpdate) SetRedeemedAt(t time.Time) *RedemptionUpdate

SetRedeemedAt sets the "redeemed_at" field.

func (*RedemptionUpdate) SetUser

func (ru *RedemptionUpdate) SetUser(u *User) *RedemptionUpdate

SetUser sets the "user" edge to the User entity.

func (*RedemptionUpdate) SetUserID

func (ru *RedemptionUpdate) SetUserID(id int) *RedemptionUpdate

SetUserID sets the "user" edge to the User entity by ID.

func (*RedemptionUpdate) SetVoucher

func (ru *RedemptionUpdate) SetVoucher(v *Voucher) *RedemptionUpdate

SetVoucher sets the "voucher" edge to the Voucher entity.

func (*RedemptionUpdate) SetVoucherID

func (ru *RedemptionUpdate) SetVoucherID(id int) *RedemptionUpdate

SetVoucherID sets the "voucher" edge to the Voucher entity by ID.

func (*RedemptionUpdate) Where

Where appends a list predicates to the RedemptionUpdate builder.

type RedemptionUpdateOne

type RedemptionUpdateOne struct {
	// contains filtered or unexported fields
}

RedemptionUpdateOne is the builder for updating a single Redemption entity.

func (*RedemptionUpdateOne) ClearAccessory

func (ruo *RedemptionUpdateOne) ClearAccessory() *RedemptionUpdateOne

ClearAccessory clears the "accessory" edge to the Accessory entity.

func (*RedemptionUpdateOne) ClearUser

func (ruo *RedemptionUpdateOne) ClearUser() *RedemptionUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*RedemptionUpdateOne) ClearVoucher

func (ruo *RedemptionUpdateOne) ClearVoucher() *RedemptionUpdateOne

ClearVoucher clears the "voucher" edge to the Voucher entity.

func (*RedemptionUpdateOne) Exec

func (ruo *RedemptionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*RedemptionUpdateOne) ExecX

func (ruo *RedemptionUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RedemptionUpdateOne) Mutation

func (ruo *RedemptionUpdateOne) Mutation() *RedemptionMutation

Mutation returns the RedemptionMutation object of the builder.

func (*RedemptionUpdateOne) Save

func (ruo *RedemptionUpdateOne) Save(ctx context.Context) (*Redemption, error)

Save executes the query and returns the updated Redemption entity.

func (*RedemptionUpdateOne) SaveX

func (ruo *RedemptionUpdateOne) SaveX(ctx context.Context) *Redemption

SaveX is like Save, but panics if an error occurs.

func (*RedemptionUpdateOne) Select

func (ruo *RedemptionUpdateOne) Select(field string, fields ...string) *RedemptionUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*RedemptionUpdateOne) SetAccessory

func (ruo *RedemptionUpdateOne) SetAccessory(a *Accessory) *RedemptionUpdateOne

SetAccessory sets the "accessory" edge to the Accessory entity.

func (*RedemptionUpdateOne) SetAccessoryID

func (ruo *RedemptionUpdateOne) SetAccessoryID(id int) *RedemptionUpdateOne

SetAccessoryID sets the "accessory" edge to the Accessory entity by ID.

func (*RedemptionUpdateOne) SetNillableAccessoryID

func (ruo *RedemptionUpdateOne) SetNillableAccessoryID(id *int) *RedemptionUpdateOne

SetNillableAccessoryID sets the "accessory" edge to the Accessory entity by ID if the given value is not nil.

func (*RedemptionUpdateOne) SetNillableVoucherID

func (ruo *RedemptionUpdateOne) SetNillableVoucherID(id *int) *RedemptionUpdateOne

SetNillableVoucherID sets the "voucher" edge to the Voucher entity by ID if the given value is not nil.

func (*RedemptionUpdateOne) SetRedeemedAt

func (ruo *RedemptionUpdateOne) SetRedeemedAt(t time.Time) *RedemptionUpdateOne

SetRedeemedAt sets the "redeemed_at" field.

func (*RedemptionUpdateOne) SetUser

func (ruo *RedemptionUpdateOne) SetUser(u *User) *RedemptionUpdateOne

SetUser sets the "user" edge to the User entity.

func (*RedemptionUpdateOne) SetUserID

func (ruo *RedemptionUpdateOne) SetUserID(id int) *RedemptionUpdateOne

SetUserID sets the "user" edge to the User entity by ID.

func (*RedemptionUpdateOne) SetVoucher

func (ruo *RedemptionUpdateOne) SetVoucher(v *Voucher) *RedemptionUpdateOne

SetVoucher sets the "voucher" edge to the Voucher entity.

func (*RedemptionUpdateOne) SetVoucherID

func (ruo *RedemptionUpdateOne) SetVoucherID(id int) *RedemptionUpdateOne

SetVoucherID sets the "voucher" edge to the Voucher entity by ID.

func (*RedemptionUpdateOne) Where

Where appends a list predicates to the RedemptionUpdate builder.

type RedemptionUpsert

type RedemptionUpsert struct {
	*sql.UpdateSet
}

RedemptionUpsert is the "OnConflict" setter.

func (*RedemptionUpsert) SetRedeemedAt

func (u *RedemptionUpsert) SetRedeemedAt(v time.Time) *RedemptionUpsert

SetRedeemedAt sets the "redeemed_at" field.

func (*RedemptionUpsert) UpdateRedeemedAt

func (u *RedemptionUpsert) UpdateRedeemedAt() *RedemptionUpsert

UpdateRedeemedAt sets the "redeemed_at" field to the value that was provided on create.

type RedemptionUpsertBulk

type RedemptionUpsertBulk struct {
	// contains filtered or unexported fields
}

RedemptionUpsertBulk is the builder for "upsert"-ing a bulk of Redemption nodes.

func (*RedemptionUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*RedemptionUpsertBulk) Exec

Exec executes the query.

func (*RedemptionUpsertBulk) ExecX

func (u *RedemptionUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RedemptionUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Redemption.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*RedemptionUpsertBulk) SetRedeemedAt

func (u *RedemptionUpsertBulk) SetRedeemedAt(v time.Time) *RedemptionUpsertBulk

SetRedeemedAt sets the "redeemed_at" field.

func (*RedemptionUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the RedemptionCreateBulk.OnConflict documentation for more info.

func (*RedemptionUpsertBulk) UpdateNewValues

func (u *RedemptionUpsertBulk) UpdateNewValues() *RedemptionUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Redemption.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*RedemptionUpsertBulk) UpdateRedeemedAt

func (u *RedemptionUpsertBulk) UpdateRedeemedAt() *RedemptionUpsertBulk

UpdateRedeemedAt sets the "redeemed_at" field to the value that was provided on create.

type RedemptionUpsertOne

type RedemptionUpsertOne struct {
	// contains filtered or unexported fields
}

RedemptionUpsertOne is the builder for "upsert"-ing

one Redemption node.

func (*RedemptionUpsertOne) DoNothing

func (u *RedemptionUpsertOne) DoNothing() *RedemptionUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*RedemptionUpsertOne) Exec

Exec executes the query.

func (*RedemptionUpsertOne) ExecX

func (u *RedemptionUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RedemptionUpsertOne) ID

func (u *RedemptionUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*RedemptionUpsertOne) IDX

func (u *RedemptionUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*RedemptionUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Redemption.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*RedemptionUpsertOne) SetRedeemedAt

func (u *RedemptionUpsertOne) SetRedeemedAt(v time.Time) *RedemptionUpsertOne

SetRedeemedAt sets the "redeemed_at" field.

func (*RedemptionUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the RedemptionCreate.OnConflict documentation for more info.

func (*RedemptionUpsertOne) UpdateNewValues

func (u *RedemptionUpsertOne) UpdateNewValues() *RedemptionUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Redemption.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*RedemptionUpsertOne) UpdateRedeemedAt

func (u *RedemptionUpsertOne) UpdateRedeemedAt() *RedemptionUpsertOne

UpdateRedeemedAt sets the "redeemed_at" field to the value that was provided on create.

type Redemptions

type Redemptions []*Redemption

Redemptions is a parsable slice of Redemption.

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 StudyPlan

type StudyPlan struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name of the study plan
	Name string `json:"name,omitempty"`
	// Code for sharing the study plan
	Code string `json:"code,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the StudyPlanQuery when eager-loading is set.
	Edges StudyPlanEdges `json:"edges"`
	// contains filtered or unexported fields
}

StudyPlan is the model entity for the StudyPlan schema.

func (*StudyPlan) QueryAuthor

func (sp *StudyPlan) QueryAuthor() *UserQuery

QueryAuthor queries the "author" edge of the StudyPlan entity.

func (*StudyPlan) QueryMilestones

func (sp *StudyPlan) QueryMilestones() *MilestoneQuery

QueryMilestones queries the "milestones" edge of the StudyPlan entity.

func (*StudyPlan) String

func (sp *StudyPlan) String() string

String implements the fmt.Stringer.

func (*StudyPlan) Unwrap

func (sp *StudyPlan) Unwrap() *StudyPlan

Unwrap unwraps the StudyPlan 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 (*StudyPlan) Update

func (sp *StudyPlan) Update() *StudyPlanUpdateOne

Update returns a builder for updating this StudyPlan. Note that you need to call StudyPlan.Unwrap() before calling this method if this StudyPlan was returned from a transaction, and the transaction was committed or rolled back.

func (*StudyPlan) Value

func (sp *StudyPlan) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the StudyPlan. This includes values selected through modifiers, order, etc.

type StudyPlanClient

type StudyPlanClient struct {
	// contains filtered or unexported fields
}

StudyPlanClient is a client for the StudyPlan schema.

func NewStudyPlanClient

func NewStudyPlanClient(c config) *StudyPlanClient

NewStudyPlanClient returns a client for the StudyPlan from the given config.

func (*StudyPlanClient) Create

func (c *StudyPlanClient) Create() *StudyPlanCreate

Create returns a builder for creating a StudyPlan entity.

func (*StudyPlanClient) CreateBulk

func (c *StudyPlanClient) CreateBulk(builders ...*StudyPlanCreate) *StudyPlanCreateBulk

CreateBulk returns a builder for creating a bulk of StudyPlan entities.

func (*StudyPlanClient) Delete

func (c *StudyPlanClient) Delete() *StudyPlanDelete

Delete returns a delete builder for StudyPlan.

func (*StudyPlanClient) DeleteOne

func (c *StudyPlanClient) DeleteOne(sp *StudyPlan) *StudyPlanDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*StudyPlanClient) DeleteOneID

func (c *StudyPlanClient) DeleteOneID(id int) *StudyPlanDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*StudyPlanClient) Get

func (c *StudyPlanClient) Get(ctx context.Context, id int) (*StudyPlan, error)

Get returns a StudyPlan entity by its id.

func (*StudyPlanClient) GetX

func (c *StudyPlanClient) GetX(ctx context.Context, id int) *StudyPlan

GetX is like Get, but panics if an error occurs.

func (*StudyPlanClient) Hooks

func (c *StudyPlanClient) Hooks() []Hook

Hooks returns the client hooks.

func (*StudyPlanClient) Intercept

func (c *StudyPlanClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `studyplan.Intercept(f(g(h())))`.

func (*StudyPlanClient) Interceptors

func (c *StudyPlanClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*StudyPlanClient) Query

func (c *StudyPlanClient) Query() *StudyPlanQuery

Query returns a query builder for StudyPlan.

func (*StudyPlanClient) QueryAuthor

func (c *StudyPlanClient) QueryAuthor(sp *StudyPlan) *UserQuery

QueryAuthor queries the author edge of a StudyPlan.

func (*StudyPlanClient) QueryMilestones

func (c *StudyPlanClient) QueryMilestones(sp *StudyPlan) *MilestoneQuery

QueryMilestones queries the milestones edge of a StudyPlan.

func (*StudyPlanClient) Update

func (c *StudyPlanClient) Update() *StudyPlanUpdate

Update returns an update builder for StudyPlan.

func (*StudyPlanClient) UpdateOne

func (c *StudyPlanClient) UpdateOne(sp *StudyPlan) *StudyPlanUpdateOne

UpdateOne returns an update builder for the given entity.

func (*StudyPlanClient) UpdateOneID

func (c *StudyPlanClient) UpdateOneID(id int) *StudyPlanUpdateOne

UpdateOneID returns an update builder for the given id.

func (*StudyPlanClient) Use

func (c *StudyPlanClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `studyplan.Hooks(f(g(h())))`.

type StudyPlanCreate

type StudyPlanCreate struct {
	// contains filtered or unexported fields
}

StudyPlanCreate is the builder for creating a StudyPlan entity.

func (*StudyPlanCreate) AddMilestoneIDs

func (spc *StudyPlanCreate) AddMilestoneIDs(ids ...int) *StudyPlanCreate

AddMilestoneIDs adds the "milestones" edge to the Milestone entity by IDs.

func (*StudyPlanCreate) AddMilestones

func (spc *StudyPlanCreate) AddMilestones(m ...*Milestone) *StudyPlanCreate

AddMilestones adds the "milestones" edges to the Milestone entity.

func (*StudyPlanCreate) Exec

func (spc *StudyPlanCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*StudyPlanCreate) ExecX

func (spc *StudyPlanCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StudyPlanCreate) Mutation

func (spc *StudyPlanCreate) Mutation() *StudyPlanMutation

Mutation returns the StudyPlanMutation object of the builder.

func (*StudyPlanCreate) OnConflict

func (spc *StudyPlanCreate) OnConflict(opts ...sql.ConflictOption) *StudyPlanUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.StudyPlan.Create().
	SetName(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.StudyPlanUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*StudyPlanCreate) OnConflictColumns

func (spc *StudyPlanCreate) OnConflictColumns(columns ...string) *StudyPlanUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.StudyPlan.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*StudyPlanCreate) Save

func (spc *StudyPlanCreate) Save(ctx context.Context) (*StudyPlan, error)

Save creates the StudyPlan in the database.

func (*StudyPlanCreate) SaveX

func (spc *StudyPlanCreate) SaveX(ctx context.Context) *StudyPlan

SaveX calls Save and panics if Save returns an error.

func (*StudyPlanCreate) SetAuthor

func (spc *StudyPlanCreate) SetAuthor(u *User) *StudyPlanCreate

SetAuthor sets the "author" edge to the User entity.

func (*StudyPlanCreate) SetAuthorID

func (spc *StudyPlanCreate) SetAuthorID(id int) *StudyPlanCreate

SetAuthorID sets the "author" edge to the User entity by ID.

func (*StudyPlanCreate) SetCode

func (spc *StudyPlanCreate) SetCode(s string) *StudyPlanCreate

SetCode sets the "code" field.

func (*StudyPlanCreate) SetName

func (spc *StudyPlanCreate) SetName(s string) *StudyPlanCreate

SetName sets the "name" field.

func (*StudyPlanCreate) SetNillableCode

func (spc *StudyPlanCreate) SetNillableCode(s *string) *StudyPlanCreate

SetNillableCode sets the "code" field if the given value is not nil.

type StudyPlanCreateBulk

type StudyPlanCreateBulk struct {
	// contains filtered or unexported fields
}

StudyPlanCreateBulk is the builder for creating many StudyPlan entities in bulk.

func (*StudyPlanCreateBulk) Exec

func (spcb *StudyPlanCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*StudyPlanCreateBulk) ExecX

func (spcb *StudyPlanCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StudyPlanCreateBulk) OnConflict

func (spcb *StudyPlanCreateBulk) OnConflict(opts ...sql.ConflictOption) *StudyPlanUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.StudyPlan.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.StudyPlanUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*StudyPlanCreateBulk) OnConflictColumns

func (spcb *StudyPlanCreateBulk) OnConflictColumns(columns ...string) *StudyPlanUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.StudyPlan.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*StudyPlanCreateBulk) Save

func (spcb *StudyPlanCreateBulk) Save(ctx context.Context) ([]*StudyPlan, error)

Save creates the StudyPlan entities in the database.

func (*StudyPlanCreateBulk) SaveX

func (spcb *StudyPlanCreateBulk) SaveX(ctx context.Context) []*StudyPlan

SaveX is like Save, but panics if an error occurs.

type StudyPlanDelete

type StudyPlanDelete struct {
	// contains filtered or unexported fields
}

StudyPlanDelete is the builder for deleting a StudyPlan entity.

func (*StudyPlanDelete) Exec

func (spd *StudyPlanDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*StudyPlanDelete) ExecX

func (spd *StudyPlanDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*StudyPlanDelete) Where

Where appends a list predicates to the StudyPlanDelete builder.

type StudyPlanDeleteOne

type StudyPlanDeleteOne struct {
	// contains filtered or unexported fields
}

StudyPlanDeleteOne is the builder for deleting a single StudyPlan entity.

func (*StudyPlanDeleteOne) Exec

func (spdo *StudyPlanDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*StudyPlanDeleteOne) ExecX

func (spdo *StudyPlanDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StudyPlanDeleteOne) Where

Where appends a list predicates to the StudyPlanDelete builder.

type StudyPlanEdges

type StudyPlanEdges struct {
	// Author of the study plan
	Author *User `json:"author,omitempty"`
	// Milestones of the study plan
	Milestones []*Milestone `json:"milestones,omitempty"`
	// contains filtered or unexported fields
}

StudyPlanEdges holds the relations/edges for other nodes in the graph.

func (StudyPlanEdges) AuthorOrErr

func (e StudyPlanEdges) AuthorOrErr() (*User, error)

AuthorOrErr returns the Author value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (StudyPlanEdges) MilestonesOrErr

func (e StudyPlanEdges) MilestonesOrErr() ([]*Milestone, error)

MilestonesOrErr returns the Milestones value or an error if the edge was not loaded in eager-loading.

type StudyPlanGroupBy

type StudyPlanGroupBy struct {
	// contains filtered or unexported fields
}

StudyPlanGroupBy is the group-by builder for StudyPlan entities.

func (*StudyPlanGroupBy) Aggregate

func (spgb *StudyPlanGroupBy) Aggregate(fns ...AggregateFunc) *StudyPlanGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*StudyPlanGroupBy) Bool

func (s *StudyPlanGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*StudyPlanGroupBy) BoolX

func (s *StudyPlanGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*StudyPlanGroupBy) Bools

func (s *StudyPlanGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*StudyPlanGroupBy) BoolsX

func (s *StudyPlanGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*StudyPlanGroupBy) Float64

func (s *StudyPlanGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*StudyPlanGroupBy) Float64X

func (s *StudyPlanGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*StudyPlanGroupBy) Float64s

func (s *StudyPlanGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*StudyPlanGroupBy) Float64sX

func (s *StudyPlanGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*StudyPlanGroupBy) Int

func (s *StudyPlanGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*StudyPlanGroupBy) IntX

func (s *StudyPlanGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*StudyPlanGroupBy) Ints

func (s *StudyPlanGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*StudyPlanGroupBy) IntsX

func (s *StudyPlanGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*StudyPlanGroupBy) Scan

func (spgb *StudyPlanGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*StudyPlanGroupBy) ScanX

func (s *StudyPlanGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*StudyPlanGroupBy) String

func (s *StudyPlanGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*StudyPlanGroupBy) StringX

func (s *StudyPlanGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*StudyPlanGroupBy) Strings

func (s *StudyPlanGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*StudyPlanGroupBy) StringsX

func (s *StudyPlanGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type StudyPlanMutation

type StudyPlanMutation struct {
	// contains filtered or unexported fields
}

StudyPlanMutation represents an operation that mutates the StudyPlan nodes in the graph.

func (*StudyPlanMutation) AddField

func (m *StudyPlanMutation) 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 (*StudyPlanMutation) AddMilestoneIDs

func (m *StudyPlanMutation) AddMilestoneIDs(ids ...int)

AddMilestoneIDs adds the "milestones" edge to the Milestone entity by ids.

func (*StudyPlanMutation) AddedEdges

func (m *StudyPlanMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*StudyPlanMutation) AddedField

func (m *StudyPlanMutation) 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 (*StudyPlanMutation) AddedFields

func (m *StudyPlanMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*StudyPlanMutation) AddedIDs

func (m *StudyPlanMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*StudyPlanMutation) AuthorCleared

func (m *StudyPlanMutation) AuthorCleared() bool

AuthorCleared reports if the "author" edge to the User entity was cleared.

func (*StudyPlanMutation) AuthorID

func (m *StudyPlanMutation) AuthorID() (id int, exists bool)

AuthorID returns the "author" edge ID in the mutation.

func (*StudyPlanMutation) AuthorIDs

func (m *StudyPlanMutation) AuthorIDs() (ids []int)

AuthorIDs returns the "author" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use AuthorID instead. It exists only for internal usage by the builders.

func (*StudyPlanMutation) ClearAuthor

func (m *StudyPlanMutation) ClearAuthor()

ClearAuthor clears the "author" edge to the User entity.

func (*StudyPlanMutation) ClearCode

func (m *StudyPlanMutation) ClearCode()

ClearCode clears the value of the "code" field.

func (*StudyPlanMutation) ClearEdge

func (m *StudyPlanMutation) 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 (*StudyPlanMutation) ClearField

func (m *StudyPlanMutation) 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 (*StudyPlanMutation) ClearMilestones

func (m *StudyPlanMutation) ClearMilestones()

ClearMilestones clears the "milestones" edge to the Milestone entity.

func (*StudyPlanMutation) ClearedEdges

func (m *StudyPlanMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*StudyPlanMutation) ClearedFields

func (m *StudyPlanMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (StudyPlanMutation) Client

func (m StudyPlanMutation) 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 (*StudyPlanMutation) Code

func (m *StudyPlanMutation) Code() (r string, exists bool)

Code returns the value of the "code" field in the mutation.

func (*StudyPlanMutation) CodeCleared

func (m *StudyPlanMutation) CodeCleared() bool

CodeCleared returns if the "code" field was cleared in this mutation.

func (*StudyPlanMutation) EdgeCleared

func (m *StudyPlanMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*StudyPlanMutation) Field

func (m *StudyPlanMutation) 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 (*StudyPlanMutation) FieldCleared

func (m *StudyPlanMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*StudyPlanMutation) Fields

func (m *StudyPlanMutation) 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 (*StudyPlanMutation) ID

func (m *StudyPlanMutation) ID() (id int, 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 (*StudyPlanMutation) IDs

func (m *StudyPlanMutation) IDs(ctx context.Context) ([]int, 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 (*StudyPlanMutation) MilestonesCleared

func (m *StudyPlanMutation) MilestonesCleared() bool

MilestonesCleared reports if the "milestones" edge to the Milestone entity was cleared.

func (*StudyPlanMutation) MilestonesIDs

func (m *StudyPlanMutation) MilestonesIDs() (ids []int)

MilestonesIDs returns the "milestones" edge IDs in the mutation.

func (*StudyPlanMutation) Name

func (m *StudyPlanMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*StudyPlanMutation) OldCode

func (m *StudyPlanMutation) OldCode(ctx context.Context) (v string, err error)

OldCode returns the old "code" field's value of the StudyPlan entity. If the StudyPlan 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 (*StudyPlanMutation) OldField

func (m *StudyPlanMutation) 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 (*StudyPlanMutation) OldName

func (m *StudyPlanMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the StudyPlan entity. If the StudyPlan 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 (*StudyPlanMutation) Op

func (m *StudyPlanMutation) Op() Op

Op returns the operation name.

func (*StudyPlanMutation) RemoveMilestoneIDs

func (m *StudyPlanMutation) RemoveMilestoneIDs(ids ...int)

RemoveMilestoneIDs removes the "milestones" edge to the Milestone entity by IDs.

func (*StudyPlanMutation) RemovedEdges

func (m *StudyPlanMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*StudyPlanMutation) RemovedIDs

func (m *StudyPlanMutation) 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 (*StudyPlanMutation) RemovedMilestonesIDs

func (m *StudyPlanMutation) RemovedMilestonesIDs() (ids []int)

RemovedMilestones returns the removed IDs of the "milestones" edge to the Milestone entity.

func (*StudyPlanMutation) ResetAuthor

func (m *StudyPlanMutation) ResetAuthor()

ResetAuthor resets all changes to the "author" edge.

func (*StudyPlanMutation) ResetCode

func (m *StudyPlanMutation) ResetCode()

ResetCode resets all changes to the "code" field.

func (*StudyPlanMutation) ResetEdge

func (m *StudyPlanMutation) 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 (*StudyPlanMutation) ResetField

func (m *StudyPlanMutation) 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 (*StudyPlanMutation) ResetMilestones

func (m *StudyPlanMutation) ResetMilestones()

ResetMilestones resets all changes to the "milestones" edge.

func (*StudyPlanMutation) ResetName

func (m *StudyPlanMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*StudyPlanMutation) SetAuthorID

func (m *StudyPlanMutation) SetAuthorID(id int)

SetAuthorID sets the "author" edge to the User entity by id.

func (*StudyPlanMutation) SetCode

func (m *StudyPlanMutation) SetCode(s string)

SetCode sets the "code" field.

func (*StudyPlanMutation) SetField

func (m *StudyPlanMutation) 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 (*StudyPlanMutation) SetName

func (m *StudyPlanMutation) SetName(s string)

SetName sets the "name" field.

func (*StudyPlanMutation) SetOp

func (m *StudyPlanMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (StudyPlanMutation) Tx

func (m StudyPlanMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*StudyPlanMutation) Type

func (m *StudyPlanMutation) Type() string

Type returns the node type of this mutation (StudyPlan).

func (*StudyPlanMutation) Where

func (m *StudyPlanMutation) Where(ps ...predicate.StudyPlan)

Where appends a list predicates to the StudyPlanMutation builder.

func (*StudyPlanMutation) WhereP

func (m *StudyPlanMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the StudyPlanMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type StudyPlanQuery

type StudyPlanQuery struct {
	// contains filtered or unexported fields
}

StudyPlanQuery is the builder for querying StudyPlan entities.

func (*StudyPlanQuery) Aggregate

func (spq *StudyPlanQuery) Aggregate(fns ...AggregateFunc) *StudyPlanSelect

Aggregate returns a StudyPlanSelect configured with the given aggregations.

func (*StudyPlanQuery) All

func (spq *StudyPlanQuery) All(ctx context.Context) ([]*StudyPlan, error)

All executes the query and returns a list of StudyPlans.

func (*StudyPlanQuery) AllX

func (spq *StudyPlanQuery) AllX(ctx context.Context) []*StudyPlan

AllX is like All, but panics if an error occurs.

func (*StudyPlanQuery) Clone

func (spq *StudyPlanQuery) Clone() *StudyPlanQuery

Clone returns a duplicate of the StudyPlanQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*StudyPlanQuery) Count

func (spq *StudyPlanQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*StudyPlanQuery) CountX

func (spq *StudyPlanQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*StudyPlanQuery) Exist

func (spq *StudyPlanQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*StudyPlanQuery) ExistX

func (spq *StudyPlanQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*StudyPlanQuery) First

func (spq *StudyPlanQuery) First(ctx context.Context) (*StudyPlan, error)

First returns the first StudyPlan entity from the query. Returns a *NotFoundError when no StudyPlan was found.

func (*StudyPlanQuery) FirstID

func (spq *StudyPlanQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first StudyPlan ID from the query. Returns a *NotFoundError when no StudyPlan ID was found.

func (*StudyPlanQuery) FirstIDX

func (spq *StudyPlanQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*StudyPlanQuery) FirstX

func (spq *StudyPlanQuery) FirstX(ctx context.Context) *StudyPlan

FirstX is like First, but panics if an error occurs.

func (*StudyPlanQuery) GroupBy

func (spq *StudyPlanQuery) GroupBy(field string, fields ...string) *StudyPlanGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.StudyPlan.Query().
	GroupBy(studyplan.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*StudyPlanQuery) IDs

func (spq *StudyPlanQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of StudyPlan IDs.

func (*StudyPlanQuery) IDsX

func (spq *StudyPlanQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*StudyPlanQuery) Limit

func (spq *StudyPlanQuery) Limit(limit int) *StudyPlanQuery

Limit the number of records to be returned by this query.

func (*StudyPlanQuery) Offset

func (spq *StudyPlanQuery) Offset(offset int) *StudyPlanQuery

Offset to start from.

func (*StudyPlanQuery) Only

func (spq *StudyPlanQuery) Only(ctx context.Context) (*StudyPlan, error)

Only returns a single StudyPlan entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one StudyPlan entity is found. Returns a *NotFoundError when no StudyPlan entities are found.

func (*StudyPlanQuery) OnlyID

func (spq *StudyPlanQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only StudyPlan ID in the query. Returns a *NotSingularError when more than one StudyPlan ID is found. Returns a *NotFoundError when no entities are found.

func (*StudyPlanQuery) OnlyIDX

func (spq *StudyPlanQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*StudyPlanQuery) OnlyX

func (spq *StudyPlanQuery) OnlyX(ctx context.Context) *StudyPlan

OnlyX is like Only, but panics if an error occurs.

func (*StudyPlanQuery) Order

Order specifies how the records should be ordered.

func (*StudyPlanQuery) QueryAuthor

func (spq *StudyPlanQuery) QueryAuthor() *UserQuery

QueryAuthor chains the current query on the "author" edge.

func (*StudyPlanQuery) QueryMilestones

func (spq *StudyPlanQuery) QueryMilestones() *MilestoneQuery

QueryMilestones chains the current query on the "milestones" edge.

func (*StudyPlanQuery) Select

func (spq *StudyPlanQuery) Select(fields ...string) *StudyPlanSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.StudyPlan.Query().
	Select(studyplan.FieldName).
	Scan(ctx, &v)

func (*StudyPlanQuery) Unique

func (spq *StudyPlanQuery) Unique(unique bool) *StudyPlanQuery

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 (*StudyPlanQuery) Where

func (spq *StudyPlanQuery) Where(ps ...predicate.StudyPlan) *StudyPlanQuery

Where adds a new predicate for the StudyPlanQuery builder.

func (*StudyPlanQuery) WithAuthor

func (spq *StudyPlanQuery) WithAuthor(opts ...func(*UserQuery)) *StudyPlanQuery

WithAuthor tells the query-builder to eager-load the nodes that are connected to the "author" edge. The optional arguments are used to configure the query builder of the edge.

func (*StudyPlanQuery) WithMilestones

func (spq *StudyPlanQuery) WithMilestones(opts ...func(*MilestoneQuery)) *StudyPlanQuery

WithMilestones tells the query-builder to eager-load the nodes that are connected to the "milestones" edge. The optional arguments are used to configure the query builder of the edge.

type StudyPlanSelect

type StudyPlanSelect struct {
	*StudyPlanQuery
	// contains filtered or unexported fields
}

StudyPlanSelect is the builder for selecting fields of StudyPlan entities.

func (*StudyPlanSelect) Aggregate

func (sps *StudyPlanSelect) Aggregate(fns ...AggregateFunc) *StudyPlanSelect

Aggregate adds the given aggregation functions to the selector query.

func (*StudyPlanSelect) Bool

func (s *StudyPlanSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*StudyPlanSelect) BoolX

func (s *StudyPlanSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*StudyPlanSelect) Bools

func (s *StudyPlanSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*StudyPlanSelect) BoolsX

func (s *StudyPlanSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*StudyPlanSelect) Float64

func (s *StudyPlanSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*StudyPlanSelect) Float64X

func (s *StudyPlanSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*StudyPlanSelect) Float64s

func (s *StudyPlanSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*StudyPlanSelect) Float64sX

func (s *StudyPlanSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*StudyPlanSelect) Int

func (s *StudyPlanSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*StudyPlanSelect) IntX

func (s *StudyPlanSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*StudyPlanSelect) Ints

func (s *StudyPlanSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*StudyPlanSelect) IntsX

func (s *StudyPlanSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*StudyPlanSelect) Scan

func (sps *StudyPlanSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*StudyPlanSelect) ScanX

func (s *StudyPlanSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*StudyPlanSelect) String

func (s *StudyPlanSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*StudyPlanSelect) StringX

func (s *StudyPlanSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*StudyPlanSelect) Strings

func (s *StudyPlanSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*StudyPlanSelect) StringsX

func (s *StudyPlanSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type StudyPlanUpdate

type StudyPlanUpdate struct {
	// contains filtered or unexported fields
}

StudyPlanUpdate is the builder for updating StudyPlan entities.

func (*StudyPlanUpdate) AddMilestoneIDs

func (spu *StudyPlanUpdate) AddMilestoneIDs(ids ...int) *StudyPlanUpdate

AddMilestoneIDs adds the "milestones" edge to the Milestone entity by IDs.

func (*StudyPlanUpdate) AddMilestones

func (spu *StudyPlanUpdate) AddMilestones(m ...*Milestone) *StudyPlanUpdate

AddMilestones adds the "milestones" edges to the Milestone entity.

func (*StudyPlanUpdate) ClearAuthor

func (spu *StudyPlanUpdate) ClearAuthor() *StudyPlanUpdate

ClearAuthor clears the "author" edge to the User entity.

func (*StudyPlanUpdate) ClearCode

func (spu *StudyPlanUpdate) ClearCode() *StudyPlanUpdate

ClearCode clears the value of the "code" field.

func (*StudyPlanUpdate) ClearMilestones

func (spu *StudyPlanUpdate) ClearMilestones() *StudyPlanUpdate

ClearMilestones clears all "milestones" edges to the Milestone entity.

func (*StudyPlanUpdate) Exec

func (spu *StudyPlanUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*StudyPlanUpdate) ExecX

func (spu *StudyPlanUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StudyPlanUpdate) Mutation

func (spu *StudyPlanUpdate) Mutation() *StudyPlanMutation

Mutation returns the StudyPlanMutation object of the builder.

func (*StudyPlanUpdate) RemoveMilestoneIDs

func (spu *StudyPlanUpdate) RemoveMilestoneIDs(ids ...int) *StudyPlanUpdate

RemoveMilestoneIDs removes the "milestones" edge to Milestone entities by IDs.

func (*StudyPlanUpdate) RemoveMilestones

func (spu *StudyPlanUpdate) RemoveMilestones(m ...*Milestone) *StudyPlanUpdate

RemoveMilestones removes "milestones" edges to Milestone entities.

func (*StudyPlanUpdate) Save

func (spu *StudyPlanUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*StudyPlanUpdate) SaveX

func (spu *StudyPlanUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*StudyPlanUpdate) SetAuthor

func (spu *StudyPlanUpdate) SetAuthor(u *User) *StudyPlanUpdate

SetAuthor sets the "author" edge to the User entity.

func (*StudyPlanUpdate) SetAuthorID

func (spu *StudyPlanUpdate) SetAuthorID(id int) *StudyPlanUpdate

SetAuthorID sets the "author" edge to the User entity by ID.

func (*StudyPlanUpdate) SetCode

func (spu *StudyPlanUpdate) SetCode(s string) *StudyPlanUpdate

SetCode sets the "code" field.

func (*StudyPlanUpdate) SetName

func (spu *StudyPlanUpdate) SetName(s string) *StudyPlanUpdate

SetName sets the "name" field.

func (*StudyPlanUpdate) SetNillableCode

func (spu *StudyPlanUpdate) SetNillableCode(s *string) *StudyPlanUpdate

SetNillableCode sets the "code" field if the given value is not nil.

func (*StudyPlanUpdate) Where

Where appends a list predicates to the StudyPlanUpdate builder.

type StudyPlanUpdateOne

type StudyPlanUpdateOne struct {
	// contains filtered or unexported fields
}

StudyPlanUpdateOne is the builder for updating a single StudyPlan entity.

func (*StudyPlanUpdateOne) AddMilestoneIDs

func (spuo *StudyPlanUpdateOne) AddMilestoneIDs(ids ...int) *StudyPlanUpdateOne

AddMilestoneIDs adds the "milestones" edge to the Milestone entity by IDs.

func (*StudyPlanUpdateOne) AddMilestones

func (spuo *StudyPlanUpdateOne) AddMilestones(m ...*Milestone) *StudyPlanUpdateOne

AddMilestones adds the "milestones" edges to the Milestone entity.

func (*StudyPlanUpdateOne) ClearAuthor

func (spuo *StudyPlanUpdateOne) ClearAuthor() *StudyPlanUpdateOne

ClearAuthor clears the "author" edge to the User entity.

func (*StudyPlanUpdateOne) ClearCode

func (spuo *StudyPlanUpdateOne) ClearCode() *StudyPlanUpdateOne

ClearCode clears the value of the "code" field.

func (*StudyPlanUpdateOne) ClearMilestones

func (spuo *StudyPlanUpdateOne) ClearMilestones() *StudyPlanUpdateOne

ClearMilestones clears all "milestones" edges to the Milestone entity.

func (*StudyPlanUpdateOne) Exec

func (spuo *StudyPlanUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*StudyPlanUpdateOne) ExecX

func (spuo *StudyPlanUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StudyPlanUpdateOne) Mutation

func (spuo *StudyPlanUpdateOne) Mutation() *StudyPlanMutation

Mutation returns the StudyPlanMutation object of the builder.

func (*StudyPlanUpdateOne) RemoveMilestoneIDs

func (spuo *StudyPlanUpdateOne) RemoveMilestoneIDs(ids ...int) *StudyPlanUpdateOne

RemoveMilestoneIDs removes the "milestones" edge to Milestone entities by IDs.

func (*StudyPlanUpdateOne) RemoveMilestones

func (spuo *StudyPlanUpdateOne) RemoveMilestones(m ...*Milestone) *StudyPlanUpdateOne

RemoveMilestones removes "milestones" edges to Milestone entities.

func (*StudyPlanUpdateOne) Save

func (spuo *StudyPlanUpdateOne) Save(ctx context.Context) (*StudyPlan, error)

Save executes the query and returns the updated StudyPlan entity.

func (*StudyPlanUpdateOne) SaveX

func (spuo *StudyPlanUpdateOne) SaveX(ctx context.Context) *StudyPlan

SaveX is like Save, but panics if an error occurs.

func (*StudyPlanUpdateOne) Select

func (spuo *StudyPlanUpdateOne) Select(field string, fields ...string) *StudyPlanUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*StudyPlanUpdateOne) SetAuthor

func (spuo *StudyPlanUpdateOne) SetAuthor(u *User) *StudyPlanUpdateOne

SetAuthor sets the "author" edge to the User entity.

func (*StudyPlanUpdateOne) SetAuthorID

func (spuo *StudyPlanUpdateOne) SetAuthorID(id int) *StudyPlanUpdateOne

SetAuthorID sets the "author" edge to the User entity by ID.

func (*StudyPlanUpdateOne) SetCode

func (spuo *StudyPlanUpdateOne) SetCode(s string) *StudyPlanUpdateOne

SetCode sets the "code" field.

func (*StudyPlanUpdateOne) SetName

func (spuo *StudyPlanUpdateOne) SetName(s string) *StudyPlanUpdateOne

SetName sets the "name" field.

func (*StudyPlanUpdateOne) SetNillableCode

func (spuo *StudyPlanUpdateOne) SetNillableCode(s *string) *StudyPlanUpdateOne

SetNillableCode sets the "code" field if the given value is not nil.

func (*StudyPlanUpdateOne) Where

Where appends a list predicates to the StudyPlanUpdate builder.

type StudyPlanUpsert

type StudyPlanUpsert struct {
	*sql.UpdateSet
}

StudyPlanUpsert is the "OnConflict" setter.

func (*StudyPlanUpsert) ClearCode

func (u *StudyPlanUpsert) ClearCode() *StudyPlanUpsert

ClearCode clears the value of the "code" field.

func (*StudyPlanUpsert) SetCode

func (u *StudyPlanUpsert) SetCode(v string) *StudyPlanUpsert

SetCode sets the "code" field.

func (*StudyPlanUpsert) SetName

func (u *StudyPlanUpsert) SetName(v string) *StudyPlanUpsert

SetName sets the "name" field.

func (*StudyPlanUpsert) UpdateCode

func (u *StudyPlanUpsert) UpdateCode() *StudyPlanUpsert

UpdateCode sets the "code" field to the value that was provided on create.

func (*StudyPlanUpsert) UpdateName

func (u *StudyPlanUpsert) UpdateName() *StudyPlanUpsert

UpdateName sets the "name" field to the value that was provided on create.

type StudyPlanUpsertBulk

type StudyPlanUpsertBulk struct {
	// contains filtered or unexported fields
}

StudyPlanUpsertBulk is the builder for "upsert"-ing a bulk of StudyPlan nodes.

func (*StudyPlanUpsertBulk) ClearCode

func (u *StudyPlanUpsertBulk) ClearCode() *StudyPlanUpsertBulk

ClearCode clears the value of the "code" field.

func (*StudyPlanUpsertBulk) DoNothing

func (u *StudyPlanUpsertBulk) DoNothing() *StudyPlanUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*StudyPlanUpsertBulk) Exec

Exec executes the query.

func (*StudyPlanUpsertBulk) ExecX

func (u *StudyPlanUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StudyPlanUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.StudyPlan.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*StudyPlanUpsertBulk) SetCode

SetCode sets the "code" field.

func (*StudyPlanUpsertBulk) SetName

SetName sets the "name" field.

func (*StudyPlanUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the StudyPlanCreateBulk.OnConflict documentation for more info.

func (*StudyPlanUpsertBulk) UpdateCode

func (u *StudyPlanUpsertBulk) UpdateCode() *StudyPlanUpsertBulk

UpdateCode sets the "code" field to the value that was provided on create.

func (*StudyPlanUpsertBulk) UpdateName

func (u *StudyPlanUpsertBulk) UpdateName() *StudyPlanUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*StudyPlanUpsertBulk) UpdateNewValues

func (u *StudyPlanUpsertBulk) UpdateNewValues() *StudyPlanUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.StudyPlan.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

type StudyPlanUpsertOne

type StudyPlanUpsertOne struct {
	// contains filtered or unexported fields
}

StudyPlanUpsertOne is the builder for "upsert"-ing

one StudyPlan node.

func (*StudyPlanUpsertOne) ClearCode

func (u *StudyPlanUpsertOne) ClearCode() *StudyPlanUpsertOne

ClearCode clears the value of the "code" field.

func (*StudyPlanUpsertOne) DoNothing

func (u *StudyPlanUpsertOne) DoNothing() *StudyPlanUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*StudyPlanUpsertOne) Exec

func (u *StudyPlanUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*StudyPlanUpsertOne) ExecX

func (u *StudyPlanUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StudyPlanUpsertOne) ID

func (u *StudyPlanUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*StudyPlanUpsertOne) IDX

func (u *StudyPlanUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*StudyPlanUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.StudyPlan.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*StudyPlanUpsertOne) SetCode

SetCode sets the "code" field.

func (*StudyPlanUpsertOne) SetName

SetName sets the "name" field.

func (*StudyPlanUpsertOne) Update

func (u *StudyPlanUpsertOne) Update(set func(*StudyPlanUpsert)) *StudyPlanUpsertOne

Update allows overriding fields `UPDATE` values. See the StudyPlanCreate.OnConflict documentation for more info.

func (*StudyPlanUpsertOne) UpdateCode

func (u *StudyPlanUpsertOne) UpdateCode() *StudyPlanUpsertOne

UpdateCode sets the "code" field to the value that was provided on create.

func (*StudyPlanUpsertOne) UpdateName

func (u *StudyPlanUpsertOne) UpdateName() *StudyPlanUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*StudyPlanUpsertOne) UpdateNewValues

func (u *StudyPlanUpsertOne) UpdateNewValues() *StudyPlanUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.StudyPlan.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

type StudyPlans

type StudyPlans []*StudyPlan

StudyPlans is a parsable slice of StudyPlan.

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 {

	// Accessory is the client for interacting with the Accessory builders.
	Accessory *AccessoryClient
	// Deadline is the client for interacting with the Deadline builders.
	Deadline *DeadlineClient
	// Event is the client for interacting with the Event builders.
	Event *EventClient
	// Forum is the client for interacting with the Forum builders.
	Forum *ForumClient
	// ForumPost is the client for interacting with the ForumPost builders.
	ForumPost *ForumPostClient
	// Group is the client for interacting with the Group builders.
	Group *GroupClient
	// GroupInviteLink is the client for interacting with the GroupInviteLink builders.
	GroupInviteLink *GroupInviteLinkClient
	// GroupUser is the client for interacting with the GroupUser builders.
	GroupUser *GroupUserClient
	// Institution is the client for interacting with the Institution builders.
	Institution *InstitutionClient
	// InstitutionInviteLink is the client for interacting with the InstitutionInviteLink builders.
	InstitutionInviteLink *InstitutionInviteLinkClient
	// JWTRevocation is the client for interacting with the JWTRevocation builders.
	JWTRevocation *JWTRevocationClient
	// Milestone is the client for interacting with the Milestone builders.
	Milestone *MilestoneClient
	// Pet is the client for interacting with the Pet builders.
	Pet *PetClient
	// Reaction is the client for interacting with the Reaction builders.
	Reaction *ReactionClient
	// Redemption is the client for interacting with the Redemption builders.
	Redemption *RedemptionClient
	// StudyPlan is the client for interacting with the StudyPlan builders.
	StudyPlan *StudyPlanClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// UserPet is the client for interacting with the UserPet builders.
	UserPet *UserPetClient
	// Voucher is the client for interacting with the Voucher builders.
	Voucher *VoucherClient
	// 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 int `json:"id,omitempty"`
	// First name of the user
	FirstName string `json:"first_name,omitempty"`
	// Last name of the user
	LastName string `json:"last_name,omitempty"`
	// Email of the user
	Email string `json:"email,omitempty"`
	// Encoded password hash of the user
	Password hash.Encoded `json:"-"`
	// Points of the user.
	// Must always be positive
	Points int `json:"points,omitempty"`
	// Points awarded by the user after points_awarded_reset_time.
	// Must always be positive
	PointsAwardedCount int `json:"points_awarded_count,omitempty"`
	// Time when points_awarded_count was last reset to 0
	PointsAwardedResetTime time.Time `json:"points_awarded_reset_time,omitempty"`
	// Superuser of the iNProve platform
	GodMode bool `json:"god_mode,omitempty"`
	// Role of the in the institution
	Role institution.Role `json:"role,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) QueryAuthoredDeadlines

func (u *User) QueryAuthoredDeadlines() *DeadlineQuery

QueryAuthoredDeadlines queries the "authored_deadlines" edge of the User entity.

func (*User) QueryForumPosts

func (u *User) QueryForumPosts() *ForumPostQuery

QueryForumPosts queries the "forum_posts" edge of the User entity.

func (*User) QueryGroupUsers

func (u *User) QueryGroupUsers() *GroupUserQuery

QueryGroupUsers queries the "group_users" edge of the User entity.

func (*User) QueryGroups

func (u *User) QueryGroups() *GroupQuery

QueryGroups queries the "groups" edge of the User entity.

func (*User) QueryInstitution

func (u *User) QueryInstitution() *InstitutionQuery

QueryInstitution queries the "institution" edge of the User entity.

func (*User) QueryPet

func (u *User) QueryPet() *PetQuery

QueryPet queries the "pet" edge of the User entity.

func (*User) QueryReactedPosts

func (u *User) QueryReactedPosts() *ForumPostQuery

QueryReactedPosts queries the "reacted_posts" edge of the User entity.

func (*User) QueryReactions

func (u *User) QueryReactions() *ReactionQuery

QueryReactions queries the "reactions" edge of the User entity.

func (*User) QueryRedemptions

func (u *User) QueryRedemptions() *RedemptionQuery

QueryRedemptions queries the "redemptions" edge of the User entity.

func (*User) QueryUserPets

func (u *User) QueryUserPets() *UserPetQuery

QueryUserPets queries the "user_pets" edge of the User entity.

func (*User) QueryVotedDeadlines

func (u *User) QueryVotedDeadlines() *DeadlineQuery

QueryVotedDeadlines queries the "voted_deadlines" 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 int) *UserDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id int) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id int) *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) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryAuthoredDeadlines

func (c *UserClient) QueryAuthoredDeadlines(u *User) *DeadlineQuery

QueryAuthoredDeadlines queries the authored_deadlines edge of a User.

func (*UserClient) QueryForumPosts

func (c *UserClient) QueryForumPosts(u *User) *ForumPostQuery

QueryForumPosts queries the forum_posts edge of a User.

func (*UserClient) QueryGroupUsers

func (c *UserClient) QueryGroupUsers(u *User) *GroupUserQuery

QueryGroupUsers queries the group_users edge of a User.

func (*UserClient) QueryGroups

func (c *UserClient) QueryGroups(u *User) *GroupQuery

QueryGroups queries the groups edge of a User.

func (*UserClient) QueryInstitution

func (c *UserClient) QueryInstitution(u *User) *InstitutionQuery

QueryInstitution queries the institution edge of a User.

func (*UserClient) QueryPet

func (c *UserClient) QueryPet(u *User) *PetQuery

QueryPet queries the pet edge of a User.

func (*UserClient) QueryReactedPosts

func (c *UserClient) QueryReactedPosts(u *User) *ForumPostQuery

QueryReactedPosts queries the reacted_posts edge of a User.

func (*UserClient) QueryReactions

func (c *UserClient) QueryReactions(u *User) *ReactionQuery

QueryReactions queries the reactions edge of a User.

func (*UserClient) QueryRedemptions

func (c *UserClient) QueryRedemptions(u *User) *RedemptionQuery

QueryRedemptions queries the redemptions edge of a User.

func (*UserClient) QueryUserPets

func (c *UserClient) QueryUserPets(u *User) *UserPetQuery

QueryUserPets queries the user_pets edge of a User.

func (*UserClient) QueryVotedDeadlines

func (c *UserClient) QueryVotedDeadlines(u *User) *DeadlineQuery

QueryVotedDeadlines queries the voted_deadlines 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 int) *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) AddAuthoredDeadlineIDs

func (uc *UserCreate) AddAuthoredDeadlineIDs(ids ...int) *UserCreate

AddAuthoredDeadlineIDs adds the "authored_deadlines" edge to the Deadline entity by IDs.

func (*UserCreate) AddAuthoredDeadlines

func (uc *UserCreate) AddAuthoredDeadlines(d ...*Deadline) *UserCreate

AddAuthoredDeadlines adds the "authored_deadlines" edges to the Deadline entity.

func (*UserCreate) AddForumPostIDs

func (uc *UserCreate) AddForumPostIDs(ids ...int) *UserCreate

AddForumPostIDs adds the "forum_posts" edge to the ForumPost entity by IDs.

func (*UserCreate) AddForumPosts

func (uc *UserCreate) AddForumPosts(f ...*ForumPost) *UserCreate

AddForumPosts adds the "forum_posts" edges to the ForumPost entity.

func (*UserCreate) AddGroupIDs

func (uc *UserCreate) AddGroupIDs(ids ...int) *UserCreate

AddGroupIDs adds the "groups" edge to the Group entity by IDs.

func (*UserCreate) AddGroups

func (uc *UserCreate) AddGroups(g ...*Group) *UserCreate

AddGroups adds the "groups" edges to the Group entity.

func (*UserCreate) AddPet

func (uc *UserCreate) AddPet(p ...*Pet) *UserCreate

AddPet adds the "pet" edges to the Pet entity.

func (*UserCreate) AddPetIDs

func (uc *UserCreate) AddPetIDs(ids ...int) *UserCreate

AddPetIDs adds the "pet" edge to the Pet entity by IDs.

func (*UserCreate) AddReactedPostIDs

func (uc *UserCreate) AddReactedPostIDs(ids ...int) *UserCreate

AddReactedPostIDs adds the "reacted_posts" edge to the ForumPost entity by IDs.

func (*UserCreate) AddReactedPosts

func (uc *UserCreate) AddReactedPosts(f ...*ForumPost) *UserCreate

AddReactedPosts adds the "reacted_posts" edges to the ForumPost entity.

func (*UserCreate) AddRedemptionIDs

func (uc *UserCreate) AddRedemptionIDs(ids ...int) *UserCreate

AddRedemptionIDs adds the "redemptions" edge to the Redemption entity by IDs.

func (*UserCreate) AddRedemptions

func (uc *UserCreate) AddRedemptions(r ...*Redemption) *UserCreate

AddRedemptions adds the "redemptions" edges to the Redemption entity.

func (*UserCreate) AddVotedDeadlineIDs

func (uc *UserCreate) AddVotedDeadlineIDs(ids ...int) *UserCreate

AddVotedDeadlineIDs adds the "voted_deadlines" edge to the Deadline entity by IDs.

func (*UserCreate) AddVotedDeadlines

func (uc *UserCreate) AddVotedDeadlines(d ...*Deadline) *UserCreate

AddVotedDeadlines adds the "voted_deadlines" edges to the Deadline 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().
	SetFirstName(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) {
		SetFirstName(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) SetEmail

func (uc *UserCreate) SetEmail(s string) *UserCreate

SetEmail sets the "email" field.

func (*UserCreate) SetFirstName

func (uc *UserCreate) SetFirstName(s string) *UserCreate

SetFirstName sets the "first_name" field.

func (*UserCreate) SetGodMode

func (uc *UserCreate) SetGodMode(b bool) *UserCreate

SetGodMode sets the "god_mode" field.

func (*UserCreate) SetInstitution

func (uc *UserCreate) SetInstitution(i *Institution) *UserCreate

SetInstitution sets the "institution" edge to the Institution entity.

func (*UserCreate) SetInstitutionID

func (uc *UserCreate) SetInstitutionID(id int) *UserCreate

SetInstitutionID sets the "institution" edge to the Institution entity by ID.

func (*UserCreate) SetLastName

func (uc *UserCreate) SetLastName(s string) *UserCreate

SetLastName sets the "last_name" field.

func (*UserCreate) SetNillablePoints

func (uc *UserCreate) SetNillablePoints(i *int) *UserCreate

SetNillablePoints sets the "points" field if the given value is not nil.

func (*UserCreate) SetNillablePointsAwardedCount

func (uc *UserCreate) SetNillablePointsAwardedCount(i *int) *UserCreate

SetNillablePointsAwardedCount sets the "points_awarded_count" field if the given value is not nil.

func (*UserCreate) SetNillablePointsAwardedResetTime

func (uc *UserCreate) SetNillablePointsAwardedResetTime(t *time.Time) *UserCreate

SetNillablePointsAwardedResetTime sets the "points_awarded_reset_time" field if the given value is not nil.

func (*UserCreate) SetPassword

func (uc *UserCreate) SetPassword(h hash.Encoded) *UserCreate

SetPassword sets the "password" field.

func (*UserCreate) SetPoints

func (uc *UserCreate) SetPoints(i int) *UserCreate

SetPoints sets the "points" field.

func (*UserCreate) SetPointsAwardedCount

func (uc *UserCreate) SetPointsAwardedCount(i int) *UserCreate

SetPointsAwardedCount sets the "points_awarded_count" field.

func (*UserCreate) SetPointsAwardedResetTime

func (uc *UserCreate) SetPointsAwardedResetTime(t time.Time) *UserCreate

SetPointsAwardedResetTime sets the "points_awarded_reset_time" field.

func (*UserCreate) SetRole

func (uc *UserCreate) SetRole(i institution.Role) *UserCreate

SetRole sets the "role" 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) {
		SetFirstName(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 {
	// Institution holds the value of the institution edge.
	Institution *Institution `json:"institution,omitempty"`
	// Redemptions holds the value of the redemptions edge.
	Redemptions []*Redemption `json:"redemptions,omitempty"`
	// ForumPosts holds the value of the forum_posts edge.
	ForumPosts []*ForumPost `json:"forum_posts,omitempty"`
	// Pet holds the value of the pet edge.
	Pet []*Pet `json:"pet,omitempty"`
	// Groups holds the value of the groups edge.
	Groups []*Group `json:"groups,omitempty"`
	// ReactedPosts holds the value of the reacted_posts edge.
	ReactedPosts []*ForumPost `json:"reacted_posts,omitempty"`
	// VotedDeadlines holds the value of the voted_deadlines edge.
	VotedDeadlines []*Deadline `json:"voted_deadlines,omitempty"`
	// AuthoredDeadlines holds the value of the authored_deadlines edge.
	AuthoredDeadlines []*Deadline `json:"authored_deadlines,omitempty"`
	// UserPets holds the value of the user_pets edge.
	UserPets []*UserPet `json:"user_pets,omitempty"`
	// GroupUsers holds the value of the group_users edge.
	GroupUsers []*GroupUser `json:"group_users,omitempty"`
	// Reactions holds the value of the reactions edge.
	Reactions []*Reaction `json:"reactions,omitempty"`
	// contains filtered or unexported fields
}

UserEdges holds the relations/edges for other nodes in the graph.

func (UserEdges) AuthoredDeadlinesOrErr

func (e UserEdges) AuthoredDeadlinesOrErr() ([]*Deadline, error)

AuthoredDeadlinesOrErr returns the AuthoredDeadlines value or an error if the edge was not loaded in eager-loading.

func (UserEdges) ForumPostsOrErr

func (e UserEdges) ForumPostsOrErr() ([]*ForumPost, error)

ForumPostsOrErr returns the ForumPosts value or an error if the edge was not loaded in eager-loading.

func (UserEdges) GroupUsersOrErr

func (e UserEdges) GroupUsersOrErr() ([]*GroupUser, error)

GroupUsersOrErr returns the GroupUsers value or an error if the edge was not loaded in eager-loading.

func (UserEdges) GroupsOrErr

func (e UserEdges) GroupsOrErr() ([]*Group, error)

GroupsOrErr returns the Groups value or an error if the edge was not loaded in eager-loading.

func (UserEdges) InstitutionOrErr

func (e UserEdges) InstitutionOrErr() (*Institution, error)

InstitutionOrErr returns the Institution value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (UserEdges) PetOrErr

func (e UserEdges) PetOrErr() ([]*Pet, error)

PetOrErr returns the Pet value or an error if the edge was not loaded in eager-loading.

func (UserEdges) ReactedPostsOrErr

func (e UserEdges) ReactedPostsOrErr() ([]*ForumPost, error)

ReactedPostsOrErr returns the ReactedPosts value or an error if the edge was not loaded in eager-loading.

func (UserEdges) ReactionsOrErr

func (e UserEdges) ReactionsOrErr() ([]*Reaction, error)

ReactionsOrErr returns the Reactions value or an error if the edge was not loaded in eager-loading.

func (UserEdges) RedemptionsOrErr

func (e UserEdges) RedemptionsOrErr() ([]*Redemption, error)

RedemptionsOrErr returns the Redemptions value or an error if the edge was not loaded in eager-loading.

func (UserEdges) UserPetsOrErr

func (e UserEdges) UserPetsOrErr() ([]*UserPet, error)

UserPetsOrErr returns the UserPets value or an error if the edge was not loaded in eager-loading.

func (UserEdges) VotedDeadlinesOrErr

func (e UserEdges) VotedDeadlinesOrErr() ([]*Deadline, error)

VotedDeadlinesOrErr returns the VotedDeadlines 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) AddAuthoredDeadlineIDs

func (m *UserMutation) AddAuthoredDeadlineIDs(ids ...int)

AddAuthoredDeadlineIDs adds the "authored_deadlines" edge to the Deadline entity by ids.

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) AddForumPostIDs

func (m *UserMutation) AddForumPostIDs(ids ...int)

AddForumPostIDs adds the "forum_posts" edge to the ForumPost entity by ids.

func (*UserMutation) AddGroupIDs

func (m *UserMutation) AddGroupIDs(ids ...int)

AddGroupIDs adds the "groups" edge to the Group entity by ids.

func (*UserMutation) AddPetIDs

func (m *UserMutation) AddPetIDs(ids ...int)

AddPetIDs adds the "pet" edge to the Pet entity by ids.

func (*UserMutation) AddPoints

func (m *UserMutation) AddPoints(i int)

AddPoints adds i to the "points" field.

func (*UserMutation) AddPointsAwardedCount

func (m *UserMutation) AddPointsAwardedCount(i int)

AddPointsAwardedCount adds i to the "points_awarded_count" field.

func (*UserMutation) AddReactedPostIDs

func (m *UserMutation) AddReactedPostIDs(ids ...int)

AddReactedPostIDs adds the "reacted_posts" edge to the ForumPost entity by ids.

func (*UserMutation) AddRedemptionIDs

func (m *UserMutation) AddRedemptionIDs(ids ...int)

AddRedemptionIDs adds the "redemptions" edge to the Redemption entity by ids.

func (*UserMutation) AddVotedDeadlineIDs

func (m *UserMutation) AddVotedDeadlineIDs(ids ...int)

AddVotedDeadlineIDs adds the "voted_deadlines" edge to the Deadline 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) AddedPoints

func (m *UserMutation) AddedPoints() (r int, exists bool)

AddedPoints returns the value that was added to the "points" field in this mutation.

func (*UserMutation) AddedPointsAwardedCount

func (m *UserMutation) AddedPointsAwardedCount() (r int, exists bool)

AddedPointsAwardedCount returns the value that was added to the "points_awarded_count" field in this mutation.

func (*UserMutation) AuthoredDeadlinesCleared

func (m *UserMutation) AuthoredDeadlinesCleared() bool

AuthoredDeadlinesCleared reports if the "authored_deadlines" edge to the Deadline entity was cleared.

func (*UserMutation) AuthoredDeadlinesIDs

func (m *UserMutation) AuthoredDeadlinesIDs() (ids []int)

AuthoredDeadlinesIDs returns the "authored_deadlines" edge IDs in the mutation.

func (*UserMutation) ClearAuthoredDeadlines

func (m *UserMutation) ClearAuthoredDeadlines()

ClearAuthoredDeadlines clears the "authored_deadlines" edge to the Deadline entity.

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) ClearForumPosts

func (m *UserMutation) ClearForumPosts()

ClearForumPosts clears the "forum_posts" edge to the ForumPost entity.

func (*UserMutation) ClearGroups

func (m *UserMutation) ClearGroups()

ClearGroups clears the "groups" edge to the Group entity.

func (*UserMutation) ClearInstitution

func (m *UserMutation) ClearInstitution()

ClearInstitution clears the "institution" edge to the Institution entity.

func (*UserMutation) ClearPet

func (m *UserMutation) ClearPet()

ClearPet clears the "pet" edge to the Pet entity.

func (*UserMutation) ClearPointsAwardedResetTime

func (m *UserMutation) ClearPointsAwardedResetTime()

ClearPointsAwardedResetTime clears the value of the "points_awarded_reset_time" field.

func (*UserMutation) ClearReactedPosts

func (m *UserMutation) ClearReactedPosts()

ClearReactedPosts clears the "reacted_posts" edge to the ForumPost entity.

func (*UserMutation) ClearRedemptions

func (m *UserMutation) ClearRedemptions()

ClearRedemptions clears the "redemptions" edge to the Redemption entity.

func (*UserMutation) ClearVotedDeadlines

func (m *UserMutation) ClearVotedDeadlines()

ClearVotedDeadlines clears the "voted_deadlines" edge to the Deadline 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) 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) FirstName

func (m *UserMutation) FirstName() (r string, exists bool)

FirstName returns the value of the "first_name" field in the mutation.

func (*UserMutation) ForumPostsCleared

func (m *UserMutation) ForumPostsCleared() bool

ForumPostsCleared reports if the "forum_posts" edge to the ForumPost entity was cleared.

func (*UserMutation) ForumPostsIDs

func (m *UserMutation) ForumPostsIDs() (ids []int)

ForumPostsIDs returns the "forum_posts" edge IDs in the mutation.

func (*UserMutation) GodMode

func (m *UserMutation) GodMode() (r bool, exists bool)

GodMode returns the value of the "god_mode" field in the mutation.

func (*UserMutation) GroupsCleared

func (m *UserMutation) GroupsCleared() bool

GroupsCleared reports if the "groups" edge to the Group entity was cleared.

func (*UserMutation) GroupsIDs

func (m *UserMutation) GroupsIDs() (ids []int)

GroupsIDs returns the "groups" edge IDs in the mutation.

func (*UserMutation) ID

func (m *UserMutation) ID() (id int, 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) ([]int, 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) InstitutionCleared

func (m *UserMutation) InstitutionCleared() bool

InstitutionCleared reports if the "institution" edge to the Institution entity was cleared.

func (*UserMutation) InstitutionID

func (m *UserMutation) InstitutionID() (id int, exists bool)

InstitutionID returns the "institution" edge ID in the mutation.

func (*UserMutation) InstitutionIDs

func (m *UserMutation) InstitutionIDs() (ids []int)

InstitutionIDs returns the "institution" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use InstitutionID instead. It exists only for internal usage by the builders.

func (*UserMutation) LastName

func (m *UserMutation) LastName() (r string, exists bool)

LastName returns the value of the "last_name" field in the mutation.

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) OldFirstName

func (m *UserMutation) OldFirstName(ctx context.Context) (v string, err error)

OldFirstName returns the old "first_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) OldGodMode

func (m *UserMutation) OldGodMode(ctx context.Context) (v bool, err error)

OldGodMode returns the old "god_mode" 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) OldLastName

func (m *UserMutation) OldLastName(ctx context.Context) (v string, err error)

OldLastName returns the old "last_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) OldPassword

func (m *UserMutation) OldPassword(ctx context.Context) (v hash.Encoded, err error)

OldPassword returns the old "password" 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) OldPoints

func (m *UserMutation) OldPoints(ctx context.Context) (v int, err error)

OldPoints returns the old "points" 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) OldPointsAwardedCount

func (m *UserMutation) OldPointsAwardedCount(ctx context.Context) (v int, err error)

OldPointsAwardedCount returns the old "points_awarded_count" 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) OldPointsAwardedResetTime

func (m *UserMutation) OldPointsAwardedResetTime(ctx context.Context) (v time.Time, err error)

OldPointsAwardedResetTime returns the old "points_awarded_reset_time" 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) OldRole

func (m *UserMutation) OldRole(ctx context.Context) (v institution.Role, err error)

OldRole returns the old "role" 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) Password

func (m *UserMutation) Password() (r hash.Encoded, exists bool)

Password returns the value of the "password" field in the mutation.

func (*UserMutation) PetCleared

func (m *UserMutation) PetCleared() bool

PetCleared reports if the "pet" edge to the Pet entity was cleared.

func (*UserMutation) PetIDs

func (m *UserMutation) PetIDs() (ids []int)

PetIDs returns the "pet" edge IDs in the mutation.

func (*UserMutation) Points

func (m *UserMutation) Points() (r int, exists bool)

Points returns the value of the "points" field in the mutation.

func (*UserMutation) PointsAwardedCount

func (m *UserMutation) PointsAwardedCount() (r int, exists bool)

PointsAwardedCount returns the value of the "points_awarded_count" field in the mutation.

func (*UserMutation) PointsAwardedResetTime

func (m *UserMutation) PointsAwardedResetTime() (r time.Time, exists bool)

PointsAwardedResetTime returns the value of the "points_awarded_reset_time" field in the mutation.

func (*UserMutation) PointsAwardedResetTimeCleared

func (m *UserMutation) PointsAwardedResetTimeCleared() bool

PointsAwardedResetTimeCleared returns if the "points_awarded_reset_time" field was cleared in this mutation.

func (*UserMutation) ReactedPostsCleared

func (m *UserMutation) ReactedPostsCleared() bool

ReactedPostsCleared reports if the "reacted_posts" edge to the ForumPost entity was cleared.

func (*UserMutation) ReactedPostsIDs

func (m *UserMutation) ReactedPostsIDs() (ids []int)

ReactedPostsIDs returns the "reacted_posts" edge IDs in the mutation.

func (*UserMutation) RedemptionsCleared

func (m *UserMutation) RedemptionsCleared() bool

RedemptionsCleared reports if the "redemptions" edge to the Redemption entity was cleared.

func (*UserMutation) RedemptionsIDs

func (m *UserMutation) RedemptionsIDs() (ids []int)

RedemptionsIDs returns the "redemptions" edge IDs in the mutation.

func (*UserMutation) RemoveAuthoredDeadlineIDs

func (m *UserMutation) RemoveAuthoredDeadlineIDs(ids ...int)

RemoveAuthoredDeadlineIDs removes the "authored_deadlines" edge to the Deadline entity by IDs.

func (*UserMutation) RemoveForumPostIDs

func (m *UserMutation) RemoveForumPostIDs(ids ...int)

RemoveForumPostIDs removes the "forum_posts" edge to the ForumPost entity by IDs.

func (*UserMutation) RemoveGroupIDs

func (m *UserMutation) RemoveGroupIDs(ids ...int)

RemoveGroupIDs removes the "groups" edge to the Group entity by IDs.

func (*UserMutation) RemovePetIDs

func (m *UserMutation) RemovePetIDs(ids ...int)

RemovePetIDs removes the "pet" edge to the Pet entity by IDs.

func (*UserMutation) RemoveReactedPostIDs

func (m *UserMutation) RemoveReactedPostIDs(ids ...int)

RemoveReactedPostIDs removes the "reacted_posts" edge to the ForumPost entity by IDs.

func (*UserMutation) RemoveRedemptionIDs

func (m *UserMutation) RemoveRedemptionIDs(ids ...int)

RemoveRedemptionIDs removes the "redemptions" edge to the Redemption entity by IDs.

func (*UserMutation) RemoveVotedDeadlineIDs

func (m *UserMutation) RemoveVotedDeadlineIDs(ids ...int)

RemoveVotedDeadlineIDs removes the "voted_deadlines" edge to the Deadline entity by IDs.

func (*UserMutation) RemovedAuthoredDeadlinesIDs

func (m *UserMutation) RemovedAuthoredDeadlinesIDs() (ids []int)

RemovedAuthoredDeadlines returns the removed IDs of the "authored_deadlines" edge to the Deadline entity.

func (*UserMutation) RemovedEdges

func (m *UserMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserMutation) RemovedForumPostsIDs

func (m *UserMutation) RemovedForumPostsIDs() (ids []int)

RemovedForumPosts returns the removed IDs of the "forum_posts" edge to the ForumPost entity.

func (*UserMutation) RemovedGroupsIDs

func (m *UserMutation) RemovedGroupsIDs() (ids []int)

RemovedGroups returns the removed IDs of the "groups" edge to the Group entity.

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) RemovedPetIDs

func (m *UserMutation) RemovedPetIDs() (ids []int)

RemovedPet returns the removed IDs of the "pet" edge to the Pet entity.

func (*UserMutation) RemovedReactedPostsIDs

func (m *UserMutation) RemovedReactedPostsIDs() (ids []int)

RemovedReactedPosts returns the removed IDs of the "reacted_posts" edge to the ForumPost entity.

func (*UserMutation) RemovedRedemptionsIDs

func (m *UserMutation) RemovedRedemptionsIDs() (ids []int)

RemovedRedemptions returns the removed IDs of the "redemptions" edge to the Redemption entity.

func (*UserMutation) RemovedVotedDeadlinesIDs

func (m *UserMutation) RemovedVotedDeadlinesIDs() (ids []int)

RemovedVotedDeadlines returns the removed IDs of the "voted_deadlines" edge to the Deadline entity.

func (*UserMutation) ResetAuthoredDeadlines

func (m *UserMutation) ResetAuthoredDeadlines()

ResetAuthoredDeadlines resets all changes to the "authored_deadlines" edge.

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) ResetFirstName

func (m *UserMutation) ResetFirstName()

ResetFirstName resets all changes to the "first_name" field.

func (*UserMutation) ResetForumPosts

func (m *UserMutation) ResetForumPosts()

ResetForumPosts resets all changes to the "forum_posts" edge.

func (*UserMutation) ResetGodMode

func (m *UserMutation) ResetGodMode()

ResetGodMode resets all changes to the "god_mode" field.

func (*UserMutation) ResetGroups

func (m *UserMutation) ResetGroups()

ResetGroups resets all changes to the "groups" edge.

func (*UserMutation) ResetInstitution

func (m *UserMutation) ResetInstitution()

ResetInstitution resets all changes to the "institution" edge.

func (*UserMutation) ResetLastName

func (m *UserMutation) ResetLastName()

ResetLastName resets all changes to the "last_name" field.

func (*UserMutation) ResetPassword

func (m *UserMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*UserMutation) ResetPet

func (m *UserMutation) ResetPet()

ResetPet resets all changes to the "pet" edge.

func (*UserMutation) ResetPoints

func (m *UserMutation) ResetPoints()

ResetPoints resets all changes to the "points" field.

func (*UserMutation) ResetPointsAwardedCount

func (m *UserMutation) ResetPointsAwardedCount()

ResetPointsAwardedCount resets all changes to the "points_awarded_count" field.

func (*UserMutation) ResetPointsAwardedResetTime

func (m *UserMutation) ResetPointsAwardedResetTime()

ResetPointsAwardedResetTime resets all changes to the "points_awarded_reset_time" field.

func (*UserMutation) ResetReactedPosts

func (m *UserMutation) ResetReactedPosts()

ResetReactedPosts resets all changes to the "reacted_posts" edge.

func (*UserMutation) ResetRedemptions

func (m *UserMutation) ResetRedemptions()

ResetRedemptions resets all changes to the "redemptions" edge.

func (*UserMutation) ResetRole

func (m *UserMutation) ResetRole()

ResetRole resets all changes to the "role" field.

func (*UserMutation) ResetVotedDeadlines

func (m *UserMutation) ResetVotedDeadlines()

ResetVotedDeadlines resets all changes to the "voted_deadlines" edge.

func (*UserMutation) Role

func (m *UserMutation) Role() (r institution.Role, exists bool)

Role returns the value of the "role" field in the mutation.

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) SetFirstName

func (m *UserMutation) SetFirstName(s string)

SetFirstName sets the "first_name" field.

func (*UserMutation) SetGodMode

func (m *UserMutation) SetGodMode(b bool)

SetGodMode sets the "god_mode" field.

func (*UserMutation) SetInstitutionID

func (m *UserMutation) SetInstitutionID(id int)

SetInstitutionID sets the "institution" edge to the Institution entity by id.

func (*UserMutation) SetLastName

func (m *UserMutation) SetLastName(s string)

SetLastName sets the "last_name" field.

func (*UserMutation) SetOp

func (m *UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserMutation) SetPassword

func (m *UserMutation) SetPassword(h hash.Encoded)

SetPassword sets the "password" field.

func (*UserMutation) SetPoints

func (m *UserMutation) SetPoints(i int)

SetPoints sets the "points" field.

func (*UserMutation) SetPointsAwardedCount

func (m *UserMutation) SetPointsAwardedCount(i int)

SetPointsAwardedCount sets the "points_awarded_count" field.

func (*UserMutation) SetPointsAwardedResetTime

func (m *UserMutation) SetPointsAwardedResetTime(t time.Time)

SetPointsAwardedResetTime sets the "points_awarded_reset_time" field.

func (*UserMutation) SetRole

func (m *UserMutation) SetRole(i institution.Role)

SetRole sets the "role" field.

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) VotedDeadlinesCleared

func (m *UserMutation) VotedDeadlinesCleared() bool

VotedDeadlinesCleared reports if the "voted_deadlines" edge to the Deadline entity was cleared.

func (*UserMutation) VotedDeadlinesIDs

func (m *UserMutation) VotedDeadlinesIDs() (ids []int)

VotedDeadlinesIDs returns the "voted_deadlines" edge IDs 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 UserPet

type UserPet struct {

	// Hunger percentage of the pet (0-1)
	HungerPercentage float64 `json:"hunger_percentage,omitempty"`
	// Map of enabled SVG group element IDs
	EnabledSvgGroupElementIds map[string]bool `json:"enabled_svg_group_element_ids,omitempty"`
	// ID of the pet
	PetID int `json:"pet_id,omitempty"`
	// ID of the user
	UserID int `json:"user_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserPetQuery when eager-loading is set.
	Edges UserPetEdges `json:"edges"`
	// contains filtered or unexported fields
}

UserPet is the model entity for the UserPet schema.

func (*UserPet) QueryPet

func (up *UserPet) QueryPet() *PetQuery

QueryPet queries the "pet" edge of the UserPet entity.

func (*UserPet) QueryUser

func (up *UserPet) QueryUser() *UserQuery

QueryUser queries the "user" edge of the UserPet entity.

func (*UserPet) String

func (up *UserPet) String() string

String implements the fmt.Stringer.

func (*UserPet) Unwrap

func (up *UserPet) Unwrap() *UserPet

Unwrap unwraps the UserPet 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 (*UserPet) Update

func (up *UserPet) Update() *UserPetUpdateOne

Update returns a builder for updating this UserPet. Note that you need to call UserPet.Unwrap() before calling this method if this UserPet was returned from a transaction, and the transaction was committed or rolled back.

func (*UserPet) Value

func (up *UserPet) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the UserPet. This includes values selected through modifiers, order, etc.

type UserPetClient

type UserPetClient struct {
	// contains filtered or unexported fields
}

UserPetClient is a client for the UserPet schema.

func NewUserPetClient

func NewUserPetClient(c config) *UserPetClient

NewUserPetClient returns a client for the UserPet from the given config.

func (*UserPetClient) Create

func (c *UserPetClient) Create() *UserPetCreate

Create returns a builder for creating a UserPet entity.

func (*UserPetClient) CreateBulk

func (c *UserPetClient) CreateBulk(builders ...*UserPetCreate) *UserPetCreateBulk

CreateBulk returns a builder for creating a bulk of UserPet entities.

func (*UserPetClient) Delete

func (c *UserPetClient) Delete() *UserPetDelete

Delete returns a delete builder for UserPet.

func (*UserPetClient) Hooks

func (c *UserPetClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserPetClient) Intercept

func (c *UserPetClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `userpet.Intercept(f(g(h())))`.

func (*UserPetClient) Interceptors

func (c *UserPetClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*UserPetClient) Query

func (c *UserPetClient) Query() *UserPetQuery

Query returns a query builder for UserPet.

func (*UserPetClient) QueryPet

func (c *UserPetClient) QueryPet(up *UserPet) *PetQuery

QueryPet queries the pet edge of a UserPet.

func (*UserPetClient) QueryUser

func (c *UserPetClient) QueryUser(up *UserPet) *UserQuery

QueryUser queries the user edge of a UserPet.

func (*UserPetClient) Update

func (c *UserPetClient) Update() *UserPetUpdate

Update returns an update builder for UserPet.

func (*UserPetClient) UpdateOne

func (c *UserPetClient) UpdateOne(up *UserPet) *UserPetUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserPetClient) Use

func (c *UserPetClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `userpet.Hooks(f(g(h())))`.

type UserPetCreate

type UserPetCreate struct {
	// contains filtered or unexported fields
}

UserPetCreate is the builder for creating a UserPet entity.

func (*UserPetCreate) Exec

func (upc *UserPetCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserPetCreate) ExecX

func (upc *UserPetCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserPetCreate) Mutation

func (upc *UserPetCreate) Mutation() *UserPetMutation

Mutation returns the UserPetMutation object of the builder.

func (*UserPetCreate) OnConflict

func (upc *UserPetCreate) OnConflict(opts ...sql.ConflictOption) *UserPetUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.UserPet.Create().
	SetHungerPercentage(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.UserPetUpsert) {
		SetHungerPercentage(v+v).
	}).
	Exec(ctx)

func (*UserPetCreate) OnConflictColumns

func (upc *UserPetCreate) OnConflictColumns(columns ...string) *UserPetUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.UserPet.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*UserPetCreate) Save

func (upc *UserPetCreate) Save(ctx context.Context) (*UserPet, error)

Save creates the UserPet in the database.

func (*UserPetCreate) SaveX

func (upc *UserPetCreate) SaveX(ctx context.Context) *UserPet

SaveX calls Save and panics if Save returns an error.

func (*UserPetCreate) SetEnabledSvgGroupElementIds

func (upc *UserPetCreate) SetEnabledSvgGroupElementIds(m map[string]bool) *UserPetCreate

SetEnabledSvgGroupElementIds sets the "enabled_svg_group_element_ids" field.

func (*UserPetCreate) SetHungerPercentage

func (upc *UserPetCreate) SetHungerPercentage(f float64) *UserPetCreate

SetHungerPercentage sets the "hunger_percentage" field.

func (*UserPetCreate) SetPet

func (upc *UserPetCreate) SetPet(p *Pet) *UserPetCreate

SetPet sets the "pet" edge to the Pet entity.

func (*UserPetCreate) SetPetID

func (upc *UserPetCreate) SetPetID(i int) *UserPetCreate

SetPetID sets the "pet_id" field.

func (*UserPetCreate) SetUser

func (upc *UserPetCreate) SetUser(u *User) *UserPetCreate

SetUser sets the "user" edge to the User entity.

func (*UserPetCreate) SetUserID

func (upc *UserPetCreate) SetUserID(i int) *UserPetCreate

SetUserID sets the "user_id" field.

type UserPetCreateBulk

type UserPetCreateBulk struct {
	// contains filtered or unexported fields
}

UserPetCreateBulk is the builder for creating many UserPet entities in bulk.

func (*UserPetCreateBulk) Exec

func (upcb *UserPetCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserPetCreateBulk) ExecX

func (upcb *UserPetCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserPetCreateBulk) OnConflict

func (upcb *UserPetCreateBulk) OnConflict(opts ...sql.ConflictOption) *UserPetUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.UserPet.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.UserPetUpsert) {
		SetHungerPercentage(v+v).
	}).
	Exec(ctx)

func (*UserPetCreateBulk) OnConflictColumns

func (upcb *UserPetCreateBulk) OnConflictColumns(columns ...string) *UserPetUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.UserPet.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*UserPetCreateBulk) Save

func (upcb *UserPetCreateBulk) Save(ctx context.Context) ([]*UserPet, error)

Save creates the UserPet entities in the database.

func (*UserPetCreateBulk) SaveX

func (upcb *UserPetCreateBulk) SaveX(ctx context.Context) []*UserPet

SaveX is like Save, but panics if an error occurs.

type UserPetDelete

type UserPetDelete struct {
	// contains filtered or unexported fields
}

UserPetDelete is the builder for deleting a UserPet entity.

func (*UserPetDelete) Exec

func (upd *UserPetDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserPetDelete) ExecX

func (upd *UserPetDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserPetDelete) Where

func (upd *UserPetDelete) Where(ps ...predicate.UserPet) *UserPetDelete

Where appends a list predicates to the UserPetDelete builder.

type UserPetDeleteOne

type UserPetDeleteOne struct {
	// contains filtered or unexported fields
}

UserPetDeleteOne is the builder for deleting a single UserPet entity.

func (*UserPetDeleteOne) Exec

func (updo *UserPetDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserPetDeleteOne) ExecX

func (updo *UserPetDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserPetDeleteOne) Where

func (updo *UserPetDeleteOne) Where(ps ...predicate.UserPet) *UserPetDeleteOne

Where appends a list predicates to the UserPetDelete builder.

type UserPetEdges

type UserPetEdges struct {
	// Pet holds the value of the pet edge.
	Pet *Pet `json:"pet,omitempty"`
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// contains filtered or unexported fields
}

UserPetEdges holds the relations/edges for other nodes in the graph.

func (UserPetEdges) PetOrErr

func (e UserPetEdges) PetOrErr() (*Pet, error)

PetOrErr returns the Pet value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (UserPetEdges) UserOrErr

func (e UserPetEdges) UserOrErr() (*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type UserPetGroupBy

type UserPetGroupBy struct {
	// contains filtered or unexported fields
}

UserPetGroupBy is the group-by builder for UserPet entities.

func (*UserPetGroupBy) Aggregate

func (upgb *UserPetGroupBy) Aggregate(fns ...AggregateFunc) *UserPetGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserPetGroupBy) Bool

func (s *UserPetGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserPetGroupBy) BoolX

func (s *UserPetGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserPetGroupBy) Bools

func (s *UserPetGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserPetGroupBy) BoolsX

func (s *UserPetGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserPetGroupBy) Float64

func (s *UserPetGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserPetGroupBy) Float64X

func (s *UserPetGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserPetGroupBy) Float64s

func (s *UserPetGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserPetGroupBy) Float64sX

func (s *UserPetGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserPetGroupBy) Int

func (s *UserPetGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserPetGroupBy) IntX

func (s *UserPetGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserPetGroupBy) Ints

func (s *UserPetGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserPetGroupBy) IntsX

func (s *UserPetGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserPetGroupBy) Scan

func (upgb *UserPetGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserPetGroupBy) ScanX

func (s *UserPetGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserPetGroupBy) String

func (s *UserPetGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserPetGroupBy) StringX

func (s *UserPetGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserPetGroupBy) Strings

func (s *UserPetGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserPetGroupBy) StringsX

func (s *UserPetGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserPetMutation

type UserPetMutation struct {
	// contains filtered or unexported fields
}

UserPetMutation represents an operation that mutates the UserPet nodes in the graph.

func (*UserPetMutation) AddField

func (m *UserPetMutation) 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 (*UserPetMutation) AddHungerPercentage

func (m *UserPetMutation) AddHungerPercentage(f float64)

AddHungerPercentage adds f to the "hunger_percentage" field.

func (*UserPetMutation) AddedEdges

func (m *UserPetMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserPetMutation) AddedField

func (m *UserPetMutation) 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 (*UserPetMutation) AddedFields

func (m *UserPetMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserPetMutation) AddedHungerPercentage

func (m *UserPetMutation) AddedHungerPercentage() (r float64, exists bool)

AddedHungerPercentage returns the value that was added to the "hunger_percentage" field in this mutation.

func (*UserPetMutation) AddedIDs

func (m *UserPetMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserPetMutation) ClearEdge

func (m *UserPetMutation) 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 (*UserPetMutation) ClearField

func (m *UserPetMutation) 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 (*UserPetMutation) ClearPet

func (m *UserPetMutation) ClearPet()

ClearPet clears the "pet" edge to the Pet entity.

func (*UserPetMutation) ClearUser

func (m *UserPetMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*UserPetMutation) ClearedEdges

func (m *UserPetMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserPetMutation) ClearedFields

func (m *UserPetMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserPetMutation) Client

func (m UserPetMutation) 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 (*UserPetMutation) EdgeCleared

func (m *UserPetMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserPetMutation) EnabledSvgGroupElementIds

func (m *UserPetMutation) EnabledSvgGroupElementIds() (r map[string]bool, exists bool)

EnabledSvgGroupElementIds returns the value of the "enabled_svg_group_element_ids" field in the mutation.

func (*UserPetMutation) Field

func (m *UserPetMutation) 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 (*UserPetMutation) FieldCleared

func (m *UserPetMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserPetMutation) Fields

func (m *UserPetMutation) 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 (*UserPetMutation) HungerPercentage

func (m *UserPetMutation) HungerPercentage() (r float64, exists bool)

HungerPercentage returns the value of the "hunger_percentage" field in the mutation.

func (*UserPetMutation) OldField

func (m *UserPetMutation) 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 (*UserPetMutation) Op

func (m *UserPetMutation) Op() Op

Op returns the operation name.

func (*UserPetMutation) PetCleared

func (m *UserPetMutation) PetCleared() bool

PetCleared reports if the "pet" edge to the Pet entity was cleared.

func (*UserPetMutation) PetID

func (m *UserPetMutation) PetID() (r int, exists bool)

PetID returns the value of the "pet_id" field in the mutation.

func (*UserPetMutation) PetIDs

func (m *UserPetMutation) PetIDs() (ids []int)

PetIDs returns the "pet" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use PetID instead. It exists only for internal usage by the builders.

func (*UserPetMutation) RemovedEdges

func (m *UserPetMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserPetMutation) RemovedIDs

func (m *UserPetMutation) 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 (*UserPetMutation) ResetEdge

func (m *UserPetMutation) 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 (*UserPetMutation) ResetEnabledSvgGroupElementIds

func (m *UserPetMutation) ResetEnabledSvgGroupElementIds()

ResetEnabledSvgGroupElementIds resets all changes to the "enabled_svg_group_element_ids" field.

func (*UserPetMutation) ResetField

func (m *UserPetMutation) 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 (*UserPetMutation) ResetHungerPercentage

func (m *UserPetMutation) ResetHungerPercentage()

ResetHungerPercentage resets all changes to the "hunger_percentage" field.

func (*UserPetMutation) ResetPet

func (m *UserPetMutation) ResetPet()

ResetPet resets all changes to the "pet" edge.

func (*UserPetMutation) ResetPetID

func (m *UserPetMutation) ResetPetID()

ResetPetID resets all changes to the "pet_id" field.

func (*UserPetMutation) ResetUser

func (m *UserPetMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*UserPetMutation) ResetUserID

func (m *UserPetMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*UserPetMutation) SetEnabledSvgGroupElementIds

func (m *UserPetMutation) SetEnabledSvgGroupElementIds(value map[string]bool)

SetEnabledSvgGroupElementIds sets the "enabled_svg_group_element_ids" field.

func (*UserPetMutation) SetField

func (m *UserPetMutation) 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 (*UserPetMutation) SetHungerPercentage

func (m *UserPetMutation) SetHungerPercentage(f float64)

SetHungerPercentage sets the "hunger_percentage" field.

func (*UserPetMutation) SetOp

func (m *UserPetMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserPetMutation) SetPetID

func (m *UserPetMutation) SetPetID(i int)

SetPetID sets the "pet_id" field.

func (*UserPetMutation) SetUserID

func (m *UserPetMutation) SetUserID(i int)

SetUserID sets the "user_id" field.

func (UserPetMutation) Tx

func (m UserPetMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserPetMutation) Type

func (m *UserPetMutation) Type() string

Type returns the node type of this mutation (UserPet).

func (*UserPetMutation) UserCleared

func (m *UserPetMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*UserPetMutation) UserID

func (m *UserPetMutation) UserID() (r int, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*UserPetMutation) UserIDs

func (m *UserPetMutation) UserIDs() (ids []int)

UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

func (*UserPetMutation) Where

func (m *UserPetMutation) Where(ps ...predicate.UserPet)

Where appends a list predicates to the UserPetMutation builder.

func (*UserPetMutation) WhereP

func (m *UserPetMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserPetMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UserPetQuery

type UserPetQuery struct {
	// contains filtered or unexported fields
}

UserPetQuery is the builder for querying UserPet entities.

func (*UserPetQuery) Aggregate

func (upq *UserPetQuery) Aggregate(fns ...AggregateFunc) *UserPetSelect

Aggregate returns a UserPetSelect configured with the given aggregations.

func (*UserPetQuery) All

func (upq *UserPetQuery) All(ctx context.Context) ([]*UserPet, error)

All executes the query and returns a list of UserPets.

func (*UserPetQuery) AllX

func (upq *UserPetQuery) AllX(ctx context.Context) []*UserPet

AllX is like All, but panics if an error occurs.

func (*UserPetQuery) Clone

func (upq *UserPetQuery) Clone() *UserPetQuery

Clone returns a duplicate of the UserPetQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserPetQuery) Count

func (upq *UserPetQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserPetQuery) CountX

func (upq *UserPetQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserPetQuery) Exist

func (upq *UserPetQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserPetQuery) ExistX

func (upq *UserPetQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserPetQuery) First

func (upq *UserPetQuery) First(ctx context.Context) (*UserPet, error)

First returns the first UserPet entity from the query. Returns a *NotFoundError when no UserPet was found.

func (*UserPetQuery) FirstX

func (upq *UserPetQuery) FirstX(ctx context.Context) *UserPet

FirstX is like First, but panics if an error occurs.

func (*UserPetQuery) GroupBy

func (upq *UserPetQuery) GroupBy(field string, fields ...string) *UserPetGroupBy

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 {
	HungerPercentage float64 `json:"hunger_percentage,omitempty"`
	Count int `json:"count,omitempty"`
}

client.UserPet.Query().
	GroupBy(userpet.FieldHungerPercentage).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserPetQuery) Limit

func (upq *UserPetQuery) Limit(limit int) *UserPetQuery

Limit the number of records to be returned by this query.

func (*UserPetQuery) Offset

func (upq *UserPetQuery) Offset(offset int) *UserPetQuery

Offset to start from.

func (*UserPetQuery) Only

func (upq *UserPetQuery) Only(ctx context.Context) (*UserPet, error)

Only returns a single UserPet entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one UserPet entity is found. Returns a *NotFoundError when no UserPet entities are found.

func (*UserPetQuery) OnlyX

func (upq *UserPetQuery) OnlyX(ctx context.Context) *UserPet

OnlyX is like Only, but panics if an error occurs.

func (*UserPetQuery) Order

func (upq *UserPetQuery) Order(o ...userpet.OrderOption) *UserPetQuery

Order specifies how the records should be ordered.

func (*UserPetQuery) QueryPet

func (upq *UserPetQuery) QueryPet() *PetQuery

QueryPet chains the current query on the "pet" edge.

func (*UserPetQuery) QueryUser

func (upq *UserPetQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*UserPetQuery) Select

func (upq *UserPetQuery) Select(fields ...string) *UserPetSelect

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 {
	HungerPercentage float64 `json:"hunger_percentage,omitempty"`
}

client.UserPet.Query().
	Select(userpet.FieldHungerPercentage).
	Scan(ctx, &v)

func (*UserPetQuery) Unique

func (upq *UserPetQuery) Unique(unique bool) *UserPetQuery

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 (*UserPetQuery) Where

func (upq *UserPetQuery) Where(ps ...predicate.UserPet) *UserPetQuery

Where adds a new predicate for the UserPetQuery builder.

func (*UserPetQuery) WithPet

func (upq *UserPetQuery) WithPet(opts ...func(*PetQuery)) *UserPetQuery

WithPet tells the query-builder to eager-load the nodes that are connected to the "pet" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserPetQuery) WithUser

func (upq *UserPetQuery) WithUser(opts ...func(*UserQuery)) *UserPetQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type UserPetSelect

type UserPetSelect struct {
	*UserPetQuery
	// contains filtered or unexported fields
}

UserPetSelect is the builder for selecting fields of UserPet entities.

func (*UserPetSelect) Aggregate

func (ups *UserPetSelect) Aggregate(fns ...AggregateFunc) *UserPetSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserPetSelect) Bool

func (s *UserPetSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserPetSelect) BoolX

func (s *UserPetSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserPetSelect) Bools

func (s *UserPetSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserPetSelect) BoolsX

func (s *UserPetSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserPetSelect) Float64

func (s *UserPetSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserPetSelect) Float64X

func (s *UserPetSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserPetSelect) Float64s

func (s *UserPetSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserPetSelect) Float64sX

func (s *UserPetSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserPetSelect) Int

func (s *UserPetSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserPetSelect) IntX

func (s *UserPetSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserPetSelect) Ints

func (s *UserPetSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserPetSelect) IntsX

func (s *UserPetSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserPetSelect) Scan

func (ups *UserPetSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserPetSelect) ScanX

func (s *UserPetSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserPetSelect) String

func (s *UserPetSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserPetSelect) StringX

func (s *UserPetSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserPetSelect) Strings

func (s *UserPetSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserPetSelect) StringsX

func (s *UserPetSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserPetUpdate

type UserPetUpdate struct {
	// contains filtered or unexported fields
}

UserPetUpdate is the builder for updating UserPet entities.

func (*UserPetUpdate) AddHungerPercentage

func (upu *UserPetUpdate) AddHungerPercentage(f float64) *UserPetUpdate

AddHungerPercentage adds f to the "hunger_percentage" field.

func (*UserPetUpdate) ClearPet

func (upu *UserPetUpdate) ClearPet() *UserPetUpdate

ClearPet clears the "pet" edge to the Pet entity.

func (*UserPetUpdate) ClearUser

func (upu *UserPetUpdate) ClearUser() *UserPetUpdate

ClearUser clears the "user" edge to the User entity.

func (*UserPetUpdate) Exec

func (upu *UserPetUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserPetUpdate) ExecX

func (upu *UserPetUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserPetUpdate) Mutation

func (upu *UserPetUpdate) Mutation() *UserPetMutation

Mutation returns the UserPetMutation object of the builder.

func (*UserPetUpdate) Save

func (upu *UserPetUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserPetUpdate) SaveX

func (upu *UserPetUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserPetUpdate) SetEnabledSvgGroupElementIds

func (upu *UserPetUpdate) SetEnabledSvgGroupElementIds(m map[string]bool) *UserPetUpdate

SetEnabledSvgGroupElementIds sets the "enabled_svg_group_element_ids" field.

func (*UserPetUpdate) SetHungerPercentage

func (upu *UserPetUpdate) SetHungerPercentage(f float64) *UserPetUpdate

SetHungerPercentage sets the "hunger_percentage" field.

func (*UserPetUpdate) SetPet

func (upu *UserPetUpdate) SetPet(p *Pet) *UserPetUpdate

SetPet sets the "pet" edge to the Pet entity.

func (*UserPetUpdate) SetPetID

func (upu *UserPetUpdate) SetPetID(i int) *UserPetUpdate

SetPetID sets the "pet_id" field.

func (*UserPetUpdate) SetUser

func (upu *UserPetUpdate) SetUser(u *User) *UserPetUpdate

SetUser sets the "user" edge to the User entity.

func (*UserPetUpdate) SetUserID

func (upu *UserPetUpdate) SetUserID(i int) *UserPetUpdate

SetUserID sets the "user_id" field.

func (*UserPetUpdate) Where

func (upu *UserPetUpdate) Where(ps ...predicate.UserPet) *UserPetUpdate

Where appends a list predicates to the UserPetUpdate builder.

type UserPetUpdateOne

type UserPetUpdateOne struct {
	// contains filtered or unexported fields
}

UserPetUpdateOne is the builder for updating a single UserPet entity.

func (*UserPetUpdateOne) AddHungerPercentage

func (upuo *UserPetUpdateOne) AddHungerPercentage(f float64) *UserPetUpdateOne

AddHungerPercentage adds f to the "hunger_percentage" field.

func (*UserPetUpdateOne) ClearPet

func (upuo *UserPetUpdateOne) ClearPet() *UserPetUpdateOne

ClearPet clears the "pet" edge to the Pet entity.

func (*UserPetUpdateOne) ClearUser

func (upuo *UserPetUpdateOne) ClearUser() *UserPetUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*UserPetUpdateOne) Exec

func (upuo *UserPetUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserPetUpdateOne) ExecX

func (upuo *UserPetUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserPetUpdateOne) Mutation

func (upuo *UserPetUpdateOne) Mutation() *UserPetMutation

Mutation returns the UserPetMutation object of the builder.

func (*UserPetUpdateOne) Save

func (upuo *UserPetUpdateOne) Save(ctx context.Context) (*UserPet, error)

Save executes the query and returns the updated UserPet entity.

func (*UserPetUpdateOne) SaveX

func (upuo *UserPetUpdateOne) SaveX(ctx context.Context) *UserPet

SaveX is like Save, but panics if an error occurs.

func (*UserPetUpdateOne) Select

func (upuo *UserPetUpdateOne) Select(field string, fields ...string) *UserPetUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserPetUpdateOne) SetEnabledSvgGroupElementIds

func (upuo *UserPetUpdateOne) SetEnabledSvgGroupElementIds(m map[string]bool) *UserPetUpdateOne

SetEnabledSvgGroupElementIds sets the "enabled_svg_group_element_ids" field.

func (*UserPetUpdateOne) SetHungerPercentage

func (upuo *UserPetUpdateOne) SetHungerPercentage(f float64) *UserPetUpdateOne

SetHungerPercentage sets the "hunger_percentage" field.

func (*UserPetUpdateOne) SetPet

func (upuo *UserPetUpdateOne) SetPet(p *Pet) *UserPetUpdateOne

SetPet sets the "pet" edge to the Pet entity.

func (*UserPetUpdateOne) SetPetID

func (upuo *UserPetUpdateOne) SetPetID(i int) *UserPetUpdateOne

SetPetID sets the "pet_id" field.

func (*UserPetUpdateOne) SetUser

func (upuo *UserPetUpdateOne) SetUser(u *User) *UserPetUpdateOne

SetUser sets the "user" edge to the User entity.

func (*UserPetUpdateOne) SetUserID

func (upuo *UserPetUpdateOne) SetUserID(i int) *UserPetUpdateOne

SetUserID sets the "user_id" field.

func (*UserPetUpdateOne) Where

func (upuo *UserPetUpdateOne) Where(ps ...predicate.UserPet) *UserPetUpdateOne

Where appends a list predicates to the UserPetUpdate builder.

type UserPetUpsert

type UserPetUpsert struct {
	*sql.UpdateSet
}

UserPetUpsert is the "OnConflict" setter.

func (*UserPetUpsert) AddHungerPercentage

func (u *UserPetUpsert) AddHungerPercentage(v float64) *UserPetUpsert

AddHungerPercentage adds v to the "hunger_percentage" field.

func (*UserPetUpsert) SetEnabledSvgGroupElementIds

func (u *UserPetUpsert) SetEnabledSvgGroupElementIds(v map[string]bool) *UserPetUpsert

SetEnabledSvgGroupElementIds sets the "enabled_svg_group_element_ids" field.

func (*UserPetUpsert) SetHungerPercentage

func (u *UserPetUpsert) SetHungerPercentage(v float64) *UserPetUpsert

SetHungerPercentage sets the "hunger_percentage" field.

func (*UserPetUpsert) SetPetID

func (u *UserPetUpsert) SetPetID(v int) *UserPetUpsert

SetPetID sets the "pet_id" field.

func (*UserPetUpsert) SetUserID

func (u *UserPetUpsert) SetUserID(v int) *UserPetUpsert

SetUserID sets the "user_id" field.

func (*UserPetUpsert) UpdateEnabledSvgGroupElementIds

func (u *UserPetUpsert) UpdateEnabledSvgGroupElementIds() *UserPetUpsert

UpdateEnabledSvgGroupElementIds sets the "enabled_svg_group_element_ids" field to the value that was provided on create.

func (*UserPetUpsert) UpdateHungerPercentage

func (u *UserPetUpsert) UpdateHungerPercentage() *UserPetUpsert

UpdateHungerPercentage sets the "hunger_percentage" field to the value that was provided on create.

func (*UserPetUpsert) UpdatePetID

func (u *UserPetUpsert) UpdatePetID() *UserPetUpsert

UpdatePetID sets the "pet_id" field to the value that was provided on create.

func (*UserPetUpsert) UpdateUserID

func (u *UserPetUpsert) UpdateUserID() *UserPetUpsert

UpdateUserID sets the "user_id" field to the value that was provided on create.

type UserPetUpsertBulk

type UserPetUpsertBulk struct {
	// contains filtered or unexported fields
}

UserPetUpsertBulk is the builder for "upsert"-ing a bulk of UserPet nodes.

func (*UserPetUpsertBulk) AddHungerPercentage

func (u *UserPetUpsertBulk) AddHungerPercentage(v float64) *UserPetUpsertBulk

AddHungerPercentage adds v to the "hunger_percentage" field.

func (*UserPetUpsertBulk) DoNothing

func (u *UserPetUpsertBulk) DoNothing() *UserPetUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserPetUpsertBulk) Exec

func (u *UserPetUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserPetUpsertBulk) ExecX

func (u *UserPetUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserPetUpsertBulk) Ignore

func (u *UserPetUpsertBulk) Ignore() *UserPetUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.UserPet.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*UserPetUpsertBulk) SetEnabledSvgGroupElementIds

func (u *UserPetUpsertBulk) SetEnabledSvgGroupElementIds(v map[string]bool) *UserPetUpsertBulk

SetEnabledSvgGroupElementIds sets the "enabled_svg_group_element_ids" field.

func (*UserPetUpsertBulk) SetHungerPercentage

func (u *UserPetUpsertBulk) SetHungerPercentage(v float64) *UserPetUpsertBulk

SetHungerPercentage sets the "hunger_percentage" field.

func (*UserPetUpsertBulk) SetPetID

func (u *UserPetUpsertBulk) SetPetID(v int) *UserPetUpsertBulk

SetPetID sets the "pet_id" field.

func (*UserPetUpsertBulk) SetUserID

func (u *UserPetUpsertBulk) SetUserID(v int) *UserPetUpsertBulk

SetUserID sets the "user_id" field.

func (*UserPetUpsertBulk) Update

func (u *UserPetUpsertBulk) Update(set func(*UserPetUpsert)) *UserPetUpsertBulk

Update allows overriding fields `UPDATE` values. See the UserPetCreateBulk.OnConflict documentation for more info.

func (*UserPetUpsertBulk) UpdateEnabledSvgGroupElementIds

func (u *UserPetUpsertBulk) UpdateEnabledSvgGroupElementIds() *UserPetUpsertBulk

UpdateEnabledSvgGroupElementIds sets the "enabled_svg_group_element_ids" field to the value that was provided on create.

func (*UserPetUpsertBulk) UpdateHungerPercentage

func (u *UserPetUpsertBulk) UpdateHungerPercentage() *UserPetUpsertBulk

UpdateHungerPercentage sets the "hunger_percentage" field to the value that was provided on create.

func (*UserPetUpsertBulk) UpdateNewValues

func (u *UserPetUpsertBulk) UpdateNewValues() *UserPetUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.UserPet.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*UserPetUpsertBulk) UpdatePetID

func (u *UserPetUpsertBulk) UpdatePetID() *UserPetUpsertBulk

UpdatePetID sets the "pet_id" field to the value that was provided on create.

func (*UserPetUpsertBulk) UpdateUserID

func (u *UserPetUpsertBulk) UpdateUserID() *UserPetUpsertBulk

UpdateUserID sets the "user_id" field to the value that was provided on create.

type UserPetUpsertOne

type UserPetUpsertOne struct {
	// contains filtered or unexported fields
}

UserPetUpsertOne is the builder for "upsert"-ing

one UserPet node.

func (*UserPetUpsertOne) AddHungerPercentage

func (u *UserPetUpsertOne) AddHungerPercentage(v float64) *UserPetUpsertOne

AddHungerPercentage adds v to the "hunger_percentage" field.

func (*UserPetUpsertOne) DoNothing

func (u *UserPetUpsertOne) DoNothing() *UserPetUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserPetUpsertOne) Exec

func (u *UserPetUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*UserPetUpsertOne) ExecX

func (u *UserPetUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserPetUpsertOne) Ignore

func (u *UserPetUpsertOne) Ignore() *UserPetUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.UserPet.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*UserPetUpsertOne) SetEnabledSvgGroupElementIds

func (u *UserPetUpsertOne) SetEnabledSvgGroupElementIds(v map[string]bool) *UserPetUpsertOne

SetEnabledSvgGroupElementIds sets the "enabled_svg_group_element_ids" field.

func (*UserPetUpsertOne) SetHungerPercentage

func (u *UserPetUpsertOne) SetHungerPercentage(v float64) *UserPetUpsertOne

SetHungerPercentage sets the "hunger_percentage" field.

func (*UserPetUpsertOne) SetPetID

func (u *UserPetUpsertOne) SetPetID(v int) *UserPetUpsertOne

SetPetID sets the "pet_id" field.

func (*UserPetUpsertOne) SetUserID

func (u *UserPetUpsertOne) SetUserID(v int) *UserPetUpsertOne

SetUserID sets the "user_id" field.

func (*UserPetUpsertOne) Update

func (u *UserPetUpsertOne) Update(set func(*UserPetUpsert)) *UserPetUpsertOne

Update allows overriding fields `UPDATE` values. See the UserPetCreate.OnConflict documentation for more info.

func (*UserPetUpsertOne) UpdateEnabledSvgGroupElementIds

func (u *UserPetUpsertOne) UpdateEnabledSvgGroupElementIds() *UserPetUpsertOne

UpdateEnabledSvgGroupElementIds sets the "enabled_svg_group_element_ids" field to the value that was provided on create.

func (*UserPetUpsertOne) UpdateHungerPercentage

func (u *UserPetUpsertOne) UpdateHungerPercentage() *UserPetUpsertOne

UpdateHungerPercentage sets the "hunger_percentage" field to the value that was provided on create.

func (*UserPetUpsertOne) UpdateNewValues

func (u *UserPetUpsertOne) UpdateNewValues() *UserPetUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.UserPet.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*UserPetUpsertOne) UpdatePetID

func (u *UserPetUpsertOne) UpdatePetID() *UserPetUpsertOne

UpdatePetID sets the "pet_id" field to the value that was provided on create.

func (*UserPetUpsertOne) UpdateUserID

func (u *UserPetUpsertOne) UpdateUserID() *UserPetUpsertOne

UpdateUserID sets the "user_id" field to the value that was provided on create.

type UserPets

type UserPets []*UserPet

UserPets is a parsable slice of UserPet.

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 int, 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) int

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 {
	FirstName string `json:"first_name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldFirstName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []int

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 int, 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) int

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) QueryAuthoredDeadlines

func (uq *UserQuery) QueryAuthoredDeadlines() *DeadlineQuery

QueryAuthoredDeadlines chains the current query on the "authored_deadlines" edge.

func (*UserQuery) QueryForumPosts

func (uq *UserQuery) QueryForumPosts() *ForumPostQuery

QueryForumPosts chains the current query on the "forum_posts" edge.

func (*UserQuery) QueryGroupUsers

func (uq *UserQuery) QueryGroupUsers() *GroupUserQuery

QueryGroupUsers chains the current query on the "group_users" edge.

func (*UserQuery) QueryGroups

func (uq *UserQuery) QueryGroups() *GroupQuery

QueryGroups chains the current query on the "groups" edge.

func (*UserQuery) QueryInstitution

func (uq *UserQuery) QueryInstitution() *InstitutionQuery

QueryInstitution chains the current query on the "institution" edge.

func (*UserQuery) QueryPet

func (uq *UserQuery) QueryPet() *PetQuery

QueryPet chains the current query on the "pet" edge.

func (*UserQuery) QueryReactedPosts

func (uq *UserQuery) QueryReactedPosts() *ForumPostQuery

QueryReactedPosts chains the current query on the "reacted_posts" edge.

func (*UserQuery) QueryReactions

func (uq *UserQuery) QueryReactions() *ReactionQuery

QueryReactions chains the current query on the "reactions" edge.

func (*UserQuery) QueryRedemptions

func (uq *UserQuery) QueryRedemptions() *RedemptionQuery

QueryRedemptions chains the current query on the "redemptions" edge.

func (*UserQuery) QueryUserPets

func (uq *UserQuery) QueryUserPets() *UserPetQuery

QueryUserPets chains the current query on the "user_pets" edge.

func (*UserQuery) QueryVotedDeadlines

func (uq *UserQuery) QueryVotedDeadlines() *DeadlineQuery

QueryVotedDeadlines chains the current query on the "voted_deadlines" 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 {
	FirstName string `json:"first_name,omitempty"`
}

client.User.Query().
	Select(user.FieldFirstName).
	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) WithAuthoredDeadlines

func (uq *UserQuery) WithAuthoredDeadlines(opts ...func(*DeadlineQuery)) *UserQuery

WithAuthoredDeadlines tells the query-builder to eager-load the nodes that are connected to the "authored_deadlines" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithForumPosts

func (uq *UserQuery) WithForumPosts(opts ...func(*ForumPostQuery)) *UserQuery

WithForumPosts tells the query-builder to eager-load the nodes that are connected to the "forum_posts" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithGroupUsers

func (uq *UserQuery) WithGroupUsers(opts ...func(*GroupUserQuery)) *UserQuery

WithGroupUsers tells the query-builder to eager-load the nodes that are connected to the "group_users" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithGroups

func (uq *UserQuery) WithGroups(opts ...func(*GroupQuery)) *UserQuery

WithGroups tells the query-builder to eager-load the nodes that are connected to the "groups" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithInstitution

func (uq *UserQuery) WithInstitution(opts ...func(*InstitutionQuery)) *UserQuery

WithInstitution tells the query-builder to eager-load the nodes that are connected to the "institution" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithPet

func (uq *UserQuery) WithPet(opts ...func(*PetQuery)) *UserQuery

WithPet tells the query-builder to eager-load the nodes that are connected to the "pet" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithReactedPosts

func (uq *UserQuery) WithReactedPosts(opts ...func(*ForumPostQuery)) *UserQuery

WithReactedPosts tells the query-builder to eager-load the nodes that are connected to the "reacted_posts" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithReactions

func (uq *UserQuery) WithReactions(opts ...func(*ReactionQuery)) *UserQuery

WithReactions tells the query-builder to eager-load the nodes that are connected to the "reactions" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithRedemptions

func (uq *UserQuery) WithRedemptions(opts ...func(*RedemptionQuery)) *UserQuery

WithRedemptions tells the query-builder to eager-load the nodes that are connected to the "redemptions" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithUserPets

func (uq *UserQuery) WithUserPets(opts ...func(*UserPetQuery)) *UserQuery

WithUserPets tells the query-builder to eager-load the nodes that are connected to the "user_pets" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithVotedDeadlines

func (uq *UserQuery) WithVotedDeadlines(opts ...func(*DeadlineQuery)) *UserQuery

WithVotedDeadlines tells the query-builder to eager-load the nodes that are connected to the "voted_deadlines" 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) AddAuthoredDeadlineIDs

func (uu *UserUpdate) AddAuthoredDeadlineIDs(ids ...int) *UserUpdate

AddAuthoredDeadlineIDs adds the "authored_deadlines" edge to the Deadline entity by IDs.

func (*UserUpdate) AddAuthoredDeadlines

func (uu *UserUpdate) AddAuthoredDeadlines(d ...*Deadline) *UserUpdate

AddAuthoredDeadlines adds the "authored_deadlines" edges to the Deadline entity.

func (*UserUpdate) AddForumPostIDs

func (uu *UserUpdate) AddForumPostIDs(ids ...int) *UserUpdate

AddForumPostIDs adds the "forum_posts" edge to the ForumPost entity by IDs.

func (*UserUpdate) AddForumPosts

func (uu *UserUpdate) AddForumPosts(f ...*ForumPost) *UserUpdate

AddForumPosts adds the "forum_posts" edges to the ForumPost entity.

func (*UserUpdate) AddGroupIDs

func (uu *UserUpdate) AddGroupIDs(ids ...int) *UserUpdate

AddGroupIDs adds the "groups" edge to the Group entity by IDs.

func (*UserUpdate) AddGroups

func (uu *UserUpdate) AddGroups(g ...*Group) *UserUpdate

AddGroups adds the "groups" edges to the Group entity.

func (*UserUpdate) AddPet

func (uu *UserUpdate) AddPet(p ...*Pet) *UserUpdate

AddPet adds the "pet" edges to the Pet entity.

func (*UserUpdate) AddPetIDs

func (uu *UserUpdate) AddPetIDs(ids ...int) *UserUpdate

AddPetIDs adds the "pet" edge to the Pet entity by IDs.

func (*UserUpdate) AddPoints

func (uu *UserUpdate) AddPoints(i int) *UserUpdate

AddPoints adds i to the "points" field.

func (*UserUpdate) AddPointsAwardedCount

func (uu *UserUpdate) AddPointsAwardedCount(i int) *UserUpdate

AddPointsAwardedCount adds i to the "points_awarded_count" field.

func (*UserUpdate) AddReactedPostIDs

func (uu *UserUpdate) AddReactedPostIDs(ids ...int) *UserUpdate

AddReactedPostIDs adds the "reacted_posts" edge to the ForumPost entity by IDs.

func (*UserUpdate) AddReactedPosts

func (uu *UserUpdate) AddReactedPosts(f ...*ForumPost) *UserUpdate

AddReactedPosts adds the "reacted_posts" edges to the ForumPost entity.

func (*UserUpdate) AddRedemptionIDs

func (uu *UserUpdate) AddRedemptionIDs(ids ...int) *UserUpdate

AddRedemptionIDs adds the "redemptions" edge to the Redemption entity by IDs.

func (*UserUpdate) AddRedemptions

func (uu *UserUpdate) AddRedemptions(r ...*Redemption) *UserUpdate

AddRedemptions adds the "redemptions" edges to the Redemption entity.

func (*UserUpdate) AddVotedDeadlineIDs

func (uu *UserUpdate) AddVotedDeadlineIDs(ids ...int) *UserUpdate

AddVotedDeadlineIDs adds the "voted_deadlines" edge to the Deadline entity by IDs.

func (*UserUpdate) AddVotedDeadlines

func (uu *UserUpdate) AddVotedDeadlines(d ...*Deadline) *UserUpdate

AddVotedDeadlines adds the "voted_deadlines" edges to the Deadline entity.

func (*UserUpdate) ClearAuthoredDeadlines

func (uu *UserUpdate) ClearAuthoredDeadlines() *UserUpdate

ClearAuthoredDeadlines clears all "authored_deadlines" edges to the Deadline entity.

func (*UserUpdate) ClearForumPosts

func (uu *UserUpdate) ClearForumPosts() *UserUpdate

ClearForumPosts clears all "forum_posts" edges to the ForumPost entity.

func (*UserUpdate) ClearGroups

func (uu *UserUpdate) ClearGroups() *UserUpdate

ClearGroups clears all "groups" edges to the Group entity.

func (*UserUpdate) ClearInstitution

func (uu *UserUpdate) ClearInstitution() *UserUpdate

ClearInstitution clears the "institution" edge to the Institution entity.

func (*UserUpdate) ClearPet

func (uu *UserUpdate) ClearPet() *UserUpdate

ClearPet clears all "pet" edges to the Pet entity.

func (*UserUpdate) ClearPointsAwardedResetTime

func (uu *UserUpdate) ClearPointsAwardedResetTime() *UserUpdate

ClearPointsAwardedResetTime clears the value of the "points_awarded_reset_time" field.

func (*UserUpdate) ClearReactedPosts

func (uu *UserUpdate) ClearReactedPosts() *UserUpdate

ClearReactedPosts clears all "reacted_posts" edges to the ForumPost entity.

func (*UserUpdate) ClearRedemptions

func (uu *UserUpdate) ClearRedemptions() *UserUpdate

ClearRedemptions clears all "redemptions" edges to the Redemption entity.

func (*UserUpdate) ClearVotedDeadlines

func (uu *UserUpdate) ClearVotedDeadlines() *UserUpdate

ClearVotedDeadlines clears all "voted_deadlines" edges to the Deadline 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) RemoveAuthoredDeadlineIDs

func (uu *UserUpdate) RemoveAuthoredDeadlineIDs(ids ...int) *UserUpdate

RemoveAuthoredDeadlineIDs removes the "authored_deadlines" edge to Deadline entities by IDs.

func (*UserUpdate) RemoveAuthoredDeadlines

func (uu *UserUpdate) RemoveAuthoredDeadlines(d ...*Deadline) *UserUpdate

RemoveAuthoredDeadlines removes "authored_deadlines" edges to Deadline entities.

func (*UserUpdate) RemoveForumPostIDs

func (uu *UserUpdate) RemoveForumPostIDs(ids ...int) *UserUpdate

RemoveForumPostIDs removes the "forum_posts" edge to ForumPost entities by IDs.

func (*UserUpdate) RemoveForumPosts

func (uu *UserUpdate) RemoveForumPosts(f ...*ForumPost) *UserUpdate

RemoveForumPosts removes "forum_posts" edges to ForumPost entities.

func (*UserUpdate) RemoveGroupIDs

func (uu *UserUpdate) RemoveGroupIDs(ids ...int) *UserUpdate

RemoveGroupIDs removes the "groups" edge to Group entities by IDs.

func (*UserUpdate) RemoveGroups

func (uu *UserUpdate) RemoveGroups(g ...*Group) *UserUpdate

RemoveGroups removes "groups" edges to Group entities.

func (*UserUpdate) RemovePet

func (uu *UserUpdate) RemovePet(p ...*Pet) *UserUpdate

RemovePet removes "pet" edges to Pet entities.

func (*UserUpdate) RemovePetIDs

func (uu *UserUpdate) RemovePetIDs(ids ...int) *UserUpdate

RemovePetIDs removes the "pet" edge to Pet entities by IDs.

func (*UserUpdate) RemoveReactedPostIDs

func (uu *UserUpdate) RemoveReactedPostIDs(ids ...int) *UserUpdate

RemoveReactedPostIDs removes the "reacted_posts" edge to ForumPost entities by IDs.

func (*UserUpdate) RemoveReactedPosts

func (uu *UserUpdate) RemoveReactedPosts(f ...*ForumPost) *UserUpdate

RemoveReactedPosts removes "reacted_posts" edges to ForumPost entities.

func (*UserUpdate) RemoveRedemptionIDs

func (uu *UserUpdate) RemoveRedemptionIDs(ids ...int) *UserUpdate

RemoveRedemptionIDs removes the "redemptions" edge to Redemption entities by IDs.

func (*UserUpdate) RemoveRedemptions

func (uu *UserUpdate) RemoveRedemptions(r ...*Redemption) *UserUpdate

RemoveRedemptions removes "redemptions" edges to Redemption entities.

func (*UserUpdate) RemoveVotedDeadlineIDs

func (uu *UserUpdate) RemoveVotedDeadlineIDs(ids ...int) *UserUpdate

RemoveVotedDeadlineIDs removes the "voted_deadlines" edge to Deadline entities by IDs.

func (*UserUpdate) RemoveVotedDeadlines

func (uu *UserUpdate) RemoveVotedDeadlines(d ...*Deadline) *UserUpdate

RemoveVotedDeadlines removes "voted_deadlines" edges to Deadline 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) SetFirstName

func (uu *UserUpdate) SetFirstName(s string) *UserUpdate

SetFirstName sets the "first_name" field.

func (*UserUpdate) SetGodMode

func (uu *UserUpdate) SetGodMode(b bool) *UserUpdate

SetGodMode sets the "god_mode" field.

func (*UserUpdate) SetInstitution

func (uu *UserUpdate) SetInstitution(i *Institution) *UserUpdate

SetInstitution sets the "institution" edge to the Institution entity.

func (*UserUpdate) SetInstitutionID

func (uu *UserUpdate) SetInstitutionID(id int) *UserUpdate

SetInstitutionID sets the "institution" edge to the Institution entity by ID.

func (*UserUpdate) SetLastName

func (uu *UserUpdate) SetLastName(s string) *UserUpdate

SetLastName sets the "last_name" field.

func (*UserUpdate) SetNillablePoints

func (uu *UserUpdate) SetNillablePoints(i *int) *UserUpdate

SetNillablePoints sets the "points" field if the given value is not nil.

func (*UserUpdate) SetNillablePointsAwardedCount

func (uu *UserUpdate) SetNillablePointsAwardedCount(i *int) *UserUpdate

SetNillablePointsAwardedCount sets the "points_awarded_count" field if the given value is not nil.

func (*UserUpdate) SetNillablePointsAwardedResetTime

func (uu *UserUpdate) SetNillablePointsAwardedResetTime(t *time.Time) *UserUpdate

SetNillablePointsAwardedResetTime sets the "points_awarded_reset_time" field if the given value is not nil.

func (*UserUpdate) SetPassword

func (uu *UserUpdate) SetPassword(h hash.Encoded) *UserUpdate

SetPassword sets the "password" field.

func (*UserUpdate) SetPoints

func (uu *UserUpdate) SetPoints(i int) *UserUpdate

SetPoints sets the "points" field.

func (*UserUpdate) SetPointsAwardedCount

func (uu *UserUpdate) SetPointsAwardedCount(i int) *UserUpdate

SetPointsAwardedCount sets the "points_awarded_count" field.

func (*UserUpdate) SetPointsAwardedResetTime

func (uu *UserUpdate) SetPointsAwardedResetTime(t time.Time) *UserUpdate

SetPointsAwardedResetTime sets the "points_awarded_reset_time" field.

func (*UserUpdate) SetRole

func (uu *UserUpdate) SetRole(i institution.Role) *UserUpdate

SetRole sets the "role" 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) AddAuthoredDeadlineIDs

func (uuo *UserUpdateOne) AddAuthoredDeadlineIDs(ids ...int) *UserUpdateOne

AddAuthoredDeadlineIDs adds the "authored_deadlines" edge to the Deadline entity by IDs.

func (*UserUpdateOne) AddAuthoredDeadlines

func (uuo *UserUpdateOne) AddAuthoredDeadlines(d ...*Deadline) *UserUpdateOne

AddAuthoredDeadlines adds the "authored_deadlines" edges to the Deadline entity.

func (*UserUpdateOne) AddForumPostIDs

func (uuo *UserUpdateOne) AddForumPostIDs(ids ...int) *UserUpdateOne

AddForumPostIDs adds the "forum_posts" edge to the ForumPost entity by IDs.

func (*UserUpdateOne) AddForumPosts

func (uuo *UserUpdateOne) AddForumPosts(f ...*ForumPost) *UserUpdateOne

AddForumPosts adds the "forum_posts" edges to the ForumPost entity.

func (*UserUpdateOne) AddGroupIDs

func (uuo *UserUpdateOne) AddGroupIDs(ids ...int) *UserUpdateOne

AddGroupIDs adds the "groups" edge to the Group entity by IDs.

func (*UserUpdateOne) AddGroups

func (uuo *UserUpdateOne) AddGroups(g ...*Group) *UserUpdateOne

AddGroups adds the "groups" edges to the Group entity.

func (*UserUpdateOne) AddPet

func (uuo *UserUpdateOne) AddPet(p ...*Pet) *UserUpdateOne

AddPet adds the "pet" edges to the Pet entity.

func (*UserUpdateOne) AddPetIDs

func (uuo *UserUpdateOne) AddPetIDs(ids ...int) *UserUpdateOne

AddPetIDs adds the "pet" edge to the Pet entity by IDs.

func (*UserUpdateOne) AddPoints

func (uuo *UserUpdateOne) AddPoints(i int) *UserUpdateOne

AddPoints adds i to the "points" field.

func (*UserUpdateOne) AddPointsAwardedCount

func (uuo *UserUpdateOne) AddPointsAwardedCount(i int) *UserUpdateOne

AddPointsAwardedCount adds i to the "points_awarded_count" field.

func (*UserUpdateOne) AddReactedPostIDs

func (uuo *UserUpdateOne) AddReactedPostIDs(ids ...int) *UserUpdateOne

AddReactedPostIDs adds the "reacted_posts" edge to the ForumPost entity by IDs.

func (*UserUpdateOne) AddReactedPosts

func (uuo *UserUpdateOne) AddReactedPosts(f ...*ForumPost) *UserUpdateOne

AddReactedPosts adds the "reacted_posts" edges to the ForumPost entity.

func (*UserUpdateOne) AddRedemptionIDs

func (uuo *UserUpdateOne) AddRedemptionIDs(ids ...int) *UserUpdateOne

AddRedemptionIDs adds the "redemptions" edge to the Redemption entity by IDs.

func (*UserUpdateOne) AddRedemptions

func (uuo *UserUpdateOne) AddRedemptions(r ...*Redemption) *UserUpdateOne

AddRedemptions adds the "redemptions" edges to the Redemption entity.

func (*UserUpdateOne) AddVotedDeadlineIDs

func (uuo *UserUpdateOne) AddVotedDeadlineIDs(ids ...int) *UserUpdateOne

AddVotedDeadlineIDs adds the "voted_deadlines" edge to the Deadline entity by IDs.

func (*UserUpdateOne) AddVotedDeadlines

func (uuo *UserUpdateOne) AddVotedDeadlines(d ...*Deadline) *UserUpdateOne

AddVotedDeadlines adds the "voted_deadlines" edges to the Deadline entity.

func (*UserUpdateOne) ClearAuthoredDeadlines

func (uuo *UserUpdateOne) ClearAuthoredDeadlines() *UserUpdateOne

ClearAuthoredDeadlines clears all "authored_deadlines" edges to the Deadline entity.

func (*UserUpdateOne) ClearForumPosts

func (uuo *UserUpdateOne) ClearForumPosts() *UserUpdateOne

ClearForumPosts clears all "forum_posts" edges to the ForumPost entity.

func (*UserUpdateOne) ClearGroups

func (uuo *UserUpdateOne) ClearGroups() *UserUpdateOne

ClearGroups clears all "groups" edges to the Group entity.

func (*UserUpdateOne) ClearInstitution

func (uuo *UserUpdateOne) ClearInstitution() *UserUpdateOne

ClearInstitution clears the "institution" edge to the Institution entity.

func (*UserUpdateOne) ClearPet

func (uuo *UserUpdateOne) ClearPet() *UserUpdateOne

ClearPet clears all "pet" edges to the Pet entity.

func (*UserUpdateOne) ClearPointsAwardedResetTime

func (uuo *UserUpdateOne) ClearPointsAwardedResetTime() *UserUpdateOne

ClearPointsAwardedResetTime clears the value of the "points_awarded_reset_time" field.

func (*UserUpdateOne) ClearReactedPosts

func (uuo *UserUpdateOne) ClearReactedPosts() *UserUpdateOne

ClearReactedPosts clears all "reacted_posts" edges to the ForumPost entity.

func (*UserUpdateOne) ClearRedemptions

func (uuo *UserUpdateOne) ClearRedemptions() *UserUpdateOne

ClearRedemptions clears all "redemptions" edges to the Redemption entity.

func (*UserUpdateOne) ClearVotedDeadlines

func (uuo *UserUpdateOne) ClearVotedDeadlines() *UserUpdateOne

ClearVotedDeadlines clears all "voted_deadlines" edges to the Deadline 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) RemoveAuthoredDeadlineIDs

func (uuo *UserUpdateOne) RemoveAuthoredDeadlineIDs(ids ...int) *UserUpdateOne

RemoveAuthoredDeadlineIDs removes the "authored_deadlines" edge to Deadline entities by IDs.

func (*UserUpdateOne) RemoveAuthoredDeadlines

func (uuo *UserUpdateOne) RemoveAuthoredDeadlines(d ...*Deadline) *UserUpdateOne

RemoveAuthoredDeadlines removes "authored_deadlines" edges to Deadline entities.

func (*UserUpdateOne) RemoveForumPostIDs

func (uuo *UserUpdateOne) RemoveForumPostIDs(ids ...int) *UserUpdateOne

RemoveForumPostIDs removes the "forum_posts" edge to ForumPost entities by IDs.

func (*UserUpdateOne) RemoveForumPosts

func (uuo *UserUpdateOne) RemoveForumPosts(f ...*ForumPost) *UserUpdateOne

RemoveForumPosts removes "forum_posts" edges to ForumPost entities.

func (*UserUpdateOne) RemoveGroupIDs

func (uuo *UserUpdateOne) RemoveGroupIDs(ids ...int) *UserUpdateOne

RemoveGroupIDs removes the "groups" edge to Group entities by IDs.

func (*UserUpdateOne) RemoveGroups

func (uuo *UserUpdateOne) RemoveGroups(g ...*Group) *UserUpdateOne

RemoveGroups removes "groups" edges to Group entities.

func (*UserUpdateOne) RemovePet

func (uuo *UserUpdateOne) RemovePet(p ...*Pet) *UserUpdateOne

RemovePet removes "pet" edges to Pet entities.

func (*UserUpdateOne) RemovePetIDs

func (uuo *UserUpdateOne) RemovePetIDs(ids ...int) *UserUpdateOne

RemovePetIDs removes the "pet" edge to Pet entities by IDs.

func (*UserUpdateOne) RemoveReactedPostIDs

func (uuo *UserUpdateOne) RemoveReactedPostIDs(ids ...int) *UserUpdateOne

RemoveReactedPostIDs removes the "reacted_posts" edge to ForumPost entities by IDs.

func (*UserUpdateOne) RemoveReactedPosts

func (uuo *UserUpdateOne) RemoveReactedPosts(f ...*ForumPost) *UserUpdateOne

RemoveReactedPosts removes "reacted_posts" edges to ForumPost entities.

func (*UserUpdateOne) RemoveRedemptionIDs

func (uuo *UserUpdateOne) RemoveRedemptionIDs(ids ...int) *UserUpdateOne

RemoveRedemptionIDs removes the "redemptions" edge to Redemption entities by IDs.

func (*UserUpdateOne) RemoveRedemptions

func (uuo *UserUpdateOne) RemoveRedemptions(r ...*Redemption) *UserUpdateOne

RemoveRedemptions removes "redemptions" edges to Redemption entities.

func (*UserUpdateOne) RemoveVotedDeadlineIDs

func (uuo *UserUpdateOne) RemoveVotedDeadlineIDs(ids ...int) *UserUpdateOne

RemoveVotedDeadlineIDs removes the "voted_deadlines" edge to Deadline entities by IDs.

func (*UserUpdateOne) RemoveVotedDeadlines

func (uuo *UserUpdateOne) RemoveVotedDeadlines(d ...*Deadline) *UserUpdateOne

RemoveVotedDeadlines removes "voted_deadlines" edges to Deadline 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) SetFirstName

func (uuo *UserUpdateOne) SetFirstName(s string) *UserUpdateOne

SetFirstName sets the "first_name" field.

func (*UserUpdateOne) SetGodMode

func (uuo *UserUpdateOne) SetGodMode(b bool) *UserUpdateOne

SetGodMode sets the "god_mode" field.

func (*UserUpdateOne) SetInstitution

func (uuo *UserUpdateOne) SetInstitution(i *Institution) *UserUpdateOne

SetInstitution sets the "institution" edge to the Institution entity.

func (*UserUpdateOne) SetInstitutionID

func (uuo *UserUpdateOne) SetInstitutionID(id int) *UserUpdateOne

SetInstitutionID sets the "institution" edge to the Institution entity by ID.

func (*UserUpdateOne) SetLastName

func (uuo *UserUpdateOne) SetLastName(s string) *UserUpdateOne

SetLastName sets the "last_name" field.

func (*UserUpdateOne) SetNillablePoints

func (uuo *UserUpdateOne) SetNillablePoints(i *int) *UserUpdateOne

SetNillablePoints sets the "points" field if the given value is not nil.

func (*UserUpdateOne) SetNillablePointsAwardedCount

func (uuo *UserUpdateOne) SetNillablePointsAwardedCount(i *int) *UserUpdateOne

SetNillablePointsAwardedCount sets the "points_awarded_count" field if the given value is not nil.

func (*UserUpdateOne) SetNillablePointsAwardedResetTime

func (uuo *UserUpdateOne) SetNillablePointsAwardedResetTime(t *time.Time) *UserUpdateOne

SetNillablePointsAwardedResetTime sets the "points_awarded_reset_time" field if the given value is not nil.

func (*UserUpdateOne) SetPassword

func (uuo *UserUpdateOne) SetPassword(h hash.Encoded) *UserUpdateOne

SetPassword sets the "password" field.

func (*UserUpdateOne) SetPoints

func (uuo *UserUpdateOne) SetPoints(i int) *UserUpdateOne

SetPoints sets the "points" field.

func (*UserUpdateOne) SetPointsAwardedCount

func (uuo *UserUpdateOne) SetPointsAwardedCount(i int) *UserUpdateOne

SetPointsAwardedCount sets the "points_awarded_count" field.

func (*UserUpdateOne) SetPointsAwardedResetTime

func (uuo *UserUpdateOne) SetPointsAwardedResetTime(t time.Time) *UserUpdateOne

SetPointsAwardedResetTime sets the "points_awarded_reset_time" field.

func (*UserUpdateOne) SetRole

func (uuo *UserUpdateOne) SetRole(i institution.Role) *UserUpdateOne

SetRole sets the "role" 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) AddPoints

func (u *UserUpsert) AddPoints(v int) *UserUpsert

AddPoints adds v to the "points" field.

func (*UserUpsert) AddPointsAwardedCount

func (u *UserUpsert) AddPointsAwardedCount(v int) *UserUpsert

AddPointsAwardedCount adds v to the "points_awarded_count" field.

func (*UserUpsert) ClearPointsAwardedResetTime

func (u *UserUpsert) ClearPointsAwardedResetTime() *UserUpsert

ClearPointsAwardedResetTime clears the value of the "points_awarded_reset_time" field.

func (*UserUpsert) SetEmail

func (u *UserUpsert) SetEmail(v string) *UserUpsert

SetEmail sets the "email" field.

func (*UserUpsert) SetFirstName

func (u *UserUpsert) SetFirstName(v string) *UserUpsert

SetFirstName sets the "first_name" field.

func (*UserUpsert) SetGodMode

func (u *UserUpsert) SetGodMode(v bool) *UserUpsert

SetGodMode sets the "god_mode" field.

func (*UserUpsert) SetLastName

func (u *UserUpsert) SetLastName(v string) *UserUpsert

SetLastName sets the "last_name" field.

func (*UserUpsert) SetPassword

func (u *UserUpsert) SetPassword(v hash.Encoded) *UserUpsert

SetPassword sets the "password" field.

func (*UserUpsert) SetPoints

func (u *UserUpsert) SetPoints(v int) *UserUpsert

SetPoints sets the "points" field.

func (*UserUpsert) SetPointsAwardedCount

func (u *UserUpsert) SetPointsAwardedCount(v int) *UserUpsert

SetPointsAwardedCount sets the "points_awarded_count" field.

func (*UserUpsert) SetPointsAwardedResetTime

func (u *UserUpsert) SetPointsAwardedResetTime(v time.Time) *UserUpsert

SetPointsAwardedResetTime sets the "points_awarded_reset_time" field.

func (*UserUpsert) SetRole

func (u *UserUpsert) SetRole(v institution.Role) *UserUpsert

SetRole sets the "role" field.

func (*UserUpsert) UpdateEmail

func (u *UserUpsert) UpdateEmail() *UserUpsert

UpdateEmail sets the "email" field to the value that was provided on create.

func (*UserUpsert) UpdateFirstName

func (u *UserUpsert) UpdateFirstName() *UserUpsert

UpdateFirstName sets the "first_name" field to the value that was provided on create.

func (*UserUpsert) UpdateGodMode

func (u *UserUpsert) UpdateGodMode() *UserUpsert

UpdateGodMode sets the "god_mode" field to the value that was provided on create.

func (*UserUpsert) UpdateLastName

func (u *UserUpsert) UpdateLastName() *UserUpsert

UpdateLastName sets the "last_name" field to the value that was provided on create.

func (*UserUpsert) UpdatePassword

func (u *UserUpsert) UpdatePassword() *UserUpsert

UpdatePassword sets the "password" field to the value that was provided on create.

func (*UserUpsert) UpdatePoints

func (u *UserUpsert) UpdatePoints() *UserUpsert

UpdatePoints sets the "points" field to the value that was provided on create.

func (*UserUpsert) UpdatePointsAwardedCount

func (u *UserUpsert) UpdatePointsAwardedCount() *UserUpsert

UpdatePointsAwardedCount sets the "points_awarded_count" field to the value that was provided on create.

func (*UserUpsert) UpdatePointsAwardedResetTime

func (u *UserUpsert) UpdatePointsAwardedResetTime() *UserUpsert

UpdatePointsAwardedResetTime sets the "points_awarded_reset_time" field to the value that was provided on create.

func (*UserUpsert) UpdateRole

func (u *UserUpsert) UpdateRole() *UserUpsert

UpdateRole sets the "role" 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) AddPoints

func (u *UserUpsertBulk) AddPoints(v int) *UserUpsertBulk

AddPoints adds v to the "points" field.

func (*UserUpsertBulk) AddPointsAwardedCount

func (u *UserUpsertBulk) AddPointsAwardedCount(v int) *UserUpsertBulk

AddPointsAwardedCount adds v to the "points_awarded_count" field.

func (*UserUpsertBulk) ClearPointsAwardedResetTime

func (u *UserUpsertBulk) ClearPointsAwardedResetTime() *UserUpsertBulk

ClearPointsAwardedResetTime clears the value of the "points_awarded_reset_time" field.

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) SetFirstName

func (u *UserUpsertBulk) SetFirstName(v string) *UserUpsertBulk

SetFirstName sets the "first_name" field.

func (*UserUpsertBulk) SetGodMode

func (u *UserUpsertBulk) SetGodMode(v bool) *UserUpsertBulk

SetGodMode sets the "god_mode" field.

func (*UserUpsertBulk) SetLastName

func (u *UserUpsertBulk) SetLastName(v string) *UserUpsertBulk

SetLastName sets the "last_name" field.

func (*UserUpsertBulk) SetPassword

func (u *UserUpsertBulk) SetPassword(v hash.Encoded) *UserUpsertBulk

SetPassword sets the "password" field.

func (*UserUpsertBulk) SetPoints

func (u *UserUpsertBulk) SetPoints(v int) *UserUpsertBulk

SetPoints sets the "points" field.

func (*UserUpsertBulk) SetPointsAwardedCount

func (u *UserUpsertBulk) SetPointsAwardedCount(v int) *UserUpsertBulk

SetPointsAwardedCount sets the "points_awarded_count" field.

func (*UserUpsertBulk) SetPointsAwardedResetTime

func (u *UserUpsertBulk) SetPointsAwardedResetTime(v time.Time) *UserUpsertBulk

SetPointsAwardedResetTime sets the "points_awarded_reset_time" field.

func (*UserUpsertBulk) SetRole

SetRole sets the "role" 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) UpdateFirstName

func (u *UserUpsertBulk) UpdateFirstName() *UserUpsertBulk

UpdateFirstName sets the "first_name" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateGodMode

func (u *UserUpsertBulk) UpdateGodMode() *UserUpsertBulk

UpdateGodMode sets the "god_mode" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateLastName

func (u *UserUpsertBulk) UpdateLastName() *UserUpsertBulk

UpdateLastName sets the "last_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(),
	).
	Exec(ctx)

func (*UserUpsertBulk) UpdatePassword

func (u *UserUpsertBulk) UpdatePassword() *UserUpsertBulk

UpdatePassword sets the "password" field to the value that was provided on create.

func (*UserUpsertBulk) UpdatePoints

func (u *UserUpsertBulk) UpdatePoints() *UserUpsertBulk

UpdatePoints sets the "points" field to the value that was provided on create.

func (*UserUpsertBulk) UpdatePointsAwardedCount

func (u *UserUpsertBulk) UpdatePointsAwardedCount() *UserUpsertBulk

UpdatePointsAwardedCount sets the "points_awarded_count" field to the value that was provided on create.

func (*UserUpsertBulk) UpdatePointsAwardedResetTime

func (u *UserUpsertBulk) UpdatePointsAwardedResetTime() *UserUpsertBulk

UpdatePointsAwardedResetTime sets the "points_awarded_reset_time" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateRole

func (u *UserUpsertBulk) UpdateRole() *UserUpsertBulk

UpdateRole sets the "role" 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) AddPoints

func (u *UserUpsertOne) AddPoints(v int) *UserUpsertOne

AddPoints adds v to the "points" field.

func (*UserUpsertOne) AddPointsAwardedCount

func (u *UserUpsertOne) AddPointsAwardedCount(v int) *UserUpsertOne

AddPointsAwardedCount adds v to the "points_awarded_count" field.

func (*UserUpsertOne) ClearPointsAwardedResetTime

func (u *UserUpsertOne) ClearPointsAwardedResetTime() *UserUpsertOne

ClearPointsAwardedResetTime clears the value of the "points_awarded_reset_time" field.

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 int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*UserUpsertOne) IDX

func (u *UserUpsertOne) IDX(ctx context.Context) int

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) SetFirstName

func (u *UserUpsertOne) SetFirstName(v string) *UserUpsertOne

SetFirstName sets the "first_name" field.

func (*UserUpsertOne) SetGodMode

func (u *UserUpsertOne) SetGodMode(v bool) *UserUpsertOne

SetGodMode sets the "god_mode" field.

func (*UserUpsertOne) SetLastName

func (u *UserUpsertOne) SetLastName(v string) *UserUpsertOne

SetLastName sets the "last_name" field.

func (*UserUpsertOne) SetPassword

func (u *UserUpsertOne) SetPassword(v hash.Encoded) *UserUpsertOne

SetPassword sets the "password" field.

func (*UserUpsertOne) SetPoints

func (u *UserUpsertOne) SetPoints(v int) *UserUpsertOne

SetPoints sets the "points" field.

func (*UserUpsertOne) SetPointsAwardedCount

func (u *UserUpsertOne) SetPointsAwardedCount(v int) *UserUpsertOne

SetPointsAwardedCount sets the "points_awarded_count" field.

func (*UserUpsertOne) SetPointsAwardedResetTime

func (u *UserUpsertOne) SetPointsAwardedResetTime(v time.Time) *UserUpsertOne

SetPointsAwardedResetTime sets the "points_awarded_reset_time" field.

func (*UserUpsertOne) SetRole

SetRole sets the "role" 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) UpdateFirstName

func (u *UserUpsertOne) UpdateFirstName() *UserUpsertOne

UpdateFirstName sets the "first_name" field to the value that was provided on create.

func (*UserUpsertOne) UpdateGodMode

func (u *UserUpsertOne) UpdateGodMode() *UserUpsertOne

UpdateGodMode sets the "god_mode" field to the value that was provided on create.

func (*UserUpsertOne) UpdateLastName

func (u *UserUpsertOne) UpdateLastName() *UserUpsertOne

UpdateLastName sets the "last_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. Using this option is equivalent to using:

client.User.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*UserUpsertOne) UpdatePassword

func (u *UserUpsertOne) UpdatePassword() *UserUpsertOne

UpdatePassword sets the "password" field to the value that was provided on create.

func (*UserUpsertOne) UpdatePoints

func (u *UserUpsertOne) UpdatePoints() *UserUpsertOne

UpdatePoints sets the "points" field to the value that was provided on create.

func (*UserUpsertOne) UpdatePointsAwardedCount

func (u *UserUpsertOne) UpdatePointsAwardedCount() *UserUpsertOne

UpdatePointsAwardedCount sets the "points_awarded_count" field to the value that was provided on create.

func (*UserUpsertOne) UpdatePointsAwardedResetTime

func (u *UserUpsertOne) UpdatePointsAwardedResetTime() *UserUpsertOne

UpdatePointsAwardedResetTime sets the "points_awarded_reset_time" field to the value that was provided on create.

func (*UserUpsertOne) UpdateRole

func (u *UserUpsertOne) UpdateRole() *UserUpsertOne

UpdateRole sets the "role" 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.

type Voucher

type Voucher struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name of the prize
	Name string `json:"name,omitempty"`
	// Description of the prize
	Description string `json:"description,omitempty"`
	// Points required to redeem the prize
	PointsRequired int `json:"points_required,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the VoucherQuery when eager-loading is set.
	Edges VoucherEdges `json:"edges"`
	// contains filtered or unexported fields
}

Voucher is the model entity for the Voucher schema.

func (*Voucher) QueryInstitution

func (v *Voucher) QueryInstitution() *InstitutionQuery

QueryInstitution queries the "institution" edge of the Voucher entity.

func (*Voucher) QueryRedemptions

func (v *Voucher) QueryRedemptions() *RedemptionQuery

QueryRedemptions queries the "redemptions" edge of the Voucher entity.

func (*Voucher) String

func (v *Voucher) String() string

String implements the fmt.Stringer.

func (*Voucher) Unwrap

func (v *Voucher) Unwrap() *Voucher

Unwrap unwraps the Voucher 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 (*Voucher) Update

func (v *Voucher) Update() *VoucherUpdateOne

Update returns a builder for updating this Voucher. Note that you need to call Voucher.Unwrap() before calling this method if this Voucher was returned from a transaction, and the transaction was committed or rolled back.

func (*Voucher) Value

func (v *Voucher) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Voucher. This includes values selected through modifiers, order, etc.

type VoucherClient

type VoucherClient struct {
	// contains filtered or unexported fields
}

VoucherClient is a client for the Voucher schema.

func NewVoucherClient

func NewVoucherClient(c config) *VoucherClient

NewVoucherClient returns a client for the Voucher from the given config.

func (*VoucherClient) Create

func (c *VoucherClient) Create() *VoucherCreate

Create returns a builder for creating a Voucher entity.

func (*VoucherClient) CreateBulk

func (c *VoucherClient) CreateBulk(builders ...*VoucherCreate) *VoucherCreateBulk

CreateBulk returns a builder for creating a bulk of Voucher entities.

func (*VoucherClient) Delete

func (c *VoucherClient) Delete() *VoucherDelete

Delete returns a delete builder for Voucher.

func (*VoucherClient) DeleteOne

func (c *VoucherClient) DeleteOne(v *Voucher) *VoucherDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*VoucherClient) DeleteOneID

func (c *VoucherClient) DeleteOneID(id int) *VoucherDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*VoucherClient) Get

func (c *VoucherClient) Get(ctx context.Context, id int) (*Voucher, error)

Get returns a Voucher entity by its id.

func (*VoucherClient) GetX

func (c *VoucherClient) GetX(ctx context.Context, id int) *Voucher

GetX is like Get, but panics if an error occurs.

func (*VoucherClient) Hooks

func (c *VoucherClient) Hooks() []Hook

Hooks returns the client hooks.

func (*VoucherClient) Intercept

func (c *VoucherClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `voucher.Intercept(f(g(h())))`.

func (*VoucherClient) Interceptors

func (c *VoucherClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*VoucherClient) Query

func (c *VoucherClient) Query() *VoucherQuery

Query returns a query builder for Voucher.

func (*VoucherClient) QueryInstitution

func (c *VoucherClient) QueryInstitution(v *Voucher) *InstitutionQuery

QueryInstitution queries the institution edge of a Voucher.

func (*VoucherClient) QueryRedemptions

func (c *VoucherClient) QueryRedemptions(v *Voucher) *RedemptionQuery

QueryRedemptions queries the redemptions edge of a Voucher.

func (*VoucherClient) Update

func (c *VoucherClient) Update() *VoucherUpdate

Update returns an update builder for Voucher.

func (*VoucherClient) UpdateOne

func (c *VoucherClient) UpdateOne(v *Voucher) *VoucherUpdateOne

UpdateOne returns an update builder for the given entity.

func (*VoucherClient) UpdateOneID

func (c *VoucherClient) UpdateOneID(id int) *VoucherUpdateOne

UpdateOneID returns an update builder for the given id.

func (*VoucherClient) Use

func (c *VoucherClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `voucher.Hooks(f(g(h())))`.

type VoucherCreate

type VoucherCreate struct {
	// contains filtered or unexported fields
}

VoucherCreate is the builder for creating a Voucher entity.

func (*VoucherCreate) AddRedemptionIDs

func (vc *VoucherCreate) AddRedemptionIDs(ids ...int) *VoucherCreate

AddRedemptionIDs adds the "redemptions" edge to the Redemption entity by IDs.

func (*VoucherCreate) AddRedemptions

func (vc *VoucherCreate) AddRedemptions(r ...*Redemption) *VoucherCreate

AddRedemptions adds the "redemptions" edges to the Redemption entity.

func (*VoucherCreate) Exec

func (vc *VoucherCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*VoucherCreate) ExecX

func (vc *VoucherCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*VoucherCreate) Mutation

func (vc *VoucherCreate) Mutation() *VoucherMutation

Mutation returns the VoucherMutation object of the builder.

func (*VoucherCreate) OnConflict

func (vc *VoucherCreate) OnConflict(opts ...sql.ConflictOption) *VoucherUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Voucher.Create().
	SetName(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.VoucherUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*VoucherCreate) OnConflictColumns

func (vc *VoucherCreate) OnConflictColumns(columns ...string) *VoucherUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Voucher.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*VoucherCreate) Save

func (vc *VoucherCreate) Save(ctx context.Context) (*Voucher, error)

Save creates the Voucher in the database.

func (*VoucherCreate) SaveX

func (vc *VoucherCreate) SaveX(ctx context.Context) *Voucher

SaveX calls Save and panics if Save returns an error.

func (*VoucherCreate) SetDescription

func (vc *VoucherCreate) SetDescription(s string) *VoucherCreate

SetDescription sets the "description" field.

func (*VoucherCreate) SetInstitution

func (vc *VoucherCreate) SetInstitution(i *Institution) *VoucherCreate

SetInstitution sets the "institution" edge to the Institution entity.

func (*VoucherCreate) SetInstitutionID

func (vc *VoucherCreate) SetInstitutionID(id int) *VoucherCreate

SetInstitutionID sets the "institution" edge to the Institution entity by ID.

func (*VoucherCreate) SetName

func (vc *VoucherCreate) SetName(s string) *VoucherCreate

SetName sets the "name" field.

func (*VoucherCreate) SetPointsRequired

func (vc *VoucherCreate) SetPointsRequired(i int) *VoucherCreate

SetPointsRequired sets the "points_required" field.

type VoucherCreateBulk

type VoucherCreateBulk struct {
	// contains filtered or unexported fields
}

VoucherCreateBulk is the builder for creating many Voucher entities in bulk.

func (*VoucherCreateBulk) Exec

func (vcb *VoucherCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*VoucherCreateBulk) ExecX

func (vcb *VoucherCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*VoucherCreateBulk) OnConflict

func (vcb *VoucherCreateBulk) OnConflict(opts ...sql.ConflictOption) *VoucherUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Voucher.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.VoucherUpsert) {
		SetName(v+v).
	}).
	Exec(ctx)

func (*VoucherCreateBulk) OnConflictColumns

func (vcb *VoucherCreateBulk) OnConflictColumns(columns ...string) *VoucherUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Voucher.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*VoucherCreateBulk) Save

func (vcb *VoucherCreateBulk) Save(ctx context.Context) ([]*Voucher, error)

Save creates the Voucher entities in the database.

func (*VoucherCreateBulk) SaveX

func (vcb *VoucherCreateBulk) SaveX(ctx context.Context) []*Voucher

SaveX is like Save, but panics if an error occurs.

type VoucherDelete

type VoucherDelete struct {
	// contains filtered or unexported fields
}

VoucherDelete is the builder for deleting a Voucher entity.

func (*VoucherDelete) Exec

func (vd *VoucherDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*VoucherDelete) ExecX

func (vd *VoucherDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*VoucherDelete) Where

func (vd *VoucherDelete) Where(ps ...predicate.Voucher) *VoucherDelete

Where appends a list predicates to the VoucherDelete builder.

type VoucherDeleteOne

type VoucherDeleteOne struct {
	// contains filtered or unexported fields
}

VoucherDeleteOne is the builder for deleting a single Voucher entity.

func (*VoucherDeleteOne) Exec

func (vdo *VoucherDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*VoucherDeleteOne) ExecX

func (vdo *VoucherDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*VoucherDeleteOne) Where

Where appends a list predicates to the VoucherDelete builder.

type VoucherEdges

type VoucherEdges struct {
	// Redemptions that involve this prize
	Redemptions []*Redemption `json:"redemptions,omitempty"`
	// Institution that owns this voucher
	Institution *Institution `json:"institution,omitempty"`
	// contains filtered or unexported fields
}

VoucherEdges holds the relations/edges for other nodes in the graph.

func (VoucherEdges) InstitutionOrErr

func (e VoucherEdges) InstitutionOrErr() (*Institution, error)

InstitutionOrErr returns the Institution value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (VoucherEdges) RedemptionsOrErr

func (e VoucherEdges) RedemptionsOrErr() ([]*Redemption, error)

RedemptionsOrErr returns the Redemptions value or an error if the edge was not loaded in eager-loading.

type VoucherGroupBy

type VoucherGroupBy struct {
	// contains filtered or unexported fields
}

VoucherGroupBy is the group-by builder for Voucher entities.

func (*VoucherGroupBy) Aggregate

func (vgb *VoucherGroupBy) Aggregate(fns ...AggregateFunc) *VoucherGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*VoucherGroupBy) Bool

func (s *VoucherGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*VoucherGroupBy) BoolX

func (s *VoucherGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*VoucherGroupBy) Bools

func (s *VoucherGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*VoucherGroupBy) BoolsX

func (s *VoucherGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*VoucherGroupBy) Float64

func (s *VoucherGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*VoucherGroupBy) Float64X

func (s *VoucherGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*VoucherGroupBy) Float64s

func (s *VoucherGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*VoucherGroupBy) Float64sX

func (s *VoucherGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*VoucherGroupBy) Int

func (s *VoucherGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*VoucherGroupBy) IntX

func (s *VoucherGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*VoucherGroupBy) Ints

func (s *VoucherGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*VoucherGroupBy) IntsX

func (s *VoucherGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*VoucherGroupBy) Scan

func (vgb *VoucherGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*VoucherGroupBy) ScanX

func (s *VoucherGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*VoucherGroupBy) String

func (s *VoucherGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*VoucherGroupBy) StringX

func (s *VoucherGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*VoucherGroupBy) Strings

func (s *VoucherGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*VoucherGroupBy) StringsX

func (s *VoucherGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type VoucherMutation

type VoucherMutation struct {
	// contains filtered or unexported fields
}

VoucherMutation represents an operation that mutates the Voucher nodes in the graph.

func (*VoucherMutation) AddField

func (m *VoucherMutation) 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 (*VoucherMutation) AddPointsRequired

func (m *VoucherMutation) AddPointsRequired(i int)

AddPointsRequired adds i to the "points_required" field.

func (*VoucherMutation) AddRedemptionIDs

func (m *VoucherMutation) AddRedemptionIDs(ids ...int)

AddRedemptionIDs adds the "redemptions" edge to the Redemption entity by ids.

func (*VoucherMutation) AddedEdges

func (m *VoucherMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*VoucherMutation) AddedField

func (m *VoucherMutation) 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 (*VoucherMutation) AddedFields

func (m *VoucherMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*VoucherMutation) AddedIDs

func (m *VoucherMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*VoucherMutation) AddedPointsRequired

func (m *VoucherMutation) AddedPointsRequired() (r int, exists bool)

AddedPointsRequired returns the value that was added to the "points_required" field in this mutation.

func (*VoucherMutation) ClearEdge

func (m *VoucherMutation) 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 (*VoucherMutation) ClearField

func (m *VoucherMutation) 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 (*VoucherMutation) ClearInstitution

func (m *VoucherMutation) ClearInstitution()

ClearInstitution clears the "institution" edge to the Institution entity.

func (*VoucherMutation) ClearRedemptions

func (m *VoucherMutation) ClearRedemptions()

ClearRedemptions clears the "redemptions" edge to the Redemption entity.

func (*VoucherMutation) ClearedEdges

func (m *VoucherMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*VoucherMutation) ClearedFields

func (m *VoucherMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (VoucherMutation) Client

func (m VoucherMutation) 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 (*VoucherMutation) Description

func (m *VoucherMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*VoucherMutation) EdgeCleared

func (m *VoucherMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*VoucherMutation) Field

func (m *VoucherMutation) 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 (*VoucherMutation) FieldCleared

func (m *VoucherMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*VoucherMutation) Fields

func (m *VoucherMutation) 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 (*VoucherMutation) ID

func (m *VoucherMutation) ID() (id int, 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 (*VoucherMutation) IDs

func (m *VoucherMutation) IDs(ctx context.Context) ([]int, 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 (*VoucherMutation) InstitutionCleared

func (m *VoucherMutation) InstitutionCleared() bool

InstitutionCleared reports if the "institution" edge to the Institution entity was cleared.

func (*VoucherMutation) InstitutionID

func (m *VoucherMutation) InstitutionID() (id int, exists bool)

InstitutionID returns the "institution" edge ID in the mutation.

func (*VoucherMutation) InstitutionIDs

func (m *VoucherMutation) InstitutionIDs() (ids []int)

InstitutionIDs returns the "institution" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use InstitutionID instead. It exists only for internal usage by the builders.

func (*VoucherMutation) Name

func (m *VoucherMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*VoucherMutation) OldDescription

func (m *VoucherMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Voucher entity. If the Voucher 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 (*VoucherMutation) OldField

func (m *VoucherMutation) 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 (*VoucherMutation) OldName

func (m *VoucherMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Voucher entity. If the Voucher 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 (*VoucherMutation) OldPointsRequired

func (m *VoucherMutation) OldPointsRequired(ctx context.Context) (v int, err error)

OldPointsRequired returns the old "points_required" field's value of the Voucher entity. If the Voucher 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 (*VoucherMutation) Op

func (m *VoucherMutation) Op() Op

Op returns the operation name.

func (*VoucherMutation) PointsRequired

func (m *VoucherMutation) PointsRequired() (r int, exists bool)

PointsRequired returns the value of the "points_required" field in the mutation.

func (*VoucherMutation) RedemptionsCleared

func (m *VoucherMutation) RedemptionsCleared() bool

RedemptionsCleared reports if the "redemptions" edge to the Redemption entity was cleared.

func (*VoucherMutation) RedemptionsIDs

func (m *VoucherMutation) RedemptionsIDs() (ids []int)

RedemptionsIDs returns the "redemptions" edge IDs in the mutation.

func (*VoucherMutation) RemoveRedemptionIDs

func (m *VoucherMutation) RemoveRedemptionIDs(ids ...int)

RemoveRedemptionIDs removes the "redemptions" edge to the Redemption entity by IDs.

func (*VoucherMutation) RemovedEdges

func (m *VoucherMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*VoucherMutation) RemovedIDs

func (m *VoucherMutation) 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 (*VoucherMutation) RemovedRedemptionsIDs

func (m *VoucherMutation) RemovedRedemptionsIDs() (ids []int)

RemovedRedemptions returns the removed IDs of the "redemptions" edge to the Redemption entity.

func (*VoucherMutation) ResetDescription

func (m *VoucherMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*VoucherMutation) ResetEdge

func (m *VoucherMutation) 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 (*VoucherMutation) ResetField

func (m *VoucherMutation) 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 (*VoucherMutation) ResetInstitution

func (m *VoucherMutation) ResetInstitution()

ResetInstitution resets all changes to the "institution" edge.

func (*VoucherMutation) ResetName

func (m *VoucherMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*VoucherMutation) ResetPointsRequired

func (m *VoucherMutation) ResetPointsRequired()

ResetPointsRequired resets all changes to the "points_required" field.

func (*VoucherMutation) ResetRedemptions

func (m *VoucherMutation) ResetRedemptions()

ResetRedemptions resets all changes to the "redemptions" edge.

func (*VoucherMutation) SetDescription

func (m *VoucherMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*VoucherMutation) SetField

func (m *VoucherMutation) 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 (*VoucherMutation) SetInstitutionID

func (m *VoucherMutation) SetInstitutionID(id int)

SetInstitutionID sets the "institution" edge to the Institution entity by id.

func (*VoucherMutation) SetName

func (m *VoucherMutation) SetName(s string)

SetName sets the "name" field.

func (*VoucherMutation) SetOp

func (m *VoucherMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*VoucherMutation) SetPointsRequired

func (m *VoucherMutation) SetPointsRequired(i int)

SetPointsRequired sets the "points_required" field.

func (VoucherMutation) Tx

func (m VoucherMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*VoucherMutation) Type

func (m *VoucherMutation) Type() string

Type returns the node type of this mutation (Voucher).

func (*VoucherMutation) Where

func (m *VoucherMutation) Where(ps ...predicate.Voucher)

Where appends a list predicates to the VoucherMutation builder.

func (*VoucherMutation) WhereP

func (m *VoucherMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the VoucherMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type VoucherQuery

type VoucherQuery struct {
	// contains filtered or unexported fields
}

VoucherQuery is the builder for querying Voucher entities.

func (*VoucherQuery) Aggregate

func (vq *VoucherQuery) Aggregate(fns ...AggregateFunc) *VoucherSelect

Aggregate returns a VoucherSelect configured with the given aggregations.

func (*VoucherQuery) All

func (vq *VoucherQuery) All(ctx context.Context) ([]*Voucher, error)

All executes the query and returns a list of Vouchers.

func (*VoucherQuery) AllX

func (vq *VoucherQuery) AllX(ctx context.Context) []*Voucher

AllX is like All, but panics if an error occurs.

func (*VoucherQuery) Clone

func (vq *VoucherQuery) Clone() *VoucherQuery

Clone returns a duplicate of the VoucherQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*VoucherQuery) Count

func (vq *VoucherQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*VoucherQuery) CountX

func (vq *VoucherQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*VoucherQuery) Exist

func (vq *VoucherQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*VoucherQuery) ExistX

func (vq *VoucherQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*VoucherQuery) First

func (vq *VoucherQuery) First(ctx context.Context) (*Voucher, error)

First returns the first Voucher entity from the query. Returns a *NotFoundError when no Voucher was found.

func (*VoucherQuery) FirstID

func (vq *VoucherQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Voucher ID from the query. Returns a *NotFoundError when no Voucher ID was found.

func (*VoucherQuery) FirstIDX

func (vq *VoucherQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*VoucherQuery) FirstX

func (vq *VoucherQuery) FirstX(ctx context.Context) *Voucher

FirstX is like First, but panics if an error occurs.

func (*VoucherQuery) GroupBy

func (vq *VoucherQuery) GroupBy(field string, fields ...string) *VoucherGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Voucher.Query().
	GroupBy(voucher.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*VoucherQuery) IDs

func (vq *VoucherQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Voucher IDs.

func (*VoucherQuery) IDsX

func (vq *VoucherQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*VoucherQuery) Limit

func (vq *VoucherQuery) Limit(limit int) *VoucherQuery

Limit the number of records to be returned by this query.

func (*VoucherQuery) Offset

func (vq *VoucherQuery) Offset(offset int) *VoucherQuery

Offset to start from.

func (*VoucherQuery) Only

func (vq *VoucherQuery) Only(ctx context.Context) (*Voucher, error)

Only returns a single Voucher entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Voucher entity is found. Returns a *NotFoundError when no Voucher entities are found.

func (*VoucherQuery) OnlyID

func (vq *VoucherQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Voucher ID in the query. Returns a *NotSingularError when more than one Voucher ID is found. Returns a *NotFoundError when no entities are found.

func (*VoucherQuery) OnlyIDX

func (vq *VoucherQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*VoucherQuery) OnlyX

func (vq *VoucherQuery) OnlyX(ctx context.Context) *Voucher

OnlyX is like Only, but panics if an error occurs.

func (*VoucherQuery) Order

func (vq *VoucherQuery) Order(o ...voucher.OrderOption) *VoucherQuery

Order specifies how the records should be ordered.

func (*VoucherQuery) QueryInstitution

func (vq *VoucherQuery) QueryInstitution() *InstitutionQuery

QueryInstitution chains the current query on the "institution" edge.

func (*VoucherQuery) QueryRedemptions

func (vq *VoucherQuery) QueryRedemptions() *RedemptionQuery

QueryRedemptions chains the current query on the "redemptions" edge.

func (*VoucherQuery) Select

func (vq *VoucherQuery) Select(fields ...string) *VoucherSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.Voucher.Query().
	Select(voucher.FieldName).
	Scan(ctx, &v)

func (*VoucherQuery) Unique

func (vq *VoucherQuery) Unique(unique bool) *VoucherQuery

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 (*VoucherQuery) Where

func (vq *VoucherQuery) Where(ps ...predicate.Voucher) *VoucherQuery

Where adds a new predicate for the VoucherQuery builder.

func (*VoucherQuery) WithInstitution

func (vq *VoucherQuery) WithInstitution(opts ...func(*InstitutionQuery)) *VoucherQuery

WithInstitution tells the query-builder to eager-load the nodes that are connected to the "institution" edge. The optional arguments are used to configure the query builder of the edge.

func (*VoucherQuery) WithRedemptions

func (vq *VoucherQuery) WithRedemptions(opts ...func(*RedemptionQuery)) *VoucherQuery

WithRedemptions tells the query-builder to eager-load the nodes that are connected to the "redemptions" edge. The optional arguments are used to configure the query builder of the edge.

type VoucherSelect

type VoucherSelect struct {
	*VoucherQuery
	// contains filtered or unexported fields
}

VoucherSelect is the builder for selecting fields of Voucher entities.

func (*VoucherSelect) Aggregate

func (vs *VoucherSelect) Aggregate(fns ...AggregateFunc) *VoucherSelect

Aggregate adds the given aggregation functions to the selector query.

func (*VoucherSelect) Bool

func (s *VoucherSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*VoucherSelect) BoolX

func (s *VoucherSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*VoucherSelect) Bools

func (s *VoucherSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*VoucherSelect) BoolsX

func (s *VoucherSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*VoucherSelect) Float64

func (s *VoucherSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*VoucherSelect) Float64X

func (s *VoucherSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*VoucherSelect) Float64s

func (s *VoucherSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*VoucherSelect) Float64sX

func (s *VoucherSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*VoucherSelect) Int

func (s *VoucherSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*VoucherSelect) IntX

func (s *VoucherSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*VoucherSelect) Ints

func (s *VoucherSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*VoucherSelect) IntsX

func (s *VoucherSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*VoucherSelect) Scan

func (vs *VoucherSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*VoucherSelect) ScanX

func (s *VoucherSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*VoucherSelect) String

func (s *VoucherSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*VoucherSelect) StringX

func (s *VoucherSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*VoucherSelect) Strings

func (s *VoucherSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*VoucherSelect) StringsX

func (s *VoucherSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type VoucherUpdate

type VoucherUpdate struct {
	// contains filtered or unexported fields
}

VoucherUpdate is the builder for updating Voucher entities.

func (*VoucherUpdate) AddPointsRequired

func (vu *VoucherUpdate) AddPointsRequired(i int) *VoucherUpdate

AddPointsRequired adds i to the "points_required" field.

func (*VoucherUpdate) AddRedemptionIDs

func (vu *VoucherUpdate) AddRedemptionIDs(ids ...int) *VoucherUpdate

AddRedemptionIDs adds the "redemptions" edge to the Redemption entity by IDs.

func (*VoucherUpdate) AddRedemptions

func (vu *VoucherUpdate) AddRedemptions(r ...*Redemption) *VoucherUpdate

AddRedemptions adds the "redemptions" edges to the Redemption entity.

func (*VoucherUpdate) ClearInstitution

func (vu *VoucherUpdate) ClearInstitution() *VoucherUpdate

ClearInstitution clears the "institution" edge to the Institution entity.

func (*VoucherUpdate) ClearRedemptions

func (vu *VoucherUpdate) ClearRedemptions() *VoucherUpdate

ClearRedemptions clears all "redemptions" edges to the Redemption entity.

func (*VoucherUpdate) Exec

func (vu *VoucherUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*VoucherUpdate) ExecX

func (vu *VoucherUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*VoucherUpdate) Mutation

func (vu *VoucherUpdate) Mutation() *VoucherMutation

Mutation returns the VoucherMutation object of the builder.

func (*VoucherUpdate) RemoveRedemptionIDs

func (vu *VoucherUpdate) RemoveRedemptionIDs(ids ...int) *VoucherUpdate

RemoveRedemptionIDs removes the "redemptions" edge to Redemption entities by IDs.

func (*VoucherUpdate) RemoveRedemptions

func (vu *VoucherUpdate) RemoveRedemptions(r ...*Redemption) *VoucherUpdate

RemoveRedemptions removes "redemptions" edges to Redemption entities.

func (*VoucherUpdate) Save

func (vu *VoucherUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*VoucherUpdate) SaveX

func (vu *VoucherUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*VoucherUpdate) SetDescription

func (vu *VoucherUpdate) SetDescription(s string) *VoucherUpdate

SetDescription sets the "description" field.

func (*VoucherUpdate) SetInstitution

func (vu *VoucherUpdate) SetInstitution(i *Institution) *VoucherUpdate

SetInstitution sets the "institution" edge to the Institution entity.

func (*VoucherUpdate) SetInstitutionID

func (vu *VoucherUpdate) SetInstitutionID(id int) *VoucherUpdate

SetInstitutionID sets the "institution" edge to the Institution entity by ID.

func (*VoucherUpdate) SetName

func (vu *VoucherUpdate) SetName(s string) *VoucherUpdate

SetName sets the "name" field.

func (*VoucherUpdate) SetPointsRequired

func (vu *VoucherUpdate) SetPointsRequired(i int) *VoucherUpdate

SetPointsRequired sets the "points_required" field.

func (*VoucherUpdate) Where

func (vu *VoucherUpdate) Where(ps ...predicate.Voucher) *VoucherUpdate

Where appends a list predicates to the VoucherUpdate builder.

type VoucherUpdateOne

type VoucherUpdateOne struct {
	// contains filtered or unexported fields
}

VoucherUpdateOne is the builder for updating a single Voucher entity.

func (*VoucherUpdateOne) AddPointsRequired

func (vuo *VoucherUpdateOne) AddPointsRequired(i int) *VoucherUpdateOne

AddPointsRequired adds i to the "points_required" field.

func (*VoucherUpdateOne) AddRedemptionIDs

func (vuo *VoucherUpdateOne) AddRedemptionIDs(ids ...int) *VoucherUpdateOne

AddRedemptionIDs adds the "redemptions" edge to the Redemption entity by IDs.

func (*VoucherUpdateOne) AddRedemptions

func (vuo *VoucherUpdateOne) AddRedemptions(r ...*Redemption) *VoucherUpdateOne

AddRedemptions adds the "redemptions" edges to the Redemption entity.

func (*VoucherUpdateOne) ClearInstitution

func (vuo *VoucherUpdateOne) ClearInstitution() *VoucherUpdateOne

ClearInstitution clears the "institution" edge to the Institution entity.

func (*VoucherUpdateOne) ClearRedemptions

func (vuo *VoucherUpdateOne) ClearRedemptions() *VoucherUpdateOne

ClearRedemptions clears all "redemptions" edges to the Redemption entity.

func (*VoucherUpdateOne) Exec

func (vuo *VoucherUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*VoucherUpdateOne) ExecX

func (vuo *VoucherUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*VoucherUpdateOne) Mutation

func (vuo *VoucherUpdateOne) Mutation() *VoucherMutation

Mutation returns the VoucherMutation object of the builder.

func (*VoucherUpdateOne) RemoveRedemptionIDs

func (vuo *VoucherUpdateOne) RemoveRedemptionIDs(ids ...int) *VoucherUpdateOne

RemoveRedemptionIDs removes the "redemptions" edge to Redemption entities by IDs.

func (*VoucherUpdateOne) RemoveRedemptions

func (vuo *VoucherUpdateOne) RemoveRedemptions(r ...*Redemption) *VoucherUpdateOne

RemoveRedemptions removes "redemptions" edges to Redemption entities.

func (*VoucherUpdateOne) Save

func (vuo *VoucherUpdateOne) Save(ctx context.Context) (*Voucher, error)

Save executes the query and returns the updated Voucher entity.

func (*VoucherUpdateOne) SaveX

func (vuo *VoucherUpdateOne) SaveX(ctx context.Context) *Voucher

SaveX is like Save, but panics if an error occurs.

func (*VoucherUpdateOne) Select

func (vuo *VoucherUpdateOne) Select(field string, fields ...string) *VoucherUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*VoucherUpdateOne) SetDescription

func (vuo *VoucherUpdateOne) SetDescription(s string) *VoucherUpdateOne

SetDescription sets the "description" field.

func (*VoucherUpdateOne) SetInstitution

func (vuo *VoucherUpdateOne) SetInstitution(i *Institution) *VoucherUpdateOne

SetInstitution sets the "institution" edge to the Institution entity.

func (*VoucherUpdateOne) SetInstitutionID

func (vuo *VoucherUpdateOne) SetInstitutionID(id int) *VoucherUpdateOne

SetInstitutionID sets the "institution" edge to the Institution entity by ID.

func (*VoucherUpdateOne) SetName

func (vuo *VoucherUpdateOne) SetName(s string) *VoucherUpdateOne

SetName sets the "name" field.

func (*VoucherUpdateOne) SetPointsRequired

func (vuo *VoucherUpdateOne) SetPointsRequired(i int) *VoucherUpdateOne

SetPointsRequired sets the "points_required" field.

func (*VoucherUpdateOne) Where

Where appends a list predicates to the VoucherUpdate builder.

type VoucherUpsert

type VoucherUpsert struct {
	*sql.UpdateSet
}

VoucherUpsert is the "OnConflict" setter.

func (*VoucherUpsert) AddPointsRequired

func (u *VoucherUpsert) AddPointsRequired(v int) *VoucherUpsert

AddPointsRequired adds v to the "points_required" field.

func (*VoucherUpsert) SetDescription

func (u *VoucherUpsert) SetDescription(v string) *VoucherUpsert

SetDescription sets the "description" field.

func (*VoucherUpsert) SetName

func (u *VoucherUpsert) SetName(v string) *VoucherUpsert

SetName sets the "name" field.

func (*VoucherUpsert) SetPointsRequired

func (u *VoucherUpsert) SetPointsRequired(v int) *VoucherUpsert

SetPointsRequired sets the "points_required" field.

func (*VoucherUpsert) UpdateDescription

func (u *VoucherUpsert) UpdateDescription() *VoucherUpsert

UpdateDescription sets the "description" field to the value that was provided on create.

func (*VoucherUpsert) UpdateName

func (u *VoucherUpsert) UpdateName() *VoucherUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*VoucherUpsert) UpdatePointsRequired

func (u *VoucherUpsert) UpdatePointsRequired() *VoucherUpsert

UpdatePointsRequired sets the "points_required" field to the value that was provided on create.

type VoucherUpsertBulk

type VoucherUpsertBulk struct {
	// contains filtered or unexported fields
}

VoucherUpsertBulk is the builder for "upsert"-ing a bulk of Voucher nodes.

func (*VoucherUpsertBulk) AddPointsRequired

func (u *VoucherUpsertBulk) AddPointsRequired(v int) *VoucherUpsertBulk

AddPointsRequired adds v to the "points_required" field.

func (*VoucherUpsertBulk) DoNothing

func (u *VoucherUpsertBulk) DoNothing() *VoucherUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*VoucherUpsertBulk) Exec

func (u *VoucherUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*VoucherUpsertBulk) ExecX

func (u *VoucherUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*VoucherUpsertBulk) Ignore

func (u *VoucherUpsertBulk) Ignore() *VoucherUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Voucher.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*VoucherUpsertBulk) SetDescription

func (u *VoucherUpsertBulk) SetDescription(v string) *VoucherUpsertBulk

SetDescription sets the "description" field.

func (*VoucherUpsertBulk) SetName

SetName sets the "name" field.

func (*VoucherUpsertBulk) SetPointsRequired

func (u *VoucherUpsertBulk) SetPointsRequired(v int) *VoucherUpsertBulk

SetPointsRequired sets the "points_required" field.

func (*VoucherUpsertBulk) Update

func (u *VoucherUpsertBulk) Update(set func(*VoucherUpsert)) *VoucherUpsertBulk

Update allows overriding fields `UPDATE` values. See the VoucherCreateBulk.OnConflict documentation for more info.

func (*VoucherUpsertBulk) UpdateDescription

func (u *VoucherUpsertBulk) UpdateDescription() *VoucherUpsertBulk

UpdateDescription sets the "description" field to the value that was provided on create.

func (*VoucherUpsertBulk) UpdateName

func (u *VoucherUpsertBulk) UpdateName() *VoucherUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*VoucherUpsertBulk) UpdateNewValues

func (u *VoucherUpsertBulk) UpdateNewValues() *VoucherUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Voucher.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*VoucherUpsertBulk) UpdatePointsRequired

func (u *VoucherUpsertBulk) UpdatePointsRequired() *VoucherUpsertBulk

UpdatePointsRequired sets the "points_required" field to the value that was provided on create.

type VoucherUpsertOne

type VoucherUpsertOne struct {
	// contains filtered or unexported fields
}

VoucherUpsertOne is the builder for "upsert"-ing

one Voucher node.

func (*VoucherUpsertOne) AddPointsRequired

func (u *VoucherUpsertOne) AddPointsRequired(v int) *VoucherUpsertOne

AddPointsRequired adds v to the "points_required" field.

func (*VoucherUpsertOne) DoNothing

func (u *VoucherUpsertOne) DoNothing() *VoucherUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*VoucherUpsertOne) Exec

func (u *VoucherUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*VoucherUpsertOne) ExecX

func (u *VoucherUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*VoucherUpsertOne) ID

func (u *VoucherUpsertOne) ID(ctx context.Context) (id int, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*VoucherUpsertOne) IDX

func (u *VoucherUpsertOne) IDX(ctx context.Context) int

IDX is like ID, but panics if an error occurs.

func (*VoucherUpsertOne) Ignore

func (u *VoucherUpsertOne) Ignore() *VoucherUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Voucher.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*VoucherUpsertOne) SetDescription

func (u *VoucherUpsertOne) SetDescription(v string) *VoucherUpsertOne

SetDescription sets the "description" field.

func (*VoucherUpsertOne) SetName

func (u *VoucherUpsertOne) SetName(v string) *VoucherUpsertOne

SetName sets the "name" field.

func (*VoucherUpsertOne) SetPointsRequired

func (u *VoucherUpsertOne) SetPointsRequired(v int) *VoucherUpsertOne

SetPointsRequired sets the "points_required" field.

func (*VoucherUpsertOne) Update

func (u *VoucherUpsertOne) Update(set func(*VoucherUpsert)) *VoucherUpsertOne

Update allows overriding fields `UPDATE` values. See the VoucherCreate.OnConflict documentation for more info.

func (*VoucherUpsertOne) UpdateDescription

func (u *VoucherUpsertOne) UpdateDescription() *VoucherUpsertOne

UpdateDescription sets the "description" field to the value that was provided on create.

func (*VoucherUpsertOne) UpdateName

func (u *VoucherUpsertOne) UpdateName() *VoucherUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*VoucherUpsertOne) UpdateNewValues

func (u *VoucherUpsertOne) UpdateNewValues() *VoucherUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Voucher.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
	).
	Exec(ctx)

func (*VoucherUpsertOne) UpdatePointsRequired

func (u *VoucherUpsertOne) UpdatePointsRequired() *VoucherUpsertOne

UpdatePointsRequired sets the "points_required" field to the value that was provided on create.

type Vouchers

type Vouchers []*Voucher

Vouchers is a parsable slice of Voucher.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL