ent

package
v0.0.0-...-eef0f43 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: MIT Imports: 20 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.
	TypeAdmin   = "Admin"
	TypeMeeting = "Meeting"
	TypeUser    = "User"
)

Variables

This section is empty.

Functions

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 Admin

type Admin struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// PhoneNumber holds the value of the "phone_number" field.
	PhoneNumber string `json:"phone_number,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AdminQuery when eager-loading is set.
	Edges AdminEdges `json:"edges"`
	// contains filtered or unexported fields
}

Admin is the model entity for the Admin schema.

func (*Admin) QueryUser

func (a *Admin) QueryUser() *UserQuery

QueryUser queries the "user" edge of the Admin entity.

func (*Admin) String

func (a *Admin) String() string

String implements the fmt.Stringer.

func (*Admin) Unwrap

func (a *Admin) Unwrap() *Admin

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

func (a *Admin) Update() *AdminUpdateOne

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

type AdminClient

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

AdminClient is a client for the Admin schema.

func NewAdminClient

func NewAdminClient(c config) *AdminClient

NewAdminClient returns a client for the Admin from the given config.

func (*AdminClient) Create

func (c *AdminClient) Create() *AdminCreate

Create returns a builder for creating a Admin entity.

func (*AdminClient) CreateBulk

func (c *AdminClient) CreateBulk(builders ...*AdminCreate) *AdminCreateBulk

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

func (*AdminClient) Delete

func (c *AdminClient) Delete() *AdminDelete

Delete returns a delete builder for Admin.

func (*AdminClient) DeleteOne

func (c *AdminClient) DeleteOne(a *Admin) *AdminDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AdminClient) DeleteOneID

func (c *AdminClient) DeleteOneID(id int) *AdminDeleteOne

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

func (*AdminClient) Get

func (c *AdminClient) Get(ctx context.Context, id int) (*Admin, error)

Get returns a Admin entity by its id.

func (*AdminClient) GetX

func (c *AdminClient) GetX(ctx context.Context, id int) *Admin

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

func (*AdminClient) Hooks

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

Hooks returns the client hooks.

func (*AdminClient) Query

func (c *AdminClient) Query() *AdminQuery

Query returns a query builder for Admin.

func (*AdminClient) QueryUser

func (c *AdminClient) QueryUser(a *Admin) *UserQuery

QueryUser queries the user edge of a Admin.

func (*AdminClient) Update

func (c *AdminClient) Update() *AdminUpdate

Update returns an update builder for Admin.

func (*AdminClient) UpdateOne

func (c *AdminClient) UpdateOne(a *Admin) *AdminUpdateOne

UpdateOne returns an update builder for the given entity.

func (*AdminClient) UpdateOneID

func (c *AdminClient) UpdateOneID(id int) *AdminUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AdminClient) Use

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

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

type AdminCreate

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

AdminCreate is the builder for creating a Admin entity.

func (*AdminCreate) Exec

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

Exec executes the query.

func (*AdminCreate) ExecX

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

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

func (*AdminCreate) Mutation

func (ac *AdminCreate) Mutation() *AdminMutation

Mutation returns the AdminMutation object of the builder.

func (*AdminCreate) Save

func (ac *AdminCreate) Save(ctx context.Context) (*Admin, error)

Save creates the Admin in the database.

func (*AdminCreate) SaveX

func (ac *AdminCreate) SaveX(ctx context.Context) *Admin

SaveX calls Save and panics if Save returns an error.

func (*AdminCreate) SetCreateTime

func (ac *AdminCreate) SetCreateTime(t time.Time) *AdminCreate

SetCreateTime sets the "create_time" field.

func (*AdminCreate) SetNillableCreateTime

func (ac *AdminCreate) SetNillableCreateTime(t *time.Time) *AdminCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*AdminCreate) SetNillableUpdateTime

func (ac *AdminCreate) SetNillableUpdateTime(t *time.Time) *AdminCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*AdminCreate) SetPhoneNumber

func (ac *AdminCreate) SetPhoneNumber(s string) *AdminCreate

SetPhoneNumber sets the "phone_number" field.

func (*AdminCreate) SetUpdateTime

func (ac *AdminCreate) SetUpdateTime(t time.Time) *AdminCreate

SetUpdateTime sets the "update_time" field.

func (*AdminCreate) SetUser

func (ac *AdminCreate) SetUser(u *User) *AdminCreate

SetUser sets the "user" edge to the User entity.

func (*AdminCreate) SetUserID

func (ac *AdminCreate) SetUserID(id int) *AdminCreate

SetUserID sets the "user" edge to the User entity by ID.

type AdminCreateBulk

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

AdminCreateBulk is the builder for creating many Admin entities in bulk.

func (*AdminCreateBulk) Exec

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

Exec executes the query.

func (*AdminCreateBulk) ExecX

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

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

func (*AdminCreateBulk) Save

func (acb *AdminCreateBulk) Save(ctx context.Context) ([]*Admin, error)

Save creates the Admin entities in the database.

func (*AdminCreateBulk) SaveX

func (acb *AdminCreateBulk) SaveX(ctx context.Context) []*Admin

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

type AdminDelete

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

AdminDelete is the builder for deleting a Admin entity.

func (*AdminDelete) Exec

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

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

func (*AdminDelete) ExecX

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

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

func (*AdminDelete) Where

func (ad *AdminDelete) Where(ps ...predicate.Admin) *AdminDelete

Where appends a list predicates to the AdminDelete builder.

type AdminDeleteOne

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

AdminDeleteOne is the builder for deleting a single Admin entity.

func (*AdminDeleteOne) Exec

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

Exec executes the deletion query.

func (*AdminDeleteOne) ExecX

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

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

type AdminEdges

type AdminEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// contains filtered or unexported fields
}

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

func (AdminEdges) UserOrErr

func (e AdminEdges) 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 AdminGroupBy

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

AdminGroupBy is the group-by builder for Admin entities.

func (*AdminGroupBy) Aggregate

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

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

func (*AdminGroupBy) Bool

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

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

func (*AdminGroupBy) BoolX

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

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

func (*AdminGroupBy) Bools

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

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

func (*AdminGroupBy) BoolsX

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

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

func (*AdminGroupBy) Float64

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

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

func (*AdminGroupBy) Float64X

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

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

func (*AdminGroupBy) Float64s

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

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

func (*AdminGroupBy) Float64sX

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

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

func (*AdminGroupBy) Int

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

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

func (*AdminGroupBy) IntX

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

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

func (*AdminGroupBy) Ints

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

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

func (*AdminGroupBy) IntsX

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

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

func (*AdminGroupBy) Scan

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

Scan applies the group-by query and scans the result into the given value.

func (*AdminGroupBy) ScanX

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

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

func (*AdminGroupBy) String

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

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

func (*AdminGroupBy) StringX

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

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

func (*AdminGroupBy) Strings

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

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

func (*AdminGroupBy) StringsX

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

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

type AdminMutation

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

AdminMutation represents an operation that mutates the Admin nodes in the graph.

func (*AdminMutation) AddField

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

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

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

func (*AdminMutation) AddedField

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

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

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

func (*AdminMutation) AddedIDs

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

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

func (*AdminMutation) ClearEdge

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

func (m *AdminMutation) 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 (*AdminMutation) ClearUser

func (m *AdminMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*AdminMutation) ClearedEdges

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

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

func (*AdminMutation) ClearedFields

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

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

func (AdminMutation) Client

func (m AdminMutation) 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 (*AdminMutation) CreateTime

func (m *AdminMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*AdminMutation) EdgeCleared

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

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

func (*AdminMutation) Field

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

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

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

func (*AdminMutation) Fields

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

func (m *AdminMutation) 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 (*AdminMutation) IDs

func (m *AdminMutation) 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 (*AdminMutation) OldCreateTime

func (m *AdminMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Admin entity. If the Admin 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 (*AdminMutation) OldField

func (m *AdminMutation) 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 (*AdminMutation) OldPhoneNumber

func (m *AdminMutation) OldPhoneNumber(ctx context.Context) (v string, err error)

OldPhoneNumber returns the old "phone_number" field's value of the Admin entity. If the Admin 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 (*AdminMutation) OldUpdateTime

func (m *AdminMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Admin entity. If the Admin 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 (*AdminMutation) Op

func (m *AdminMutation) Op() Op

Op returns the operation name.

func (*AdminMutation) PhoneNumber

func (m *AdminMutation) PhoneNumber() (r string, exists bool)

PhoneNumber returns the value of the "phone_number" field in the mutation.

func (*AdminMutation) RemovedEdges

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

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

func (*AdminMutation) RemovedIDs

func (m *AdminMutation) 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 (*AdminMutation) ResetCreateTime

func (m *AdminMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*AdminMutation) ResetEdge

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

func (m *AdminMutation) 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 (*AdminMutation) ResetPhoneNumber

func (m *AdminMutation) ResetPhoneNumber()

ResetPhoneNumber resets all changes to the "phone_number" field.

func (*AdminMutation) ResetUpdateTime

func (m *AdminMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*AdminMutation) ResetUser

func (m *AdminMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*AdminMutation) SetCreateTime

func (m *AdminMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*AdminMutation) SetField

func (m *AdminMutation) 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 (*AdminMutation) SetPhoneNumber

func (m *AdminMutation) SetPhoneNumber(s string)

SetPhoneNumber sets the "phone_number" field.

func (*AdminMutation) SetUpdateTime

func (m *AdminMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*AdminMutation) SetUserID

func (m *AdminMutation) SetUserID(id int)

SetUserID sets the "user" edge to the User entity by id.

func (AdminMutation) Tx

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

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

func (*AdminMutation) Type

func (m *AdminMutation) Type() string

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

func (*AdminMutation) UpdateTime

func (m *AdminMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*AdminMutation) UserCleared

func (m *AdminMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*AdminMutation) UserID

func (m *AdminMutation) UserID() (id int, exists bool)

UserID returns the "user" edge ID in the mutation.

func (*AdminMutation) UserIDs

func (m *AdminMutation) 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 (*AdminMutation) Where

func (m *AdminMutation) Where(ps ...predicate.Admin)

Where appends a list predicates to the AdminMutation builder.

type AdminQuery

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

AdminQuery is the builder for querying Admin entities.

func (*AdminQuery) Aggregate

func (aq *AdminQuery) Aggregate(fns ...AggregateFunc) *AdminSelect

Aggregate returns a AdminSelect configured with the given aggregations.

func (*AdminQuery) All

func (aq *AdminQuery) All(ctx context.Context) ([]*Admin, error)

All executes the query and returns a list of Admins.

func (*AdminQuery) AllX

func (aq *AdminQuery) AllX(ctx context.Context) []*Admin

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

func (*AdminQuery) Clone

func (aq *AdminQuery) Clone() *AdminQuery

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

func (*AdminQuery) Count

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

Count returns the count of the given query.

func (*AdminQuery) CountX

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

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

func (*AdminQuery) Exist

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

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

func (*AdminQuery) ExistX

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

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

func (*AdminQuery) First

func (aq *AdminQuery) First(ctx context.Context) (*Admin, error)

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

func (*AdminQuery) FirstID

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

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

func (*AdminQuery) FirstIDX

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

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

func (*AdminQuery) FirstX

func (aq *AdminQuery) FirstX(ctx context.Context) *Admin

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

func (*AdminQuery) GroupBy

func (aq *AdminQuery) GroupBy(field string, fields ...string) *AdminGroupBy

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

client.Admin.Query().
	GroupBy(admin.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AdminQuery) IDs

func (aq *AdminQuery) IDs(ctx context.Context) ([]int, error)

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

func (*AdminQuery) IDsX

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

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

func (*AdminQuery) Limit

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

Limit adds a limit step to the query.

func (*AdminQuery) Offset

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

Offset adds an offset step to the query.

func (*AdminQuery) Only

func (aq *AdminQuery) Only(ctx context.Context) (*Admin, error)

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

func (*AdminQuery) OnlyID

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

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

func (*AdminQuery) OnlyIDX

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

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

func (*AdminQuery) OnlyX

func (aq *AdminQuery) OnlyX(ctx context.Context) *Admin

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

func (*AdminQuery) Order

func (aq *AdminQuery) Order(o ...OrderFunc) *AdminQuery

Order adds an order step to the query.

func (*AdminQuery) QueryUser

func (aq *AdminQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*AdminQuery) Select

func (aq *AdminQuery) Select(fields ...string) *AdminSelect

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

client.Admin.Query().
	Select(admin.FieldCreateTime).
	Scan(ctx, &v)

func (*AdminQuery) Unique

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

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

func (aq *AdminQuery) Where(ps ...predicate.Admin) *AdminQuery

Where adds a new predicate for the AdminQuery builder.

func (*AdminQuery) WithUser

func (aq *AdminQuery) WithUser(opts ...func(*UserQuery)) *AdminQuery

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 AdminSelect

type AdminSelect struct {
	*AdminQuery
	// contains filtered or unexported fields
}

AdminSelect is the builder for selecting fields of Admin entities.

func (*AdminSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*AdminSelect) Bool

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

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

func (*AdminSelect) BoolX

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

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

func (*AdminSelect) Bools

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

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

func (*AdminSelect) BoolsX

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

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

func (*AdminSelect) Float64

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

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

func (*AdminSelect) Float64X

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

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

func (*AdminSelect) Float64s

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

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

func (*AdminSelect) Float64sX

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

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

func (*AdminSelect) Int

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

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

func (*AdminSelect) IntX

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

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

func (*AdminSelect) Ints

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

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

func (*AdminSelect) IntsX

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

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

func (*AdminSelect) Scan

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

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

func (*AdminSelect) ScanX

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

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

func (*AdminSelect) String

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

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

func (*AdminSelect) StringX

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

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

func (*AdminSelect) Strings

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

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

func (*AdminSelect) StringsX

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

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

type AdminUpdate

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

AdminUpdate is the builder for updating Admin entities.

func (*AdminUpdate) ClearUser

func (au *AdminUpdate) ClearUser() *AdminUpdate

ClearUser clears the "user" edge to the User entity.

func (*AdminUpdate) Exec

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

Exec executes the query.

func (*AdminUpdate) ExecX

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

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

func (*AdminUpdate) Mutation

func (au *AdminUpdate) Mutation() *AdminMutation

Mutation returns the AdminMutation object of the builder.

func (*AdminUpdate) Save

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

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

func (*AdminUpdate) SaveX

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

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

func (*AdminUpdate) SetPhoneNumber

func (au *AdminUpdate) SetPhoneNumber(s string) *AdminUpdate

SetPhoneNumber sets the "phone_number" field.

func (*AdminUpdate) SetUpdateTime

func (au *AdminUpdate) SetUpdateTime(t time.Time) *AdminUpdate

SetUpdateTime sets the "update_time" field.

func (*AdminUpdate) SetUser

func (au *AdminUpdate) SetUser(u *User) *AdminUpdate

SetUser sets the "user" edge to the User entity.

func (*AdminUpdate) SetUserID

func (au *AdminUpdate) SetUserID(id int) *AdminUpdate

SetUserID sets the "user" edge to the User entity by ID.

func (*AdminUpdate) Where

func (au *AdminUpdate) Where(ps ...predicate.Admin) *AdminUpdate

Where appends a list predicates to the AdminUpdate builder.

type AdminUpdateOne

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

AdminUpdateOne is the builder for updating a single Admin entity.

func (*AdminUpdateOne) ClearUser

func (auo *AdminUpdateOne) ClearUser() *AdminUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*AdminUpdateOne) Exec

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

Exec executes the query on the entity.

func (*AdminUpdateOne) ExecX

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

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

func (*AdminUpdateOne) Mutation

func (auo *AdminUpdateOne) Mutation() *AdminMutation

Mutation returns the AdminMutation object of the builder.

func (*AdminUpdateOne) Save

func (auo *AdminUpdateOne) Save(ctx context.Context) (*Admin, error)

Save executes the query and returns the updated Admin entity.

func (*AdminUpdateOne) SaveX

func (auo *AdminUpdateOne) SaveX(ctx context.Context) *Admin

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

func (*AdminUpdateOne) Select

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

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

func (*AdminUpdateOne) SetPhoneNumber

func (auo *AdminUpdateOne) SetPhoneNumber(s string) *AdminUpdateOne

SetPhoneNumber sets the "phone_number" field.

func (*AdminUpdateOne) SetUpdateTime

func (auo *AdminUpdateOne) SetUpdateTime(t time.Time) *AdminUpdateOne

SetUpdateTime sets the "update_time" field.

func (*AdminUpdateOne) SetUser

func (auo *AdminUpdateOne) SetUser(u *User) *AdminUpdateOne

SetUser sets the "user" edge to the User entity.

func (*AdminUpdateOne) SetUserID

func (auo *AdminUpdateOne) SetUserID(id int) *AdminUpdateOne

SetUserID sets the "user" edge to the User entity by ID.

type Admins

type Admins []*Admin

Admins is a parsable slice of Admin.

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
	// Admin is the client for interacting with the Admin builders.
	Admin *AdminClient
	// Meeting is the client for interacting with the Meeting builders.
	Meeting *MeetingClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

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

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

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

Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.

func (*Client) BeginTx

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

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

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

func (*Client) Debug

func (c *Client) Debug() *Client

Debug returns a new debug-client. It's used to get verbose logging on specific operations.

client.Debug().
	Admin.
	Query().
	Count(ctx)

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:

hook := func(next ent.Committer) ent.Committer {
	return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Commit(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Hook

type Hook = ent.Hook

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

type Meeting

type Meeting struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Title holds the value of the "title" field.
	Title string `json:"title,omitempty"`
	// StartsAt holds the value of the "starts_at" field.
	StartsAt time.Time `json:"starts_at,omitempty"`
	// EndsAt holds the value of the "ends_at" field.
	EndsAt time.Time `json:"ends_at,omitempty"`
	// Description holds the value of the "description" field.
	Description *string `json:"description,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MeetingQuery when eager-loading is set.
	Edges MeetingEdges `json:"edges"`
	// contains filtered or unexported fields
}

Meeting is the model entity for the Meeting schema.

func (*Meeting) QueryOrganizer

func (m *Meeting) QueryOrganizer() *UserQuery

QueryOrganizer queries the "organizer" edge of the Meeting entity.

func (*Meeting) QueryParticipants

func (m *Meeting) QueryParticipants() *UserQuery

QueryParticipants queries the "participants" edge of the Meeting entity.

func (*Meeting) String

func (m *Meeting) String() string

String implements the fmt.Stringer.

func (*Meeting) Unwrap

func (m *Meeting) Unwrap() *Meeting

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

func (m *Meeting) Update() *MeetingUpdateOne

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

type MeetingClient

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

MeetingClient is a client for the Meeting schema.

func NewMeetingClient

func NewMeetingClient(c config) *MeetingClient

NewMeetingClient returns a client for the Meeting from the given config.

func (*MeetingClient) Create

func (c *MeetingClient) Create() *MeetingCreate

Create returns a builder for creating a Meeting entity.

func (*MeetingClient) CreateBulk

func (c *MeetingClient) CreateBulk(builders ...*MeetingCreate) *MeetingCreateBulk

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

func (*MeetingClient) Delete

func (c *MeetingClient) Delete() *MeetingDelete

Delete returns a delete builder for Meeting.

func (*MeetingClient) DeleteOne

func (c *MeetingClient) DeleteOne(m *Meeting) *MeetingDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MeetingClient) DeleteOneID

func (c *MeetingClient) DeleteOneID(id int) *MeetingDeleteOne

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

func (*MeetingClient) Get

func (c *MeetingClient) Get(ctx context.Context, id int) (*Meeting, error)

Get returns a Meeting entity by its id.

func (*MeetingClient) GetX

func (c *MeetingClient) GetX(ctx context.Context, id int) *Meeting

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

func (*MeetingClient) Hooks

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

Hooks returns the client hooks.

func (*MeetingClient) Query

func (c *MeetingClient) Query() *MeetingQuery

Query returns a query builder for Meeting.

func (*MeetingClient) QueryOrganizer

func (c *MeetingClient) QueryOrganizer(m *Meeting) *UserQuery

QueryOrganizer queries the organizer edge of a Meeting.

func (*MeetingClient) QueryParticipants

func (c *MeetingClient) QueryParticipants(m *Meeting) *UserQuery

QueryParticipants queries the participants edge of a Meeting.

func (*MeetingClient) Update

func (c *MeetingClient) Update() *MeetingUpdate

Update returns an update builder for Meeting.

func (*MeetingClient) UpdateOne

func (c *MeetingClient) UpdateOne(m *Meeting) *MeetingUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MeetingClient) UpdateOneID

func (c *MeetingClient) UpdateOneID(id int) *MeetingUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MeetingClient) Use

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

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

type MeetingCreate

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

MeetingCreate is the builder for creating a Meeting entity.

func (*MeetingCreate) AddParticipantIDs

func (mc *MeetingCreate) AddParticipantIDs(ids ...int) *MeetingCreate

AddParticipantIDs adds the "participants" edge to the User entity by IDs.

func (*MeetingCreate) AddParticipants

func (mc *MeetingCreate) AddParticipants(u ...*User) *MeetingCreate

AddParticipants adds the "participants" edges to the User entity.

func (*MeetingCreate) Exec

func (mc *MeetingCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MeetingCreate) ExecX

func (mc *MeetingCreate) ExecX(ctx context.Context)

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

func (*MeetingCreate) Mutation

func (mc *MeetingCreate) Mutation() *MeetingMutation

Mutation returns the MeetingMutation object of the builder.

func (*MeetingCreate) Save

func (mc *MeetingCreate) Save(ctx context.Context) (*Meeting, error)

Save creates the Meeting in the database.

func (*MeetingCreate) SaveX

func (mc *MeetingCreate) SaveX(ctx context.Context) *Meeting

SaveX calls Save and panics if Save returns an error.

func (*MeetingCreate) SetCreateTime

func (mc *MeetingCreate) SetCreateTime(t time.Time) *MeetingCreate

SetCreateTime sets the "create_time" field.

func (*MeetingCreate) SetDescription

func (mc *MeetingCreate) SetDescription(s string) *MeetingCreate

SetDescription sets the "description" field.

func (*MeetingCreate) SetEndsAt

func (mc *MeetingCreate) SetEndsAt(t time.Time) *MeetingCreate

SetEndsAt sets the "ends_at" field.

func (*MeetingCreate) SetNillableCreateTime

func (mc *MeetingCreate) SetNillableCreateTime(t *time.Time) *MeetingCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*MeetingCreate) SetNillableDescription

func (mc *MeetingCreate) SetNillableDescription(s *string) *MeetingCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*MeetingCreate) SetNillableOrganizerID

func (mc *MeetingCreate) SetNillableOrganizerID(id *int) *MeetingCreate

SetNillableOrganizerID sets the "organizer" edge to the User entity by ID if the given value is not nil.

func (*MeetingCreate) SetNillableUpdateTime

func (mc *MeetingCreate) SetNillableUpdateTime(t *time.Time) *MeetingCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*MeetingCreate) SetOrganizer

func (mc *MeetingCreate) SetOrganizer(u *User) *MeetingCreate

SetOrganizer sets the "organizer" edge to the User entity.

func (*MeetingCreate) SetOrganizerID

func (mc *MeetingCreate) SetOrganizerID(id int) *MeetingCreate

SetOrganizerID sets the "organizer" edge to the User entity by ID.

func (*MeetingCreate) SetStartsAt

func (mc *MeetingCreate) SetStartsAt(t time.Time) *MeetingCreate

SetStartsAt sets the "starts_at" field.

func (*MeetingCreate) SetTitle

func (mc *MeetingCreate) SetTitle(s string) *MeetingCreate

SetTitle sets the "title" field.

func (*MeetingCreate) SetUpdateTime

func (mc *MeetingCreate) SetUpdateTime(t time.Time) *MeetingCreate

SetUpdateTime sets the "update_time" field.

type MeetingCreateBulk

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

MeetingCreateBulk is the builder for creating many Meeting entities in bulk.

func (*MeetingCreateBulk) Exec

func (mcb *MeetingCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MeetingCreateBulk) ExecX

func (mcb *MeetingCreateBulk) ExecX(ctx context.Context)

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

func (*MeetingCreateBulk) Save

func (mcb *MeetingCreateBulk) Save(ctx context.Context) ([]*Meeting, error)

Save creates the Meeting entities in the database.

func (*MeetingCreateBulk) SaveX

func (mcb *MeetingCreateBulk) SaveX(ctx context.Context) []*Meeting

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

type MeetingDelete

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

MeetingDelete is the builder for deleting a Meeting entity.

func (*MeetingDelete) Exec

func (md *MeetingDelete) Exec(ctx context.Context) (int, error)

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

func (*MeetingDelete) ExecX

func (md *MeetingDelete) ExecX(ctx context.Context) int

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

func (*MeetingDelete) Where

func (md *MeetingDelete) Where(ps ...predicate.Meeting) *MeetingDelete

Where appends a list predicates to the MeetingDelete builder.

type MeetingDeleteOne

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

MeetingDeleteOne is the builder for deleting a single Meeting entity.

func (*MeetingDeleteOne) Exec

func (mdo *MeetingDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MeetingDeleteOne) ExecX

func (mdo *MeetingDeleteOne) ExecX(ctx context.Context)

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

type MeetingEdges

type MeetingEdges struct {
	// Organizer holds the value of the organizer edge.
	Organizer *User `json:"organizer,omitempty"`
	// Participants holds the value of the participants edge.
	Participants []*User `json:"participants,omitempty"`
	// contains filtered or unexported fields
}

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

func (MeetingEdges) OrganizerOrErr

func (e MeetingEdges) OrganizerOrErr() (*User, error)

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

func (MeetingEdges) ParticipantsOrErr

func (e MeetingEdges) ParticipantsOrErr() ([]*User, error)

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

type MeetingGroupBy

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

MeetingGroupBy is the group-by builder for Meeting entities.

func (*MeetingGroupBy) Aggregate

func (mgb *MeetingGroupBy) Aggregate(fns ...AggregateFunc) *MeetingGroupBy

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

func (*MeetingGroupBy) Bool

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

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

func (*MeetingGroupBy) BoolX

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

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

func (*MeetingGroupBy) Bools

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

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

func (*MeetingGroupBy) BoolsX

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

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

func (*MeetingGroupBy) Float64

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

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

func (*MeetingGroupBy) Float64X

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

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

func (*MeetingGroupBy) Float64s

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

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

func (*MeetingGroupBy) Float64sX

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

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

func (*MeetingGroupBy) Int

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

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

func (*MeetingGroupBy) IntX

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

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

func (*MeetingGroupBy) Ints

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

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

func (*MeetingGroupBy) IntsX

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

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

func (*MeetingGroupBy) Scan

func (mgb *MeetingGroupBy) Scan(ctx context.Context, v any) error

Scan applies the group-by query and scans the result into the given value.

func (*MeetingGroupBy) ScanX

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

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

func (*MeetingGroupBy) String

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

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

func (*MeetingGroupBy) StringX

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

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

func (*MeetingGroupBy) Strings

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

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

func (*MeetingGroupBy) StringsX

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

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

type MeetingMutation

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

MeetingMutation represents an operation that mutates the Meeting nodes in the graph.

func (*MeetingMutation) AddField

func (m *MeetingMutation) 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 (*MeetingMutation) AddParticipantIDs

func (m *MeetingMutation) AddParticipantIDs(ids ...int)

AddParticipantIDs adds the "participants" edge to the User entity by ids.

func (*MeetingMutation) AddedEdges

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

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

func (*MeetingMutation) AddedField

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

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

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

func (*MeetingMutation) AddedIDs

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

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

func (*MeetingMutation) ClearDescription

func (m *MeetingMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*MeetingMutation) ClearEdge

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

func (m *MeetingMutation) 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 (*MeetingMutation) ClearOrganizer

func (m *MeetingMutation) ClearOrganizer()

ClearOrganizer clears the "organizer" edge to the User entity.

func (*MeetingMutation) ClearParticipants

func (m *MeetingMutation) ClearParticipants()

ClearParticipants clears the "participants" edge to the User entity.

func (*MeetingMutation) ClearedEdges

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

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

func (*MeetingMutation) ClearedFields

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

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

func (MeetingMutation) Client

func (m MeetingMutation) 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 (*MeetingMutation) CreateTime

func (m *MeetingMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*MeetingMutation) Description

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

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

func (*MeetingMutation) DescriptionCleared

func (m *MeetingMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*MeetingMutation) EdgeCleared

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

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

func (*MeetingMutation) EndsAt

func (m *MeetingMutation) EndsAt() (r time.Time, exists bool)

EndsAt returns the value of the "ends_at" field in the mutation.

func (*MeetingMutation) Field

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

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

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

func (*MeetingMutation) Fields

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

func (m *MeetingMutation) 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 (*MeetingMutation) IDs

func (m *MeetingMutation) 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 (*MeetingMutation) OldCreateTime

func (m *MeetingMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Meeting entity. If the Meeting 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 (*MeetingMutation) OldDescription

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

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

func (m *MeetingMutation) OldEndsAt(ctx context.Context) (v time.Time, err error)

OldEndsAt returns the old "ends_at" field's value of the Meeting entity. If the Meeting 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 (*MeetingMutation) OldField

func (m *MeetingMutation) 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 (*MeetingMutation) OldStartsAt

func (m *MeetingMutation) OldStartsAt(ctx context.Context) (v time.Time, err error)

OldStartsAt returns the old "starts_at" field's value of the Meeting entity. If the Meeting 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 (*MeetingMutation) OldTitle

func (m *MeetingMutation) OldTitle(ctx context.Context) (v string, err error)

OldTitle returns the old "title" field's value of the Meeting entity. If the Meeting 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 (*MeetingMutation) OldUpdateTime

func (m *MeetingMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Meeting entity. If the Meeting 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 (*MeetingMutation) Op

func (m *MeetingMutation) Op() Op

Op returns the operation name.

func (*MeetingMutation) OrganizerCleared

func (m *MeetingMutation) OrganizerCleared() bool

OrganizerCleared reports if the "organizer" edge to the User entity was cleared.

func (*MeetingMutation) OrganizerID

func (m *MeetingMutation) OrganizerID() (id int, exists bool)

OrganizerID returns the "organizer" edge ID in the mutation.

func (*MeetingMutation) OrganizerIDs

func (m *MeetingMutation) OrganizerIDs() (ids []int)

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

func (*MeetingMutation) ParticipantsCleared

func (m *MeetingMutation) ParticipantsCleared() bool

ParticipantsCleared reports if the "participants" edge to the User entity was cleared.

func (*MeetingMutation) ParticipantsIDs

func (m *MeetingMutation) ParticipantsIDs() (ids []int)

ParticipantsIDs returns the "participants" edge IDs in the mutation.

func (*MeetingMutation) RemoveParticipantIDs

func (m *MeetingMutation) RemoveParticipantIDs(ids ...int)

RemoveParticipantIDs removes the "participants" edge to the User entity by IDs.

func (*MeetingMutation) RemovedEdges

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

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

func (*MeetingMutation) RemovedIDs

func (m *MeetingMutation) 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 (*MeetingMutation) RemovedParticipantsIDs

func (m *MeetingMutation) RemovedParticipantsIDs() (ids []int)

RemovedParticipants returns the removed IDs of the "participants" edge to the User entity.

func (*MeetingMutation) ResetCreateTime

func (m *MeetingMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*MeetingMutation) ResetDescription

func (m *MeetingMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*MeetingMutation) ResetEdge

func (m *MeetingMutation) 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 (*MeetingMutation) ResetEndsAt

func (m *MeetingMutation) ResetEndsAt()

ResetEndsAt resets all changes to the "ends_at" field.

func (*MeetingMutation) ResetField

func (m *MeetingMutation) 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 (*MeetingMutation) ResetOrganizer

func (m *MeetingMutation) ResetOrganizer()

ResetOrganizer resets all changes to the "organizer" edge.

func (*MeetingMutation) ResetParticipants

func (m *MeetingMutation) ResetParticipants()

ResetParticipants resets all changes to the "participants" edge.

func (*MeetingMutation) ResetStartsAt

func (m *MeetingMutation) ResetStartsAt()

ResetStartsAt resets all changes to the "starts_at" field.

func (*MeetingMutation) ResetTitle

func (m *MeetingMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*MeetingMutation) ResetUpdateTime

func (m *MeetingMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*MeetingMutation) SetCreateTime

func (m *MeetingMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*MeetingMutation) SetDescription

func (m *MeetingMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*MeetingMutation) SetEndsAt

func (m *MeetingMutation) SetEndsAt(t time.Time)

SetEndsAt sets the "ends_at" field.

func (*MeetingMutation) SetField

func (m *MeetingMutation) 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 (*MeetingMutation) SetOrganizerID

func (m *MeetingMutation) SetOrganizerID(id int)

SetOrganizerID sets the "organizer" edge to the User entity by id.

func (*MeetingMutation) SetStartsAt

func (m *MeetingMutation) SetStartsAt(t time.Time)

SetStartsAt sets the "starts_at" field.

func (*MeetingMutation) SetTitle

func (m *MeetingMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*MeetingMutation) SetUpdateTime

func (m *MeetingMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*MeetingMutation) StartsAt

func (m *MeetingMutation) StartsAt() (r time.Time, exists bool)

StartsAt returns the value of the "starts_at" field in the mutation.

func (*MeetingMutation) Title

func (m *MeetingMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (MeetingMutation) Tx

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

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

func (*MeetingMutation) Type

func (m *MeetingMutation) Type() string

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

func (*MeetingMutation) UpdateTime

func (m *MeetingMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*MeetingMutation) Where

func (m *MeetingMutation) Where(ps ...predicate.Meeting)

Where appends a list predicates to the MeetingMutation builder.

type MeetingQuery

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

MeetingQuery is the builder for querying Meeting entities.

func (*MeetingQuery) Aggregate

func (mq *MeetingQuery) Aggregate(fns ...AggregateFunc) *MeetingSelect

Aggregate returns a MeetingSelect configured with the given aggregations.

func (*MeetingQuery) All

func (mq *MeetingQuery) All(ctx context.Context) ([]*Meeting, error)

All executes the query and returns a list of Meetings.

func (*MeetingQuery) AllX

func (mq *MeetingQuery) AllX(ctx context.Context) []*Meeting

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

func (*MeetingQuery) Clone

func (mq *MeetingQuery) Clone() *MeetingQuery

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

func (*MeetingQuery) Count

func (mq *MeetingQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MeetingQuery) CountX

func (mq *MeetingQuery) CountX(ctx context.Context) int

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

func (*MeetingQuery) Exist

func (mq *MeetingQuery) Exist(ctx context.Context) (bool, error)

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

func (*MeetingQuery) ExistX

func (mq *MeetingQuery) ExistX(ctx context.Context) bool

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

func (*MeetingQuery) First

func (mq *MeetingQuery) First(ctx context.Context) (*Meeting, error)

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

func (*MeetingQuery) FirstID

func (mq *MeetingQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*MeetingQuery) FirstIDX

func (mq *MeetingQuery) FirstIDX(ctx context.Context) int

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

func (*MeetingQuery) FirstX

func (mq *MeetingQuery) FirstX(ctx context.Context) *Meeting

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

func (*MeetingQuery) GroupBy

func (mq *MeetingQuery) GroupBy(field string, fields ...string) *MeetingGroupBy

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

client.Meeting.Query().
	GroupBy(meeting.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MeetingQuery) IDs

func (mq *MeetingQuery) IDs(ctx context.Context) ([]int, error)

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

func (*MeetingQuery) IDsX

func (mq *MeetingQuery) IDsX(ctx context.Context) []int

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

func (*MeetingQuery) Limit

func (mq *MeetingQuery) Limit(limit int) *MeetingQuery

Limit adds a limit step to the query.

func (*MeetingQuery) Offset

func (mq *MeetingQuery) Offset(offset int) *MeetingQuery

Offset adds an offset step to the query.

func (*MeetingQuery) Only

func (mq *MeetingQuery) Only(ctx context.Context) (*Meeting, error)

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

func (*MeetingQuery) OnlyID

func (mq *MeetingQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*MeetingQuery) OnlyIDX

func (mq *MeetingQuery) OnlyIDX(ctx context.Context) int

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

func (*MeetingQuery) OnlyX

func (mq *MeetingQuery) OnlyX(ctx context.Context) *Meeting

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

func (*MeetingQuery) Order

func (mq *MeetingQuery) Order(o ...OrderFunc) *MeetingQuery

Order adds an order step to the query.

func (*MeetingQuery) QueryOrganizer

func (mq *MeetingQuery) QueryOrganizer() *UserQuery

QueryOrganizer chains the current query on the "organizer" edge.

func (*MeetingQuery) QueryParticipants

func (mq *MeetingQuery) QueryParticipants() *UserQuery

QueryParticipants chains the current query on the "participants" edge.

func (*MeetingQuery) Select

func (mq *MeetingQuery) Select(fields ...string) *MeetingSelect

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

client.Meeting.Query().
	Select(meeting.FieldCreateTime).
	Scan(ctx, &v)

func (*MeetingQuery) Unique

func (mq *MeetingQuery) Unique(unique bool) *MeetingQuery

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

func (mq *MeetingQuery) Where(ps ...predicate.Meeting) *MeetingQuery

Where adds a new predicate for the MeetingQuery builder.

func (*MeetingQuery) WithOrganizer

func (mq *MeetingQuery) WithOrganizer(opts ...func(*UserQuery)) *MeetingQuery

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

func (*MeetingQuery) WithParticipants

func (mq *MeetingQuery) WithParticipants(opts ...func(*UserQuery)) *MeetingQuery

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

type MeetingSelect

type MeetingSelect struct {
	*MeetingQuery
	// contains filtered or unexported fields
}

MeetingSelect is the builder for selecting fields of Meeting entities.

func (*MeetingSelect) Aggregate

func (ms *MeetingSelect) Aggregate(fns ...AggregateFunc) *MeetingSelect

Aggregate adds the given aggregation functions to the selector query.

func (*MeetingSelect) Bool

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

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

func (*MeetingSelect) BoolX

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

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

func (*MeetingSelect) Bools

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

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

func (*MeetingSelect) BoolsX

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

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

func (*MeetingSelect) Float64

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

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

func (*MeetingSelect) Float64X

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

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

func (*MeetingSelect) Float64s

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

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

func (*MeetingSelect) Float64sX

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

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

func (*MeetingSelect) Int

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

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

func (*MeetingSelect) IntX

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

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

func (*MeetingSelect) Ints

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

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

func (*MeetingSelect) IntsX

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

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

func (*MeetingSelect) Scan

func (ms *MeetingSelect) Scan(ctx context.Context, v any) error

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

func (*MeetingSelect) ScanX

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

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

func (*MeetingSelect) String

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

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

func (*MeetingSelect) StringX

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

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

func (*MeetingSelect) Strings

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

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

func (*MeetingSelect) StringsX

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

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

type MeetingUpdate

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

MeetingUpdate is the builder for updating Meeting entities.

func (*MeetingUpdate) AddParticipantIDs

func (mu *MeetingUpdate) AddParticipantIDs(ids ...int) *MeetingUpdate

AddParticipantIDs adds the "participants" edge to the User entity by IDs.

func (*MeetingUpdate) AddParticipants

func (mu *MeetingUpdate) AddParticipants(u ...*User) *MeetingUpdate

AddParticipants adds the "participants" edges to the User entity.

func (*MeetingUpdate) ClearDescription

func (mu *MeetingUpdate) ClearDescription() *MeetingUpdate

ClearDescription clears the value of the "description" field.

func (*MeetingUpdate) ClearOrganizer

func (mu *MeetingUpdate) ClearOrganizer() *MeetingUpdate

ClearOrganizer clears the "organizer" edge to the User entity.

func (*MeetingUpdate) ClearParticipants

func (mu *MeetingUpdate) ClearParticipants() *MeetingUpdate

ClearParticipants clears all "participants" edges to the User entity.

func (*MeetingUpdate) Exec

func (mu *MeetingUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MeetingUpdate) ExecX

func (mu *MeetingUpdate) ExecX(ctx context.Context)

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

func (*MeetingUpdate) Mutation

func (mu *MeetingUpdate) Mutation() *MeetingMutation

Mutation returns the MeetingMutation object of the builder.

func (*MeetingUpdate) RemoveParticipantIDs

func (mu *MeetingUpdate) RemoveParticipantIDs(ids ...int) *MeetingUpdate

RemoveParticipantIDs removes the "participants" edge to User entities by IDs.

func (*MeetingUpdate) RemoveParticipants

func (mu *MeetingUpdate) RemoveParticipants(u ...*User) *MeetingUpdate

RemoveParticipants removes "participants" edges to User entities.

func (*MeetingUpdate) Save

func (mu *MeetingUpdate) Save(ctx context.Context) (int, error)

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

func (*MeetingUpdate) SaveX

func (mu *MeetingUpdate) SaveX(ctx context.Context) int

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

func (*MeetingUpdate) SetDescription

func (mu *MeetingUpdate) SetDescription(s string) *MeetingUpdate

SetDescription sets the "description" field.

func (*MeetingUpdate) SetEndsAt

func (mu *MeetingUpdate) SetEndsAt(t time.Time) *MeetingUpdate

SetEndsAt sets the "ends_at" field.

func (*MeetingUpdate) SetNillableDescription

func (mu *MeetingUpdate) SetNillableDescription(s *string) *MeetingUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*MeetingUpdate) SetNillableOrganizerID

func (mu *MeetingUpdate) SetNillableOrganizerID(id *int) *MeetingUpdate

SetNillableOrganizerID sets the "organizer" edge to the User entity by ID if the given value is not nil.

func (*MeetingUpdate) SetOrganizer

func (mu *MeetingUpdate) SetOrganizer(u *User) *MeetingUpdate

SetOrganizer sets the "organizer" edge to the User entity.

func (*MeetingUpdate) SetOrganizerID

func (mu *MeetingUpdate) SetOrganizerID(id int) *MeetingUpdate

SetOrganizerID sets the "organizer" edge to the User entity by ID.

func (*MeetingUpdate) SetStartsAt

func (mu *MeetingUpdate) SetStartsAt(t time.Time) *MeetingUpdate

SetStartsAt sets the "starts_at" field.

func (*MeetingUpdate) SetTitle

func (mu *MeetingUpdate) SetTitle(s string) *MeetingUpdate

SetTitle sets the "title" field.

func (*MeetingUpdate) SetUpdateTime

func (mu *MeetingUpdate) SetUpdateTime(t time.Time) *MeetingUpdate

SetUpdateTime sets the "update_time" field.

func (*MeetingUpdate) Where

func (mu *MeetingUpdate) Where(ps ...predicate.Meeting) *MeetingUpdate

Where appends a list predicates to the MeetingUpdate builder.

type MeetingUpdateOne

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

MeetingUpdateOne is the builder for updating a single Meeting entity.

func (*MeetingUpdateOne) AddParticipantIDs

func (muo *MeetingUpdateOne) AddParticipantIDs(ids ...int) *MeetingUpdateOne

AddParticipantIDs adds the "participants" edge to the User entity by IDs.

func (*MeetingUpdateOne) AddParticipants

func (muo *MeetingUpdateOne) AddParticipants(u ...*User) *MeetingUpdateOne

AddParticipants adds the "participants" edges to the User entity.

func (*MeetingUpdateOne) ClearDescription

func (muo *MeetingUpdateOne) ClearDescription() *MeetingUpdateOne

ClearDescription clears the value of the "description" field.

func (*MeetingUpdateOne) ClearOrganizer

func (muo *MeetingUpdateOne) ClearOrganizer() *MeetingUpdateOne

ClearOrganizer clears the "organizer" edge to the User entity.

func (*MeetingUpdateOne) ClearParticipants

func (muo *MeetingUpdateOne) ClearParticipants() *MeetingUpdateOne

ClearParticipants clears all "participants" edges to the User entity.

func (*MeetingUpdateOne) Exec

func (muo *MeetingUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MeetingUpdateOne) ExecX

func (muo *MeetingUpdateOne) ExecX(ctx context.Context)

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

func (*MeetingUpdateOne) Mutation

func (muo *MeetingUpdateOne) Mutation() *MeetingMutation

Mutation returns the MeetingMutation object of the builder.

func (*MeetingUpdateOne) RemoveParticipantIDs

func (muo *MeetingUpdateOne) RemoveParticipantIDs(ids ...int) *MeetingUpdateOne

RemoveParticipantIDs removes the "participants" edge to User entities by IDs.

func (*MeetingUpdateOne) RemoveParticipants

func (muo *MeetingUpdateOne) RemoveParticipants(u ...*User) *MeetingUpdateOne

RemoveParticipants removes "participants" edges to User entities.

func (*MeetingUpdateOne) Save

func (muo *MeetingUpdateOne) Save(ctx context.Context) (*Meeting, error)

Save executes the query and returns the updated Meeting entity.

func (*MeetingUpdateOne) SaveX

func (muo *MeetingUpdateOne) SaveX(ctx context.Context) *Meeting

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

func (*MeetingUpdateOne) Select

func (muo *MeetingUpdateOne) Select(field string, fields ...string) *MeetingUpdateOne

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

func (*MeetingUpdateOne) SetDescription

func (muo *MeetingUpdateOne) SetDescription(s string) *MeetingUpdateOne

SetDescription sets the "description" field.

func (*MeetingUpdateOne) SetEndsAt

func (muo *MeetingUpdateOne) SetEndsAt(t time.Time) *MeetingUpdateOne

SetEndsAt sets the "ends_at" field.

func (*MeetingUpdateOne) SetNillableDescription

func (muo *MeetingUpdateOne) SetNillableDescription(s *string) *MeetingUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*MeetingUpdateOne) SetNillableOrganizerID

func (muo *MeetingUpdateOne) SetNillableOrganizerID(id *int) *MeetingUpdateOne

SetNillableOrganizerID sets the "organizer" edge to the User entity by ID if the given value is not nil.

func (*MeetingUpdateOne) SetOrganizer

func (muo *MeetingUpdateOne) SetOrganizer(u *User) *MeetingUpdateOne

SetOrganizer sets the "organizer" edge to the User entity.

func (*MeetingUpdateOne) SetOrganizerID

func (muo *MeetingUpdateOne) SetOrganizerID(id int) *MeetingUpdateOne

SetOrganizerID sets the "organizer" edge to the User entity by ID.

func (*MeetingUpdateOne) SetStartsAt

func (muo *MeetingUpdateOne) SetStartsAt(t time.Time) *MeetingUpdateOne

SetStartsAt sets the "starts_at" field.

func (*MeetingUpdateOne) SetTitle

func (muo *MeetingUpdateOne) SetTitle(s string) *MeetingUpdateOne

SetTitle sets the "title" field.

func (*MeetingUpdateOne) SetUpdateTime

func (muo *MeetingUpdateOne) SetUpdateTime(t time.Time) *MeetingUpdateOne

SetUpdateTime sets the "update_time" field.

type Meetings

type Meetings []*Meeting

Meetings is a parsable slice of Meeting.

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.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type Policy

type Policy = ent.Policy

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

type Tx struct {

	// Admin is the client for interacting with the Admin builders.
	Admin *AdminClient
	// Meeting is the client for interacting with the Meeting builders.
	Meeting *MeetingClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

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

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type User

type User struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Nickname holds the value of the "nickname" field.
	Nickname string `json:"nickname,omitempty"`
	// Email holds the value of the "email" field.
	Email *string `json:"email,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) QueryAdmin

func (u *User) QueryAdmin() *AdminQuery

QueryAdmin queries the "admin" edge of the User entity.

func (*User) QueryMeetings

func (u *User) QueryMeetings() *MeetingQuery

QueryMeetings queries the "meetings" edge of the User entity.

func (*User) QueryOrganizes

func (u *User) QueryOrganizes() *MeetingQuery

QueryOrganizes queries the "organizes" 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.

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

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryAdmin

func (c *UserClient) QueryAdmin(u *User) *AdminQuery

QueryAdmin queries the admin edge of a User.

func (*UserClient) QueryMeetings

func (c *UserClient) QueryMeetings(u *User) *MeetingQuery

QueryMeetings queries the meetings edge of a User.

func (*UserClient) QueryOrganizes

func (c *UserClient) QueryOrganizes(u *User) *MeetingQuery

QueryOrganizes queries the organizes 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) AddMeetingIDs

func (uc *UserCreate) AddMeetingIDs(ids ...int) *UserCreate

AddMeetingIDs adds the "meetings" edge to the Meeting entity by IDs.

func (*UserCreate) AddMeetings

func (uc *UserCreate) AddMeetings(m ...*Meeting) *UserCreate

AddMeetings adds the "meetings" edges to the Meeting entity.

func (*UserCreate) AddOrganizeIDs

func (uc *UserCreate) AddOrganizeIDs(ids ...int) *UserCreate

AddOrganizeIDs adds the "organizes" edge to the Meeting entity by IDs.

func (*UserCreate) AddOrganizes

func (uc *UserCreate) AddOrganizes(m ...*Meeting) *UserCreate

AddOrganizes adds the "organizes" edges to the Meeting 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) 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) SetAdmin

func (uc *UserCreate) SetAdmin(a *Admin) *UserCreate

SetAdmin sets the "admin" edge to the Admin entity.

func (*UserCreate) SetAdminID

func (uc *UserCreate) SetAdminID(id int) *UserCreate

SetAdminID sets the "admin" edge to the Admin entity by ID.

func (*UserCreate) SetCreateTime

func (uc *UserCreate) SetCreateTime(t time.Time) *UserCreate

SetCreateTime sets the "create_time" field.

func (*UserCreate) SetEmail

func (uc *UserCreate) SetEmail(s string) *UserCreate

SetEmail sets the "email" field.

func (*UserCreate) SetNickname

func (uc *UserCreate) SetNickname(s string) *UserCreate

SetNickname sets the "nickname" field.

func (*UserCreate) SetNillableAdminID

func (uc *UserCreate) SetNillableAdminID(id *int) *UserCreate

SetNillableAdminID sets the "admin" edge to the Admin entity by ID if the given value is not nil.

func (*UserCreate) SetNillableCreateTime

func (uc *UserCreate) SetNillableCreateTime(t *time.Time) *UserCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*UserCreate) SetNillableEmail

func (uc *UserCreate) SetNillableEmail(s *string) *UserCreate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UserCreate) SetNillableUpdateTime

func (uc *UserCreate) SetNillableUpdateTime(t *time.Time) *UserCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*UserCreate) SetUpdateTime

func (uc *UserCreate) SetUpdateTime(t time.Time) *UserCreate

SetUpdateTime sets the "update_time" 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) 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.

type UserEdges

type UserEdges struct {
	// Admin holds the value of the admin edge.
	Admin *Admin `json:"admin,omitempty"`
	// Organizes holds the value of the organizes edge.
	Organizes []*Meeting `json:"organizes,omitempty"`
	// Meetings holds the value of the meetings edge.
	Meetings []*Meeting `json:"meetings,omitempty"`
	// contains filtered or unexported fields
}

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

func (UserEdges) AdminOrErr

func (e UserEdges) AdminOrErr() (*Admin, error)

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

func (UserEdges) MeetingsOrErr

func (e UserEdges) MeetingsOrErr() ([]*Meeting, error)

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

func (UserEdges) OrganizesOrErr

func (e UserEdges) OrganizesOrErr() ([]*Meeting, error)

OrganizesOrErr returns the Organizes 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 group-by query and scans the result into the given value.

func (*UserGroupBy) ScanX

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

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

func (*UserGroupBy) String

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

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

func (*UserGroupBy) StringX

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

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

func (*UserGroupBy) Strings

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

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

func (*UserGroupBy) StringsX

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

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

type UserMutation

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

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AddField

func (m *UserMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) AddMeetingIDs

func (m *UserMutation) AddMeetingIDs(ids ...int)

AddMeetingIDs adds the "meetings" edge to the Meeting entity by ids.

func (*UserMutation) AddOrganizeIDs

func (m *UserMutation) AddOrganizeIDs(ids ...int)

AddOrganizeIDs adds the "organizes" edge to the Meeting 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) AdminCleared

func (m *UserMutation) AdminCleared() bool

AdminCleared reports if the "admin" edge to the Admin entity was cleared.

func (*UserMutation) AdminID

func (m *UserMutation) AdminID() (id int, exists bool)

AdminID returns the "admin" edge ID in the mutation.

func (*UserMutation) AdminIDs

func (m *UserMutation) AdminIDs() (ids []int)

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

func (*UserMutation) ClearAdmin

func (m *UserMutation) ClearAdmin()

ClearAdmin clears the "admin" edge to the Admin 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) ClearEmail

func (m *UserMutation) ClearEmail()

ClearEmail clears the value of the "email" field.

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

func (m *UserMutation) ClearMeetings()

ClearMeetings clears the "meetings" edge to the Meeting entity.

func (*UserMutation) ClearOrganizes

func (m *UserMutation) ClearOrganizes()

ClearOrganizes clears the "organizes" edge to the Meeting 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) CreateTime

func (m *UserMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*UserMutation) EdgeCleared

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

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

func (*UserMutation) Email

func (m *UserMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*UserMutation) EmailCleared

func (m *UserMutation) EmailCleared() bool

EmailCleared returns if the "email" field was cleared in this mutation.

func (*UserMutation) Field

func (m *UserMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) FieldCleared

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

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

func (*UserMutation) Fields

func (m *UserMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*UserMutation) ID

func (m *UserMutation) ID() (id 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) MeetingsCleared

func (m *UserMutation) MeetingsCleared() bool

MeetingsCleared reports if the "meetings" edge to the Meeting entity was cleared.

func (*UserMutation) MeetingsIDs

func (m *UserMutation) MeetingsIDs() (ids []int)

MeetingsIDs returns the "meetings" edge IDs in the mutation.

func (*UserMutation) Nickname

func (m *UserMutation) Nickname() (r string, exists bool)

Nickname returns the value of the "nickname" field in the mutation.

func (*UserMutation) OldCreateTime

func (m *UserMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_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) 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) OldNickname

func (m *UserMutation) OldNickname(ctx context.Context) (v string, err error)

OldNickname returns the old "nickname" 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) OldUpdateTime

func (m *UserMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_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) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) OrganizesCleared

func (m *UserMutation) OrganizesCleared() bool

OrganizesCleared reports if the "organizes" edge to the Meeting entity was cleared.

func (*UserMutation) OrganizesIDs

func (m *UserMutation) OrganizesIDs() (ids []int)

OrganizesIDs returns the "organizes" edge IDs in the mutation.

func (*UserMutation) RemoveMeetingIDs

func (m *UserMutation) RemoveMeetingIDs(ids ...int)

RemoveMeetingIDs removes the "meetings" edge to the Meeting entity by IDs.

func (*UserMutation) RemoveOrganizeIDs

func (m *UserMutation) RemoveOrganizeIDs(ids ...int)

RemoveOrganizeIDs removes the "organizes" edge to the Meeting entity by IDs.

func (*UserMutation) RemovedEdges

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

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

func (*UserMutation) RemovedIDs

func (m *UserMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*UserMutation) RemovedMeetingsIDs

func (m *UserMutation) RemovedMeetingsIDs() (ids []int)

RemovedMeetings returns the removed IDs of the "meetings" edge to the Meeting entity.

func (*UserMutation) RemovedOrganizesIDs

func (m *UserMutation) RemovedOrganizesIDs() (ids []int)

RemovedOrganizes returns the removed IDs of the "organizes" edge to the Meeting entity.

func (*UserMutation) ResetAdmin

func (m *UserMutation) ResetAdmin()

ResetAdmin resets all changes to the "admin" edge.

func (*UserMutation) ResetCreateTime

func (m *UserMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*UserMutation) ResetEdge

func (m *UserMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*UserMutation) ResetEmail

func (m *UserMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*UserMutation) ResetField

func (m *UserMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ResetMeetings

func (m *UserMutation) ResetMeetings()

ResetMeetings resets all changes to the "meetings" edge.

func (*UserMutation) ResetNickname

func (m *UserMutation) ResetNickname()

ResetNickname resets all changes to the "nickname" field.

func (*UserMutation) ResetOrganizes

func (m *UserMutation) ResetOrganizes()

ResetOrganizes resets all changes to the "organizes" edge.

func (*UserMutation) ResetUpdateTime

func (m *UserMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*UserMutation) SetAdminID

func (m *UserMutation) SetAdminID(id int)

SetAdminID sets the "admin" edge to the Admin entity by id.

func (*UserMutation) SetCreateTime

func (m *UserMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*UserMutation) SetEmail

func (m *UserMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*UserMutation) SetField

func (m *UserMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) SetNickname

func (m *UserMutation) SetNickname(s string)

SetNickname sets the "nickname" field.

func (*UserMutation) SetUpdateTime

func (m *UserMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" 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) UpdateTime

func (m *UserMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

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

client.User.Query().
	GroupBy(user.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) ([]int, 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 adds a limit step to the query.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset adds an offset step to the query.

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 ...OrderFunc) *UserQuery

Order adds an order step to the query.

func (*UserQuery) QueryAdmin

func (uq *UserQuery) QueryAdmin() *AdminQuery

QueryAdmin chains the current query on the "admin" edge.

func (*UserQuery) QueryMeetings

func (uq *UserQuery) QueryMeetings() *MeetingQuery

QueryMeetings chains the current query on the "meetings" edge.

func (*UserQuery) QueryOrganizes

func (uq *UserQuery) QueryOrganizes() *MeetingQuery

QueryOrganizes chains the current query on the "organizes" 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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.User.Query().
	Select(user.FieldCreateTime).
	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) WithAdmin

func (uq *UserQuery) WithAdmin(opts ...func(*AdminQuery)) *UserQuery

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

func (*UserQuery) WithMeetings

func (uq *UserQuery) WithMeetings(opts ...func(*MeetingQuery)) *UserQuery

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

func (*UserQuery) WithOrganizes

func (uq *UserQuery) WithOrganizes(opts ...func(*MeetingQuery)) *UserQuery

WithOrganizes tells the query-builder to eager-load the nodes that are connected to the "organizes" 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) AddMeetingIDs

func (uu *UserUpdate) AddMeetingIDs(ids ...int) *UserUpdate

AddMeetingIDs adds the "meetings" edge to the Meeting entity by IDs.

func (*UserUpdate) AddMeetings

func (uu *UserUpdate) AddMeetings(m ...*Meeting) *UserUpdate

AddMeetings adds the "meetings" edges to the Meeting entity.

func (*UserUpdate) AddOrganizeIDs

func (uu *UserUpdate) AddOrganizeIDs(ids ...int) *UserUpdate

AddOrganizeIDs adds the "organizes" edge to the Meeting entity by IDs.

func (*UserUpdate) AddOrganizes

func (uu *UserUpdate) AddOrganizes(m ...*Meeting) *UserUpdate

AddOrganizes adds the "organizes" edges to the Meeting entity.

func (*UserUpdate) ClearAdmin

func (uu *UserUpdate) ClearAdmin() *UserUpdate

ClearAdmin clears the "admin" edge to the Admin entity.

func (*UserUpdate) ClearEmail

func (uu *UserUpdate) ClearEmail() *UserUpdate

ClearEmail clears the value of the "email" field.

func (*UserUpdate) ClearMeetings

func (uu *UserUpdate) ClearMeetings() *UserUpdate

ClearMeetings clears all "meetings" edges to the Meeting entity.

func (*UserUpdate) ClearOrganizes

func (uu *UserUpdate) ClearOrganizes() *UserUpdate

ClearOrganizes clears all "organizes" edges to the Meeting 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) RemoveMeetingIDs

func (uu *UserUpdate) RemoveMeetingIDs(ids ...int) *UserUpdate

RemoveMeetingIDs removes the "meetings" edge to Meeting entities by IDs.

func (*UserUpdate) RemoveMeetings

func (uu *UserUpdate) RemoveMeetings(m ...*Meeting) *UserUpdate

RemoveMeetings removes "meetings" edges to Meeting entities.

func (*UserUpdate) RemoveOrganizeIDs

func (uu *UserUpdate) RemoveOrganizeIDs(ids ...int) *UserUpdate

RemoveOrganizeIDs removes the "organizes" edge to Meeting entities by IDs.

func (*UserUpdate) RemoveOrganizes

func (uu *UserUpdate) RemoveOrganizes(m ...*Meeting) *UserUpdate

RemoveOrganizes removes "organizes" edges to Meeting 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) SetAdmin

func (uu *UserUpdate) SetAdmin(a *Admin) *UserUpdate

SetAdmin sets the "admin" edge to the Admin entity.

func (*UserUpdate) SetAdminID

func (uu *UserUpdate) SetAdminID(id int) *UserUpdate

SetAdminID sets the "admin" edge to the Admin entity by ID.

func (*UserUpdate) SetEmail

func (uu *UserUpdate) SetEmail(s string) *UserUpdate

SetEmail sets the "email" field.

func (*UserUpdate) SetNickname

func (uu *UserUpdate) SetNickname(s string) *UserUpdate

SetNickname sets the "nickname" field.

func (*UserUpdate) SetNillableAdminID

func (uu *UserUpdate) SetNillableAdminID(id *int) *UserUpdate

SetNillableAdminID sets the "admin" edge to the Admin entity by ID if the given value is not nil.

func (*UserUpdate) SetNillableEmail

func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UserUpdate) SetUpdateTime

func (uu *UserUpdate) SetUpdateTime(t time.Time) *UserUpdate

SetUpdateTime sets the "update_time" 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) AddMeetingIDs

func (uuo *UserUpdateOne) AddMeetingIDs(ids ...int) *UserUpdateOne

AddMeetingIDs adds the "meetings" edge to the Meeting entity by IDs.

func (*UserUpdateOne) AddMeetings

func (uuo *UserUpdateOne) AddMeetings(m ...*Meeting) *UserUpdateOne

AddMeetings adds the "meetings" edges to the Meeting entity.

func (*UserUpdateOne) AddOrganizeIDs

func (uuo *UserUpdateOne) AddOrganizeIDs(ids ...int) *UserUpdateOne

AddOrganizeIDs adds the "organizes" edge to the Meeting entity by IDs.

func (*UserUpdateOne) AddOrganizes

func (uuo *UserUpdateOne) AddOrganizes(m ...*Meeting) *UserUpdateOne

AddOrganizes adds the "organizes" edges to the Meeting entity.

func (*UserUpdateOne) ClearAdmin

func (uuo *UserUpdateOne) ClearAdmin() *UserUpdateOne

ClearAdmin clears the "admin" edge to the Admin entity.

func (*UserUpdateOne) ClearEmail

func (uuo *UserUpdateOne) ClearEmail() *UserUpdateOne

ClearEmail clears the value of the "email" field.

func (*UserUpdateOne) ClearMeetings

func (uuo *UserUpdateOne) ClearMeetings() *UserUpdateOne

ClearMeetings clears all "meetings" edges to the Meeting entity.

func (*UserUpdateOne) ClearOrganizes

func (uuo *UserUpdateOne) ClearOrganizes() *UserUpdateOne

ClearOrganizes clears all "organizes" edges to the Meeting 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) RemoveMeetingIDs

func (uuo *UserUpdateOne) RemoveMeetingIDs(ids ...int) *UserUpdateOne

RemoveMeetingIDs removes the "meetings" edge to Meeting entities by IDs.

func (*UserUpdateOne) RemoveMeetings

func (uuo *UserUpdateOne) RemoveMeetings(m ...*Meeting) *UserUpdateOne

RemoveMeetings removes "meetings" edges to Meeting entities.

func (*UserUpdateOne) RemoveOrganizeIDs

func (uuo *UserUpdateOne) RemoveOrganizeIDs(ids ...int) *UserUpdateOne

RemoveOrganizeIDs removes the "organizes" edge to Meeting entities by IDs.

func (*UserUpdateOne) RemoveOrganizes

func (uuo *UserUpdateOne) RemoveOrganizes(m ...*Meeting) *UserUpdateOne

RemoveOrganizes removes "organizes" edges to Meeting 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) SetAdmin

func (uuo *UserUpdateOne) SetAdmin(a *Admin) *UserUpdateOne

SetAdmin sets the "admin" edge to the Admin entity.

func (*UserUpdateOne) SetAdminID

func (uuo *UserUpdateOne) SetAdminID(id int) *UserUpdateOne

SetAdminID sets the "admin" edge to the Admin entity by ID.

func (*UserUpdateOne) SetEmail

func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne

SetEmail sets the "email" field.

func (*UserUpdateOne) SetNickname

func (uuo *UserUpdateOne) SetNickname(s string) *UserUpdateOne

SetNickname sets the "nickname" field.

func (*UserUpdateOne) SetNillableAdminID

func (uuo *UserUpdateOne) SetNillableAdminID(id *int) *UserUpdateOne

SetNillableAdminID sets the "admin" edge to the Admin entity by ID if the given value is not nil.

func (*UserUpdateOne) SetNillableEmail

func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UserUpdateOne) SetUpdateTime

func (uuo *UserUpdateOne) SetUpdateTime(t time.Time) *UserUpdateOne

SetUpdateTime sets the "update_time" field.

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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