ent

package
v0.0.0-...-6a61234 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: MIT Imports: 34 Imported by: 1

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.
	TypeChat         = "Chat"
	TypeCity         = "City"
	TypeComment      = "Comment"
	TypeCountry      = "Country"
	TypeFile         = "File"
	TypeFriend       = "Friend"
	TypeMessage      = "Message"
	TypeNotification = "Notification"
	TypeOtp          = "Otp"
	TypePost         = "Post"
	TypeReaction     = "Reaction"
	TypeRegion       = "Region"
	TypeReply        = "Reply"
	TypeSiteDetail   = "SiteDetail"
	TypeUser         = "User"
)

Variables

View Source
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")

ErrTxStarted is returned when trying to start a new transaction from a transactional client.

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

As is a pseudo aggregation function for renaming another other functions with custom names. For example:

GroupBy(field1, field2).
Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")).
Scan(ctx, &v)

func Count

func Count() AggregateFunc

Count applies the "count" aggregation function on each group.

func Max

func Max(field string) AggregateFunc

Max applies the "max" aggregation function on the given field of each group.

func Mean

func Mean(field string) AggregateFunc

Mean applies the "mean" aggregation function on the given field of each group.

func Min

func Min(field string) AggregateFunc

Min applies the "min" aggregation function on the given field of each group.

func Sum

func Sum(field string) AggregateFunc

Sum applies the "sum" aggregation function on the given field of each group.

type Chat

type Chat struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Name holds the value of the "name" field.
	Name *string `json:"name,omitempty"`
	// Ctype holds the value of the "ctype" field.
	Ctype chat.Ctype `json:"ctype,omitempty"`
	// Description holds the value of the "description" field.
	Description *string `json:"description,omitempty"`
	// OwnerID holds the value of the "owner_id" field.
	OwnerID uuid.UUID `json:"owner_id,omitempty"`
	// ImageID holds the value of the "image_id" field.
	ImageID *uuid.UUID `json:"image_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ChatQuery when eager-loading is set.
	Edges ChatEdges `json:"edges"`
	// contains filtered or unexported fields
}

Chat is the model entity for the Chat schema.

func (*Chat) QueryImage

func (c *Chat) QueryImage() *FileQuery

QueryImage queries the "image" edge of the Chat entity.

func (*Chat) QueryMessages

func (c *Chat) QueryMessages() *MessageQuery

QueryMessages queries the "messages" edge of the Chat entity.

func (*Chat) QueryOwner

func (c *Chat) QueryOwner() *UserQuery

QueryOwner queries the "owner" edge of the Chat entity.

func (*Chat) QueryUsers

func (c *Chat) QueryUsers() *UserQuery

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

func (*Chat) String

func (c *Chat) String() string

String implements the fmt.Stringer.

func (*Chat) Unwrap

func (c *Chat) Unwrap() *Chat

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

func (c *Chat) Update() *ChatUpdateOne

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

func (*Chat) Value

func (c *Chat) Value(name string) (ent.Value, error)

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

type ChatClient

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

ChatClient is a client for the Chat schema.

func NewChatClient

func NewChatClient(c config) *ChatClient

NewChatClient returns a client for the Chat from the given config.

func (*ChatClient) Create

func (c *ChatClient) Create() *ChatCreate

Create returns a builder for creating a Chat entity.

func (*ChatClient) CreateBulk

func (c *ChatClient) CreateBulk(builders ...*ChatCreate) *ChatCreateBulk

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

func (*ChatClient) Delete

func (c *ChatClient) Delete() *ChatDelete

Delete returns a delete builder for Chat.

func (*ChatClient) DeleteOne

func (c *ChatClient) DeleteOne(ch *Chat) *ChatDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ChatClient) DeleteOneID

func (c *ChatClient) DeleteOneID(id uuid.UUID) *ChatDeleteOne

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

func (*ChatClient) Get

func (c *ChatClient) Get(ctx context.Context, id uuid.UUID) (*Chat, error)

Get returns a Chat entity by its id.

func (*ChatClient) GetX

func (c *ChatClient) GetX(ctx context.Context, id uuid.UUID) *Chat

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

func (*ChatClient) Hooks

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

Hooks returns the client hooks.

func (*ChatClient) Intercept

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

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

func (*ChatClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ChatClient) MapCreateBulk

func (c *ChatClient) MapCreateBulk(slice any, setFunc func(*ChatCreate, int)) *ChatCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*ChatClient) Query

func (c *ChatClient) Query() *ChatQuery

Query returns a query builder for Chat.

func (*ChatClient) QueryImage

func (c *ChatClient) QueryImage(ch *Chat) *FileQuery

QueryImage queries the image edge of a Chat.

func (*ChatClient) QueryMessages

func (c *ChatClient) QueryMessages(ch *Chat) *MessageQuery

QueryMessages queries the messages edge of a Chat.

func (*ChatClient) QueryOwner

func (c *ChatClient) QueryOwner(ch *Chat) *UserQuery

QueryOwner queries the owner edge of a Chat.

func (*ChatClient) QueryUsers

func (c *ChatClient) QueryUsers(ch *Chat) *UserQuery

QueryUsers queries the users edge of a Chat.

func (*ChatClient) Update

func (c *ChatClient) Update() *ChatUpdate

Update returns an update builder for Chat.

func (*ChatClient) UpdateOne

func (c *ChatClient) UpdateOne(ch *Chat) *ChatUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ChatClient) UpdateOneID

func (c *ChatClient) UpdateOneID(id uuid.UUID) *ChatUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ChatClient) Use

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

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

type ChatCreate

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

ChatCreate is the builder for creating a Chat entity.

func (*ChatCreate) AddMessageIDs

func (cc *ChatCreate) AddMessageIDs(ids ...uuid.UUID) *ChatCreate

AddMessageIDs adds the "messages" edge to the Message entity by IDs.

func (*ChatCreate) AddMessages

func (cc *ChatCreate) AddMessages(m ...*Message) *ChatCreate

AddMessages adds the "messages" edges to the Message entity.

func (*ChatCreate) AddUserIDs

func (cc *ChatCreate) AddUserIDs(ids ...uuid.UUID) *ChatCreate

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

func (*ChatCreate) AddUsers

func (cc *ChatCreate) AddUsers(u ...*User) *ChatCreate

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

func (*ChatCreate) Exec

func (cc *ChatCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ChatCreate) ExecX

func (cc *ChatCreate) ExecX(ctx context.Context)

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

func (*ChatCreate) Mutation

func (cc *ChatCreate) Mutation() *ChatMutation

Mutation returns the ChatMutation object of the builder.

func (*ChatCreate) Save

func (cc *ChatCreate) Save(ctx context.Context) (*Chat, error)

Save creates the Chat in the database.

func (*ChatCreate) SaveX

func (cc *ChatCreate) SaveX(ctx context.Context) *Chat

SaveX calls Save and panics if Save returns an error.

func (*ChatCreate) SetCreatedAt

func (cc *ChatCreate) SetCreatedAt(t time.Time) *ChatCreate

SetCreatedAt sets the "created_at" field.

func (*ChatCreate) SetCtype

func (cc *ChatCreate) SetCtype(c chat.Ctype) *ChatCreate

SetCtype sets the "ctype" field.

func (*ChatCreate) SetDescription

func (cc *ChatCreate) SetDescription(s string) *ChatCreate

SetDescription sets the "description" field.

func (*ChatCreate) SetID

func (cc *ChatCreate) SetID(u uuid.UUID) *ChatCreate

SetID sets the "id" field.

func (*ChatCreate) SetImage

func (cc *ChatCreate) SetImage(f *File) *ChatCreate

SetImage sets the "image" edge to the File entity.

func (*ChatCreate) SetImageID

func (cc *ChatCreate) SetImageID(u uuid.UUID) *ChatCreate

SetImageID sets the "image_id" field.

func (*ChatCreate) SetName

func (cc *ChatCreate) SetName(s string) *ChatCreate

SetName sets the "name" field.

func (*ChatCreate) SetNillableCreatedAt

func (cc *ChatCreate) SetNillableCreatedAt(t *time.Time) *ChatCreate

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

func (*ChatCreate) SetNillableDescription

func (cc *ChatCreate) SetNillableDescription(s *string) *ChatCreate

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

func (*ChatCreate) SetNillableID

func (cc *ChatCreate) SetNillableID(u *uuid.UUID) *ChatCreate

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

func (*ChatCreate) SetNillableImageID

func (cc *ChatCreate) SetNillableImageID(u *uuid.UUID) *ChatCreate

SetNillableImageID sets the "image_id" field if the given value is not nil.

func (*ChatCreate) SetNillableName

func (cc *ChatCreate) SetNillableName(s *string) *ChatCreate

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

func (*ChatCreate) SetNillableUpdatedAt

func (cc *ChatCreate) SetNillableUpdatedAt(t *time.Time) *ChatCreate

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

func (*ChatCreate) SetOwner

func (cc *ChatCreate) SetOwner(u *User) *ChatCreate

SetOwner sets the "owner" edge to the User entity.

func (*ChatCreate) SetOwnerID

func (cc *ChatCreate) SetOwnerID(u uuid.UUID) *ChatCreate

SetOwnerID sets the "owner_id" field.

func (*ChatCreate) SetUpdatedAt

func (cc *ChatCreate) SetUpdatedAt(t time.Time) *ChatCreate

SetUpdatedAt sets the "updated_at" field.

type ChatCreateBulk

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

ChatCreateBulk is the builder for creating many Chat entities in bulk.

func (*ChatCreateBulk) Exec

func (ccb *ChatCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ChatCreateBulk) ExecX

func (ccb *ChatCreateBulk) ExecX(ctx context.Context)

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

func (*ChatCreateBulk) Save

func (ccb *ChatCreateBulk) Save(ctx context.Context) ([]*Chat, error)

Save creates the Chat entities in the database.

func (*ChatCreateBulk) SaveX

func (ccb *ChatCreateBulk) SaveX(ctx context.Context) []*Chat

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

type ChatDelete

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

ChatDelete is the builder for deleting a Chat entity.

func (*ChatDelete) Exec

func (cd *ChatDelete) Exec(ctx context.Context) (int, error)

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

func (*ChatDelete) ExecX

func (cd *ChatDelete) ExecX(ctx context.Context) int

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

func (*ChatDelete) Where

func (cd *ChatDelete) Where(ps ...predicate.Chat) *ChatDelete

Where appends a list predicates to the ChatDelete builder.

type ChatDeleteOne

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

ChatDeleteOne is the builder for deleting a single Chat entity.

func (*ChatDeleteOne) Exec

func (cdo *ChatDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ChatDeleteOne) ExecX

func (cdo *ChatDeleteOne) ExecX(ctx context.Context)

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

func (*ChatDeleteOne) Where

func (cdo *ChatDeleteOne) Where(ps ...predicate.Chat) *ChatDeleteOne

Where appends a list predicates to the ChatDelete builder.

type ChatEdges

type ChatEdges struct {
	// Owner holds the value of the owner edge.
	Owner *User `json:"owner,omitempty"`
	// Image holds the value of the image edge.
	Image *File `json:"image,omitempty"`
	// Users holds the value of the users edge.
	Users []*User `json:"users,omitempty"`
	// Messages holds the value of the messages edge.
	Messages []*Message `json:"messages,omitempty"`
	// contains filtered or unexported fields
}

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

func (ChatEdges) ImageOrErr

func (e ChatEdges) ImageOrErr() (*File, error)

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

func (ChatEdges) MessagesOrErr

func (e ChatEdges) MessagesOrErr() ([]*Message, error)

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

func (ChatEdges) OwnerOrErr

func (e ChatEdges) OwnerOrErr() (*User, error)

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

func (ChatEdges) UsersOrErr

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

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

type ChatGroupBy

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

ChatGroupBy is the group-by builder for Chat entities.

func (*ChatGroupBy) Aggregate

func (cgb *ChatGroupBy) Aggregate(fns ...AggregateFunc) *ChatGroupBy

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

func (*ChatGroupBy) Bool

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

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

func (*ChatGroupBy) BoolX

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

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

func (*ChatGroupBy) Bools

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

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

func (*ChatGroupBy) BoolsX

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

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

func (*ChatGroupBy) Float64

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

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

func (*ChatGroupBy) Float64X

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

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

func (*ChatGroupBy) Float64s

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

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

func (*ChatGroupBy) Float64sX

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

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

func (*ChatGroupBy) Int

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

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

func (*ChatGroupBy) IntX

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

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

func (*ChatGroupBy) Ints

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

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

func (*ChatGroupBy) IntsX

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

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

func (*ChatGroupBy) Scan

func (cgb *ChatGroupBy) Scan(ctx context.Context, v any) error

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

func (*ChatGroupBy) ScanX

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

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

func (*ChatGroupBy) String

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

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

func (*ChatGroupBy) StringX

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

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

func (*ChatGroupBy) Strings

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

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

func (*ChatGroupBy) StringsX

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

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

type ChatMutation

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

ChatMutation represents an operation that mutates the Chat nodes in the graph.

func (*ChatMutation) AddField

func (m *ChatMutation) 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 (*ChatMutation) AddMessageIDs

func (m *ChatMutation) AddMessageIDs(ids ...uuid.UUID)

AddMessageIDs adds the "messages" edge to the Message entity by ids.

func (*ChatMutation) AddUserIDs

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

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

func (*ChatMutation) AddedEdges

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

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

func (*ChatMutation) AddedField

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

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

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

func (*ChatMutation) AddedIDs

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

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

func (*ChatMutation) ClearDescription

func (m *ChatMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*ChatMutation) ClearEdge

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

func (m *ChatMutation) 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 (*ChatMutation) ClearImage

func (m *ChatMutation) ClearImage()

ClearImage clears the "image" edge to the File entity.

func (*ChatMutation) ClearImageID

func (m *ChatMutation) ClearImageID()

ClearImageID clears the value of the "image_id" field.

func (*ChatMutation) ClearMessages

func (m *ChatMutation) ClearMessages()

ClearMessages clears the "messages" edge to the Message entity.

func (*ChatMutation) ClearName

func (m *ChatMutation) ClearName()

ClearName clears the value of the "name" field.

func (*ChatMutation) ClearOwner

func (m *ChatMutation) ClearOwner()

ClearOwner clears the "owner" edge to the User entity.

func (*ChatMutation) ClearUsers

func (m *ChatMutation) ClearUsers()

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

func (*ChatMutation) ClearedEdges

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

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

func (*ChatMutation) ClearedFields

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

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

func (ChatMutation) Client

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

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

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

func (*ChatMutation) Ctype

func (m *ChatMutation) Ctype() (r chat.Ctype, exists bool)

Ctype returns the value of the "ctype" field in the mutation.

func (*ChatMutation) Description

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

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

func (*ChatMutation) DescriptionCleared

func (m *ChatMutation) DescriptionCleared() bool

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

func (*ChatMutation) EdgeCleared

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

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

func (*ChatMutation) Field

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

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

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

func (*ChatMutation) Fields

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

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

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

func (*ChatMutation) IDs

func (m *ChatMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*ChatMutation) ImageCleared

func (m *ChatMutation) ImageCleared() bool

ImageCleared reports if the "image" edge to the File entity was cleared.

func (*ChatMutation) ImageID

func (m *ChatMutation) ImageID() (r uuid.UUID, exists bool)

ImageID returns the value of the "image_id" field in the mutation.

func (*ChatMutation) ImageIDCleared

func (m *ChatMutation) ImageIDCleared() bool

ImageIDCleared returns if the "image_id" field was cleared in this mutation.

func (*ChatMutation) ImageIDs

func (m *ChatMutation) ImageIDs() (ids []uuid.UUID)

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

func (*ChatMutation) MessagesCleared

func (m *ChatMutation) MessagesCleared() bool

MessagesCleared reports if the "messages" edge to the Message entity was cleared.

func (*ChatMutation) MessagesIDs

func (m *ChatMutation) MessagesIDs() (ids []uuid.UUID)

MessagesIDs returns the "messages" edge IDs in the mutation.

func (*ChatMutation) Name

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

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

func (*ChatMutation) NameCleared

func (m *ChatMutation) NameCleared() bool

NameCleared returns if the "name" field was cleared in this mutation.

func (*ChatMutation) OldCreatedAt

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

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

func (m *ChatMutation) OldCtype(ctx context.Context) (v chat.Ctype, err error)

OldCtype returns the old "ctype" field's value of the Chat entity. If the Chat 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 (*ChatMutation) OldDescription

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

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

func (m *ChatMutation) 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 (*ChatMutation) OldImageID

func (m *ChatMutation) OldImageID(ctx context.Context) (v *uuid.UUID, err error)

OldImageID returns the old "image_id" field's value of the Chat entity. If the Chat 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 (*ChatMutation) OldName

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

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

func (m *ChatMutation) OldOwnerID(ctx context.Context) (v uuid.UUID, err error)

OldOwnerID returns the old "owner_id" field's value of the Chat entity. If the Chat 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 (*ChatMutation) OldUpdatedAt

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

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

func (m *ChatMutation) Op() Op

Op returns the operation name.

func (*ChatMutation) OwnerCleared

func (m *ChatMutation) OwnerCleared() bool

OwnerCleared reports if the "owner" edge to the User entity was cleared.

func (*ChatMutation) OwnerID

func (m *ChatMutation) OwnerID() (r uuid.UUID, exists bool)

OwnerID returns the value of the "owner_id" field in the mutation.

func (*ChatMutation) OwnerIDs

func (m *ChatMutation) OwnerIDs() (ids []uuid.UUID)

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

func (*ChatMutation) RemoveMessageIDs

func (m *ChatMutation) RemoveMessageIDs(ids ...uuid.UUID)

RemoveMessageIDs removes the "messages" edge to the Message entity by IDs.

func (*ChatMutation) RemoveUserIDs

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

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

func (*ChatMutation) RemovedEdges

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

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

func (*ChatMutation) RemovedIDs

func (m *ChatMutation) 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 (*ChatMutation) RemovedMessagesIDs

func (m *ChatMutation) RemovedMessagesIDs() (ids []uuid.UUID)

RemovedMessages returns the removed IDs of the "messages" edge to the Message entity.

func (*ChatMutation) RemovedUsersIDs

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

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

func (*ChatMutation) ResetCreatedAt

func (m *ChatMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ChatMutation) ResetCtype

func (m *ChatMutation) ResetCtype()

ResetCtype resets all changes to the "ctype" field.

func (*ChatMutation) ResetDescription

func (m *ChatMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*ChatMutation) ResetEdge

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

func (m *ChatMutation) 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 (*ChatMutation) ResetImage

func (m *ChatMutation) ResetImage()

ResetImage resets all changes to the "image" edge.

func (*ChatMutation) ResetImageID

func (m *ChatMutation) ResetImageID()

ResetImageID resets all changes to the "image_id" field.

func (*ChatMutation) ResetMessages

func (m *ChatMutation) ResetMessages()

ResetMessages resets all changes to the "messages" edge.

func (*ChatMutation) ResetName

func (m *ChatMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ChatMutation) ResetOwner

func (m *ChatMutation) ResetOwner()

ResetOwner resets all changes to the "owner" edge.

func (*ChatMutation) ResetOwnerID

func (m *ChatMutation) ResetOwnerID()

ResetOwnerID resets all changes to the "owner_id" field.

func (*ChatMutation) ResetUpdatedAt

func (m *ChatMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ChatMutation) ResetUsers

func (m *ChatMutation) ResetUsers()

ResetUsers resets all changes to the "users" edge.

func (*ChatMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*ChatMutation) SetCtype

func (m *ChatMutation) SetCtype(c chat.Ctype)

SetCtype sets the "ctype" field.

func (*ChatMutation) SetDescription

func (m *ChatMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*ChatMutation) SetField

func (m *ChatMutation) 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 (*ChatMutation) SetID

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

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

func (*ChatMutation) SetImageID

func (m *ChatMutation) SetImageID(u uuid.UUID)

SetImageID sets the "image_id" field.

func (*ChatMutation) SetName

func (m *ChatMutation) SetName(s string)

SetName sets the "name" field.

func (*ChatMutation) SetOp

func (m *ChatMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ChatMutation) SetOwnerID

func (m *ChatMutation) SetOwnerID(u uuid.UUID)

SetOwnerID sets the "owner_id" field.

func (*ChatMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (ChatMutation) Tx

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

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

func (*ChatMutation) Type

func (m *ChatMutation) Type() string

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

func (*ChatMutation) UpdatedAt

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

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

func (*ChatMutation) UsersCleared

func (m *ChatMutation) UsersCleared() bool

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

func (*ChatMutation) UsersIDs

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

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

func (*ChatMutation) Where

func (m *ChatMutation) Where(ps ...predicate.Chat)

Where appends a list predicates to the ChatMutation builder.

func (*ChatMutation) WhereP

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

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

type ChatQuery

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

ChatQuery is the builder for querying Chat entities.

func (*ChatQuery) Aggregate

func (cq *ChatQuery) Aggregate(fns ...AggregateFunc) *ChatSelect

Aggregate returns a ChatSelect configured with the given aggregations.

func (*ChatQuery) All

func (cq *ChatQuery) All(ctx context.Context) ([]*Chat, error)

All executes the query and returns a list of Chats.

func (*ChatQuery) AllX

func (cq *ChatQuery) AllX(ctx context.Context) []*Chat

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

func (*ChatQuery) Clone

func (cq *ChatQuery) Clone() *ChatQuery

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

func (*ChatQuery) Count

func (cq *ChatQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ChatQuery) CountX

func (cq *ChatQuery) CountX(ctx context.Context) int

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

func (*ChatQuery) Exist

func (cq *ChatQuery) Exist(ctx context.Context) (bool, error)

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

func (*ChatQuery) ExistX

func (cq *ChatQuery) ExistX(ctx context.Context) bool

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

func (*ChatQuery) First

func (cq *ChatQuery) First(ctx context.Context) (*Chat, error)

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

func (*ChatQuery) FirstID

func (cq *ChatQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ChatQuery) FirstIDX

func (cq *ChatQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*ChatQuery) FirstX

func (cq *ChatQuery) FirstX(ctx context.Context) *Chat

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

func (*ChatQuery) GroupBy

func (cq *ChatQuery) GroupBy(field string, fields ...string) *ChatGroupBy

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

Example:

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

client.Chat.Query().
	GroupBy(chat.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ChatQuery) IDs

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

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

func (*ChatQuery) IDsX

func (cq *ChatQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*ChatQuery) Limit

func (cq *ChatQuery) Limit(limit int) *ChatQuery

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

func (*ChatQuery) Offset

func (cq *ChatQuery) Offset(offset int) *ChatQuery

Offset to start from.

func (*ChatQuery) Only

func (cq *ChatQuery) Only(ctx context.Context) (*Chat, error)

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

func (*ChatQuery) OnlyID

func (cq *ChatQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*ChatQuery) OnlyIDX

func (cq *ChatQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*ChatQuery) OnlyX

func (cq *ChatQuery) OnlyX(ctx context.Context) *Chat

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

func (*ChatQuery) Order

func (cq *ChatQuery) Order(o ...chat.OrderOption) *ChatQuery

Order specifies how the records should be ordered.

func (*ChatQuery) QueryImage

func (cq *ChatQuery) QueryImage() *FileQuery

QueryImage chains the current query on the "image" edge.

func (*ChatQuery) QueryMessages

func (cq *ChatQuery) QueryMessages() *MessageQuery

QueryMessages chains the current query on the "messages" edge.

func (*ChatQuery) QueryOwner

func (cq *ChatQuery) QueryOwner() *UserQuery

QueryOwner chains the current query on the "owner" edge.

func (*ChatQuery) QueryUsers

func (cq *ChatQuery) QueryUsers() *UserQuery

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

func (*ChatQuery) Select

func (cq *ChatQuery) Select(fields ...string) *ChatSelect

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

Example:

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

client.Chat.Query().
	Select(chat.FieldCreatedAt).
	Scan(ctx, &v)

func (*ChatQuery) Unique

func (cq *ChatQuery) Unique(unique bool) *ChatQuery

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

func (cq *ChatQuery) Where(ps ...predicate.Chat) *ChatQuery

Where adds a new predicate for the ChatQuery builder.

func (*ChatQuery) WithImage

func (cq *ChatQuery) WithImage(opts ...func(*FileQuery)) *ChatQuery

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

func (*ChatQuery) WithMessages

func (cq *ChatQuery) WithMessages(opts ...func(*MessageQuery)) *ChatQuery

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

func (*ChatQuery) WithOwner

func (cq *ChatQuery) WithOwner(opts ...func(*UserQuery)) *ChatQuery

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

func (*ChatQuery) WithUsers

func (cq *ChatQuery) WithUsers(opts ...func(*UserQuery)) *ChatQuery

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

type ChatSelect

type ChatSelect struct {
	*ChatQuery
	// contains filtered or unexported fields
}

ChatSelect is the builder for selecting fields of Chat entities.

func (*ChatSelect) Aggregate

func (cs *ChatSelect) Aggregate(fns ...AggregateFunc) *ChatSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ChatSelect) Bool

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

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

func (*ChatSelect) BoolX

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

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

func (*ChatSelect) Bools

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

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

func (*ChatSelect) BoolsX

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

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

func (*ChatSelect) Float64

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

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

func (*ChatSelect) Float64X

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

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

func (*ChatSelect) Float64s

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

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

func (*ChatSelect) Float64sX

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

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

func (*ChatSelect) Int

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

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

func (*ChatSelect) IntX

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

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

func (*ChatSelect) Ints

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

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

func (*ChatSelect) IntsX

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

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

func (*ChatSelect) Scan

func (cs *ChatSelect) Scan(ctx context.Context, v any) error

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

func (*ChatSelect) ScanX

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

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

func (*ChatSelect) String

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

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

func (*ChatSelect) StringX

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

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

func (*ChatSelect) Strings

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

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

func (*ChatSelect) StringsX

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

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

type ChatUpdate

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

ChatUpdate is the builder for updating Chat entities.

func (*ChatUpdate) AddMessageIDs

func (cu *ChatUpdate) AddMessageIDs(ids ...uuid.UUID) *ChatUpdate

AddMessageIDs adds the "messages" edge to the Message entity by IDs.

func (*ChatUpdate) AddMessages

func (cu *ChatUpdate) AddMessages(m ...*Message) *ChatUpdate

AddMessages adds the "messages" edges to the Message entity.

func (*ChatUpdate) AddUserIDs

func (cu *ChatUpdate) AddUserIDs(ids ...uuid.UUID) *ChatUpdate

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

func (*ChatUpdate) AddUsers

func (cu *ChatUpdate) AddUsers(u ...*User) *ChatUpdate

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

func (*ChatUpdate) ClearDescription

func (cu *ChatUpdate) ClearDescription() *ChatUpdate

ClearDescription clears the value of the "description" field.

func (*ChatUpdate) ClearImage

func (cu *ChatUpdate) ClearImage() *ChatUpdate

ClearImage clears the "image" edge to the File entity.

func (*ChatUpdate) ClearImageID

func (cu *ChatUpdate) ClearImageID() *ChatUpdate

ClearImageID clears the value of the "image_id" field.

func (*ChatUpdate) ClearMessages

func (cu *ChatUpdate) ClearMessages() *ChatUpdate

ClearMessages clears all "messages" edges to the Message entity.

func (*ChatUpdate) ClearName

func (cu *ChatUpdate) ClearName() *ChatUpdate

ClearName clears the value of the "name" field.

func (*ChatUpdate) ClearOwner

func (cu *ChatUpdate) ClearOwner() *ChatUpdate

ClearOwner clears the "owner" edge to the User entity.

func (*ChatUpdate) ClearUsers

func (cu *ChatUpdate) ClearUsers() *ChatUpdate

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

func (*ChatUpdate) Exec

func (cu *ChatUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ChatUpdate) ExecX

func (cu *ChatUpdate) ExecX(ctx context.Context)

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

func (*ChatUpdate) Mutation

func (cu *ChatUpdate) Mutation() *ChatMutation

Mutation returns the ChatMutation object of the builder.

func (*ChatUpdate) RemoveMessageIDs

func (cu *ChatUpdate) RemoveMessageIDs(ids ...uuid.UUID) *ChatUpdate

RemoveMessageIDs removes the "messages" edge to Message entities by IDs.

func (*ChatUpdate) RemoveMessages

func (cu *ChatUpdate) RemoveMessages(m ...*Message) *ChatUpdate

RemoveMessages removes "messages" edges to Message entities.

func (*ChatUpdate) RemoveUserIDs

func (cu *ChatUpdate) RemoveUserIDs(ids ...uuid.UUID) *ChatUpdate

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

func (*ChatUpdate) RemoveUsers

func (cu *ChatUpdate) RemoveUsers(u ...*User) *ChatUpdate

RemoveUsers removes "users" edges to User entities.

func (*ChatUpdate) Save

func (cu *ChatUpdate) Save(ctx context.Context) (int, error)

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

func (*ChatUpdate) SaveX

func (cu *ChatUpdate) SaveX(ctx context.Context) int

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

func (*ChatUpdate) SetCreatedAt

func (cu *ChatUpdate) SetCreatedAt(t time.Time) *ChatUpdate

SetCreatedAt sets the "created_at" field.

func (*ChatUpdate) SetCtype

func (cu *ChatUpdate) SetCtype(c chat.Ctype) *ChatUpdate

SetCtype sets the "ctype" field.

func (*ChatUpdate) SetDescription

func (cu *ChatUpdate) SetDescription(s string) *ChatUpdate

SetDescription sets the "description" field.

func (*ChatUpdate) SetImage

func (cu *ChatUpdate) SetImage(f *File) *ChatUpdate

SetImage sets the "image" edge to the File entity.

func (*ChatUpdate) SetImageID

func (cu *ChatUpdate) SetImageID(u uuid.UUID) *ChatUpdate

SetImageID sets the "image_id" field.

func (*ChatUpdate) SetName

func (cu *ChatUpdate) SetName(s string) *ChatUpdate

SetName sets the "name" field.

func (*ChatUpdate) SetNillableCreatedAt

func (cu *ChatUpdate) SetNillableCreatedAt(t *time.Time) *ChatUpdate

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

func (*ChatUpdate) SetNillableCtype

func (cu *ChatUpdate) SetNillableCtype(c *chat.Ctype) *ChatUpdate

SetNillableCtype sets the "ctype" field if the given value is not nil.

func (*ChatUpdate) SetNillableDescription

func (cu *ChatUpdate) SetNillableDescription(s *string) *ChatUpdate

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

func (*ChatUpdate) SetNillableImageID

func (cu *ChatUpdate) SetNillableImageID(u *uuid.UUID) *ChatUpdate

SetNillableImageID sets the "image_id" field if the given value is not nil.

func (*ChatUpdate) SetNillableName

func (cu *ChatUpdate) SetNillableName(s *string) *ChatUpdate

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

func (*ChatUpdate) SetNillableOwnerID

func (cu *ChatUpdate) SetNillableOwnerID(u *uuid.UUID) *ChatUpdate

SetNillableOwnerID sets the "owner_id" field if the given value is not nil.

func (*ChatUpdate) SetOwner

func (cu *ChatUpdate) SetOwner(u *User) *ChatUpdate

SetOwner sets the "owner" edge to the User entity.

func (*ChatUpdate) SetOwnerID

func (cu *ChatUpdate) SetOwnerID(u uuid.UUID) *ChatUpdate

SetOwnerID sets the "owner_id" field.

func (*ChatUpdate) SetUpdatedAt

func (cu *ChatUpdate) SetUpdatedAt(t time.Time) *ChatUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ChatUpdate) Where

func (cu *ChatUpdate) Where(ps ...predicate.Chat) *ChatUpdate

Where appends a list predicates to the ChatUpdate builder.

type ChatUpdateOne

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

ChatUpdateOne is the builder for updating a single Chat entity.

func (*ChatUpdateOne) AddMessageIDs

func (cuo *ChatUpdateOne) AddMessageIDs(ids ...uuid.UUID) *ChatUpdateOne

AddMessageIDs adds the "messages" edge to the Message entity by IDs.

func (*ChatUpdateOne) AddMessages

func (cuo *ChatUpdateOne) AddMessages(m ...*Message) *ChatUpdateOne

AddMessages adds the "messages" edges to the Message entity.

func (*ChatUpdateOne) AddUserIDs

func (cuo *ChatUpdateOne) AddUserIDs(ids ...uuid.UUID) *ChatUpdateOne

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

func (*ChatUpdateOne) AddUsers

func (cuo *ChatUpdateOne) AddUsers(u ...*User) *ChatUpdateOne

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

func (*ChatUpdateOne) ClearDescription

func (cuo *ChatUpdateOne) ClearDescription() *ChatUpdateOne

ClearDescription clears the value of the "description" field.

func (*ChatUpdateOne) ClearImage

func (cuo *ChatUpdateOne) ClearImage() *ChatUpdateOne

ClearImage clears the "image" edge to the File entity.

func (*ChatUpdateOne) ClearImageID

func (cuo *ChatUpdateOne) ClearImageID() *ChatUpdateOne

ClearImageID clears the value of the "image_id" field.

func (*ChatUpdateOne) ClearMessages

func (cuo *ChatUpdateOne) ClearMessages() *ChatUpdateOne

ClearMessages clears all "messages" edges to the Message entity.

func (*ChatUpdateOne) ClearName

func (cuo *ChatUpdateOne) ClearName() *ChatUpdateOne

ClearName clears the value of the "name" field.

func (*ChatUpdateOne) ClearOwner

func (cuo *ChatUpdateOne) ClearOwner() *ChatUpdateOne

ClearOwner clears the "owner" edge to the User entity.

func (*ChatUpdateOne) ClearUsers

func (cuo *ChatUpdateOne) ClearUsers() *ChatUpdateOne

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

func (*ChatUpdateOne) Exec

func (cuo *ChatUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ChatUpdateOne) ExecX

func (cuo *ChatUpdateOne) ExecX(ctx context.Context)

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

func (*ChatUpdateOne) Mutation

func (cuo *ChatUpdateOne) Mutation() *ChatMutation

Mutation returns the ChatMutation object of the builder.

func (*ChatUpdateOne) RemoveMessageIDs

func (cuo *ChatUpdateOne) RemoveMessageIDs(ids ...uuid.UUID) *ChatUpdateOne

RemoveMessageIDs removes the "messages" edge to Message entities by IDs.

func (*ChatUpdateOne) RemoveMessages

func (cuo *ChatUpdateOne) RemoveMessages(m ...*Message) *ChatUpdateOne

RemoveMessages removes "messages" edges to Message entities.

func (*ChatUpdateOne) RemoveUserIDs

func (cuo *ChatUpdateOne) RemoveUserIDs(ids ...uuid.UUID) *ChatUpdateOne

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

func (*ChatUpdateOne) RemoveUsers

func (cuo *ChatUpdateOne) RemoveUsers(u ...*User) *ChatUpdateOne

RemoveUsers removes "users" edges to User entities.

func (*ChatUpdateOne) Save

func (cuo *ChatUpdateOne) Save(ctx context.Context) (*Chat, error)

Save executes the query and returns the updated Chat entity.

func (*ChatUpdateOne) SaveX

func (cuo *ChatUpdateOne) SaveX(ctx context.Context) *Chat

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

func (*ChatUpdateOne) Select

func (cuo *ChatUpdateOne) Select(field string, fields ...string) *ChatUpdateOne

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

func (*ChatUpdateOne) SetCreatedAt

func (cuo *ChatUpdateOne) SetCreatedAt(t time.Time) *ChatUpdateOne

SetCreatedAt sets the "created_at" field.

func (*ChatUpdateOne) SetCtype

func (cuo *ChatUpdateOne) SetCtype(c chat.Ctype) *ChatUpdateOne

SetCtype sets the "ctype" field.

func (*ChatUpdateOne) SetDescription

func (cuo *ChatUpdateOne) SetDescription(s string) *ChatUpdateOne

SetDescription sets the "description" field.

func (*ChatUpdateOne) SetImage

func (cuo *ChatUpdateOne) SetImage(f *File) *ChatUpdateOne

SetImage sets the "image" edge to the File entity.

func (*ChatUpdateOne) SetImageID

func (cuo *ChatUpdateOne) SetImageID(u uuid.UUID) *ChatUpdateOne

SetImageID sets the "image_id" field.

func (*ChatUpdateOne) SetName

func (cuo *ChatUpdateOne) SetName(s string) *ChatUpdateOne

SetName sets the "name" field.

func (*ChatUpdateOne) SetNillableCreatedAt

func (cuo *ChatUpdateOne) SetNillableCreatedAt(t *time.Time) *ChatUpdateOne

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

func (*ChatUpdateOne) SetNillableCtype

func (cuo *ChatUpdateOne) SetNillableCtype(c *chat.Ctype) *ChatUpdateOne

SetNillableCtype sets the "ctype" field if the given value is not nil.

func (*ChatUpdateOne) SetNillableDescription

func (cuo *ChatUpdateOne) SetNillableDescription(s *string) *ChatUpdateOne

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

func (*ChatUpdateOne) SetNillableImageID

func (cuo *ChatUpdateOne) SetNillableImageID(u *uuid.UUID) *ChatUpdateOne

SetNillableImageID sets the "image_id" field if the given value is not nil.

func (*ChatUpdateOne) SetNillableName

func (cuo *ChatUpdateOne) SetNillableName(s *string) *ChatUpdateOne

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

func (*ChatUpdateOne) SetNillableOwnerID

func (cuo *ChatUpdateOne) SetNillableOwnerID(u *uuid.UUID) *ChatUpdateOne

SetNillableOwnerID sets the "owner_id" field if the given value is not nil.

func (*ChatUpdateOne) SetOwner

func (cuo *ChatUpdateOne) SetOwner(u *User) *ChatUpdateOne

SetOwner sets the "owner" edge to the User entity.

func (*ChatUpdateOne) SetOwnerID

func (cuo *ChatUpdateOne) SetOwnerID(u uuid.UUID) *ChatUpdateOne

SetOwnerID sets the "owner_id" field.

func (*ChatUpdateOne) SetUpdatedAt

func (cuo *ChatUpdateOne) SetUpdatedAt(t time.Time) *ChatUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ChatUpdateOne) Where

func (cuo *ChatUpdateOne) Where(ps ...predicate.Chat) *ChatUpdateOne

Where appends a list predicates to the ChatUpdate builder.

type Chats

type Chats []*Chat

Chats is a parsable slice of Chat.

type Cities

type Cities []*City

Cities is a parsable slice of City.

type City

type City struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// RegionID holds the value of the "region_id" field.
	RegionID *uuid.UUID `json:"region_id,omitempty"`
	// CountryID holds the value of the "country_id" field.
	CountryID uuid.UUID `json:"country_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the CityQuery when eager-loading is set.
	Edges CityEdges `json:"edges"`
	// contains filtered or unexported fields
}

City is the model entity for the City schema.

func (*City) QueryCountry

func (c *City) QueryCountry() *CountryQuery

QueryCountry queries the "country" edge of the City entity.

func (*City) QueryRegion

func (c *City) QueryRegion() *RegionQuery

QueryRegion queries the "region" edge of the City entity.

func (*City) QueryUsers

func (c *City) QueryUsers() *UserQuery

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

func (*City) String

func (c *City) String() string

String implements the fmt.Stringer.

func (*City) Unwrap

func (c *City) Unwrap() *City

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

func (c *City) Update() *CityUpdateOne

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

func (*City) Value

func (c *City) Value(name string) (ent.Value, error)

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

type CityClient

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

CityClient is a client for the City schema.

func NewCityClient

func NewCityClient(c config) *CityClient

NewCityClient returns a client for the City from the given config.

func (*CityClient) Create

func (c *CityClient) Create() *CityCreate

Create returns a builder for creating a City entity.

func (*CityClient) CreateBulk

func (c *CityClient) CreateBulk(builders ...*CityCreate) *CityCreateBulk

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

func (*CityClient) Delete

func (c *CityClient) Delete() *CityDelete

Delete returns a delete builder for City.

func (*CityClient) DeleteOne

func (c *CityClient) DeleteOne(ci *City) *CityDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CityClient) DeleteOneID

func (c *CityClient) DeleteOneID(id uuid.UUID) *CityDeleteOne

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

func (*CityClient) Get

func (c *CityClient) Get(ctx context.Context, id uuid.UUID) (*City, error)

Get returns a City entity by its id.

func (*CityClient) GetX

func (c *CityClient) GetX(ctx context.Context, id uuid.UUID) *City

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

func (*CityClient) Hooks

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

Hooks returns the client hooks.

func (*CityClient) Intercept

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

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

func (*CityClient) Interceptors

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

Interceptors returns the client interceptors.

func (*CityClient) MapCreateBulk

func (c *CityClient) MapCreateBulk(slice any, setFunc func(*CityCreate, int)) *CityCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*CityClient) Query

func (c *CityClient) Query() *CityQuery

Query returns a query builder for City.

func (*CityClient) QueryCountry

func (c *CityClient) QueryCountry(ci *City) *CountryQuery

QueryCountry queries the country edge of a City.

func (*CityClient) QueryRegion

func (c *CityClient) QueryRegion(ci *City) *RegionQuery

QueryRegion queries the region edge of a City.

func (*CityClient) QueryUsers

func (c *CityClient) QueryUsers(ci *City) *UserQuery

QueryUsers queries the users edge of a City.

func (*CityClient) Update

func (c *CityClient) Update() *CityUpdate

Update returns an update builder for City.

func (*CityClient) UpdateOne

func (c *CityClient) UpdateOne(ci *City) *CityUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CityClient) UpdateOneID

func (c *CityClient) UpdateOneID(id uuid.UUID) *CityUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CityClient) Use

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

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

type CityCreate

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

CityCreate is the builder for creating a City entity.

func (*CityCreate) AddUserIDs

func (cc *CityCreate) AddUserIDs(ids ...uuid.UUID) *CityCreate

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

func (*CityCreate) AddUsers

func (cc *CityCreate) AddUsers(u ...*User) *CityCreate

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

func (*CityCreate) Exec

func (cc *CityCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*CityCreate) ExecX

func (cc *CityCreate) ExecX(ctx context.Context)

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

func (*CityCreate) Mutation

func (cc *CityCreate) Mutation() *CityMutation

Mutation returns the CityMutation object of the builder.

func (*CityCreate) Save

func (cc *CityCreate) Save(ctx context.Context) (*City, error)

Save creates the City in the database.

func (*CityCreate) SaveX

func (cc *CityCreate) SaveX(ctx context.Context) *City

SaveX calls Save and panics if Save returns an error.

func (*CityCreate) SetCountry

func (cc *CityCreate) SetCountry(c *Country) *CityCreate

SetCountry sets the "country" edge to the Country entity.

func (*CityCreate) SetCountryID

func (cc *CityCreate) SetCountryID(u uuid.UUID) *CityCreate

SetCountryID sets the "country_id" field.

func (*CityCreate) SetCreatedAt

func (cc *CityCreate) SetCreatedAt(t time.Time) *CityCreate

SetCreatedAt sets the "created_at" field.

func (*CityCreate) SetID

func (cc *CityCreate) SetID(u uuid.UUID) *CityCreate

SetID sets the "id" field.

func (*CityCreate) SetName

func (cc *CityCreate) SetName(s string) *CityCreate

SetName sets the "name" field.

func (*CityCreate) SetNillableCreatedAt

func (cc *CityCreate) SetNillableCreatedAt(t *time.Time) *CityCreate

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

func (*CityCreate) SetNillableID

func (cc *CityCreate) SetNillableID(u *uuid.UUID) *CityCreate

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

func (*CityCreate) SetNillableRegionID

func (cc *CityCreate) SetNillableRegionID(u *uuid.UUID) *CityCreate

SetNillableRegionID sets the "region_id" field if the given value is not nil.

func (*CityCreate) SetNillableUpdatedAt

func (cc *CityCreate) SetNillableUpdatedAt(t *time.Time) *CityCreate

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

func (*CityCreate) SetRegion

func (cc *CityCreate) SetRegion(r *Region) *CityCreate

SetRegion sets the "region" edge to the Region entity.

func (*CityCreate) SetRegionID

func (cc *CityCreate) SetRegionID(u uuid.UUID) *CityCreate

SetRegionID sets the "region_id" field.

func (*CityCreate) SetUpdatedAt

func (cc *CityCreate) SetUpdatedAt(t time.Time) *CityCreate

SetUpdatedAt sets the "updated_at" field.

type CityCreateBulk

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

CityCreateBulk is the builder for creating many City entities in bulk.

func (*CityCreateBulk) Exec

func (ccb *CityCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*CityCreateBulk) ExecX

func (ccb *CityCreateBulk) ExecX(ctx context.Context)

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

func (*CityCreateBulk) Save

func (ccb *CityCreateBulk) Save(ctx context.Context) ([]*City, error)

Save creates the City entities in the database.

func (*CityCreateBulk) SaveX

func (ccb *CityCreateBulk) SaveX(ctx context.Context) []*City

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

type CityDelete

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

CityDelete is the builder for deleting a City entity.

func (*CityDelete) Exec

func (cd *CityDelete) Exec(ctx context.Context) (int, error)

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

func (*CityDelete) ExecX

func (cd *CityDelete) ExecX(ctx context.Context) int

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

func (*CityDelete) Where

func (cd *CityDelete) Where(ps ...predicate.City) *CityDelete

Where appends a list predicates to the CityDelete builder.

type CityDeleteOne

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

CityDeleteOne is the builder for deleting a single City entity.

func (*CityDeleteOne) Exec

func (cdo *CityDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*CityDeleteOne) ExecX

func (cdo *CityDeleteOne) ExecX(ctx context.Context)

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

func (*CityDeleteOne) Where

func (cdo *CityDeleteOne) Where(ps ...predicate.City) *CityDeleteOne

Where appends a list predicates to the CityDelete builder.

type CityEdges

type CityEdges struct {
	// Region holds the value of the region edge.
	Region *Region `json:"region,omitempty"`
	// Country holds the value of the country edge.
	Country *Country `json:"country,omitempty"`
	// Users holds the value of the users edge.
	Users []*User `json:"users,omitempty"`
	// contains filtered or unexported fields
}

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

func (CityEdges) CountryOrErr

func (e CityEdges) CountryOrErr() (*Country, error)

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

func (CityEdges) RegionOrErr

func (e CityEdges) RegionOrErr() (*Region, error)

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

func (CityEdges) UsersOrErr

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

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

type CityGroupBy

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

CityGroupBy is the group-by builder for City entities.

func (*CityGroupBy) Aggregate

func (cgb *CityGroupBy) Aggregate(fns ...AggregateFunc) *CityGroupBy

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

func (*CityGroupBy) Bool

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

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

func (*CityGroupBy) BoolX

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

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

func (*CityGroupBy) Bools

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

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

func (*CityGroupBy) BoolsX

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

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

func (*CityGroupBy) Float64

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

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

func (*CityGroupBy) Float64X

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

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

func (*CityGroupBy) Float64s

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

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

func (*CityGroupBy) Float64sX

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

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

func (*CityGroupBy) Int

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

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

func (*CityGroupBy) IntX

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

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

func (*CityGroupBy) Ints

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

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

func (*CityGroupBy) IntsX

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

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

func (*CityGroupBy) Scan

func (cgb *CityGroupBy) Scan(ctx context.Context, v any) error

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

func (*CityGroupBy) ScanX

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

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

func (*CityGroupBy) String

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

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

func (*CityGroupBy) StringX

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

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

func (*CityGroupBy) Strings

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

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

func (*CityGroupBy) StringsX

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

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

type CityMutation

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

CityMutation represents an operation that mutates the City nodes in the graph.

func (*CityMutation) AddField

func (m *CityMutation) 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 (*CityMutation) AddUserIDs

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

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

func (*CityMutation) AddedEdges

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

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

func (*CityMutation) AddedField

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

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

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

func (*CityMutation) AddedIDs

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

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

func (*CityMutation) ClearCountry

func (m *CityMutation) ClearCountry()

ClearCountry clears the "country" edge to the Country entity.

func (*CityMutation) ClearEdge

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

func (m *CityMutation) 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 (*CityMutation) ClearRegion

func (m *CityMutation) ClearRegion()

ClearRegion clears the "region" edge to the Region entity.

func (*CityMutation) ClearRegionID

func (m *CityMutation) ClearRegionID()

ClearRegionID clears the value of the "region_id" field.

func (*CityMutation) ClearUsers

func (m *CityMutation) ClearUsers()

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

func (*CityMutation) ClearedEdges

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

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

func (*CityMutation) ClearedFields

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

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

func (CityMutation) Client

func (m CityMutation) 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 (*CityMutation) CountryCleared

func (m *CityMutation) CountryCleared() bool

CountryCleared reports if the "country" edge to the Country entity was cleared.

func (*CityMutation) CountryID

func (m *CityMutation) CountryID() (r uuid.UUID, exists bool)

CountryID returns the value of the "country_id" field in the mutation.

func (*CityMutation) CountryIDs

func (m *CityMutation) CountryIDs() (ids []uuid.UUID)

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

func (*CityMutation) CreatedAt

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

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

func (*CityMutation) EdgeCleared

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

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

func (*CityMutation) Field

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

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

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

func (*CityMutation) Fields

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

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

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

func (*CityMutation) IDs

func (m *CityMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*CityMutation) Name

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

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

func (*CityMutation) OldCountryID

func (m *CityMutation) OldCountryID(ctx context.Context) (v uuid.UUID, err error)

OldCountryID returns the old "country_id" field's value of the City entity. If the City 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 (*CityMutation) OldCreatedAt

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

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

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

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

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

func (m *CityMutation) OldRegionID(ctx context.Context) (v *uuid.UUID, err error)

OldRegionID returns the old "region_id" field's value of the City entity. If the City 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 (*CityMutation) OldUpdatedAt

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

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

func (m *CityMutation) Op() Op

Op returns the operation name.

func (*CityMutation) RegionCleared

func (m *CityMutation) RegionCleared() bool

RegionCleared reports if the "region" edge to the Region entity was cleared.

func (*CityMutation) RegionID

func (m *CityMutation) RegionID() (r uuid.UUID, exists bool)

RegionID returns the value of the "region_id" field in the mutation.

func (*CityMutation) RegionIDCleared

func (m *CityMutation) RegionIDCleared() bool

RegionIDCleared returns if the "region_id" field was cleared in this mutation.

func (*CityMutation) RegionIDs

func (m *CityMutation) RegionIDs() (ids []uuid.UUID)

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

func (*CityMutation) RemoveUserIDs

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

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

func (*CityMutation) RemovedEdges

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

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

func (*CityMutation) RemovedIDs

func (m *CityMutation) 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 (*CityMutation) RemovedUsersIDs

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

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

func (*CityMutation) ResetCountry

func (m *CityMutation) ResetCountry()

ResetCountry resets all changes to the "country" edge.

func (*CityMutation) ResetCountryID

func (m *CityMutation) ResetCountryID()

ResetCountryID resets all changes to the "country_id" field.

func (*CityMutation) ResetCreatedAt

func (m *CityMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*CityMutation) ResetEdge

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

func (m *CityMutation) 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 (*CityMutation) ResetName

func (m *CityMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*CityMutation) ResetRegion

func (m *CityMutation) ResetRegion()

ResetRegion resets all changes to the "region" edge.

func (*CityMutation) ResetRegionID

func (m *CityMutation) ResetRegionID()

ResetRegionID resets all changes to the "region_id" field.

func (*CityMutation) ResetUpdatedAt

func (m *CityMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*CityMutation) ResetUsers

func (m *CityMutation) ResetUsers()

ResetUsers resets all changes to the "users" edge.

func (*CityMutation) SetCountryID

func (m *CityMutation) SetCountryID(u uuid.UUID)

SetCountryID sets the "country_id" field.

func (*CityMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*CityMutation) SetField

func (m *CityMutation) 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 (*CityMutation) SetID

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

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

func (*CityMutation) SetName

func (m *CityMutation) SetName(s string)

SetName sets the "name" field.

func (*CityMutation) SetOp

func (m *CityMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CityMutation) SetRegionID

func (m *CityMutation) SetRegionID(u uuid.UUID)

SetRegionID sets the "region_id" field.

func (*CityMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (CityMutation) Tx

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

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

func (*CityMutation) Type

func (m *CityMutation) Type() string

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

func (*CityMutation) UpdatedAt

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

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

func (*CityMutation) UsersCleared

func (m *CityMutation) UsersCleared() bool

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

func (*CityMutation) UsersIDs

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

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

func (*CityMutation) Where

func (m *CityMutation) Where(ps ...predicate.City)

Where appends a list predicates to the CityMutation builder.

func (*CityMutation) WhereP

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

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

type CityQuery

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

CityQuery is the builder for querying City entities.

func (*CityQuery) Aggregate

func (cq *CityQuery) Aggregate(fns ...AggregateFunc) *CitySelect

Aggregate returns a CitySelect configured with the given aggregations.

func (*CityQuery) All

func (cq *CityQuery) All(ctx context.Context) ([]*City, error)

All executes the query and returns a list of Cities.

func (*CityQuery) AllX

func (cq *CityQuery) AllX(ctx context.Context) []*City

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

func (*CityQuery) Clone

func (cq *CityQuery) Clone() *CityQuery

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

func (*CityQuery) Count

func (cq *CityQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CityQuery) CountX

func (cq *CityQuery) CountX(ctx context.Context) int

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

func (*CityQuery) Exist

func (cq *CityQuery) Exist(ctx context.Context) (bool, error)

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

func (*CityQuery) ExistX

func (cq *CityQuery) ExistX(ctx context.Context) bool

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

func (*CityQuery) First

func (cq *CityQuery) First(ctx context.Context) (*City, error)

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

func (*CityQuery) FirstID

func (cq *CityQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*CityQuery) FirstIDX

func (cq *CityQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*CityQuery) FirstX

func (cq *CityQuery) FirstX(ctx context.Context) *City

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

func (*CityQuery) GroupBy

func (cq *CityQuery) GroupBy(field string, fields ...string) *CityGroupBy

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

Example:

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

client.City.Query().
	GroupBy(city.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CityQuery) IDs

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

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

func (*CityQuery) IDsX

func (cq *CityQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*CityQuery) Limit

func (cq *CityQuery) Limit(limit int) *CityQuery

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

func (*CityQuery) Offset

func (cq *CityQuery) Offset(offset int) *CityQuery

Offset to start from.

func (*CityQuery) Only

func (cq *CityQuery) Only(ctx context.Context) (*City, error)

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

func (*CityQuery) OnlyID

func (cq *CityQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*CityQuery) OnlyIDX

func (cq *CityQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*CityQuery) OnlyX

func (cq *CityQuery) OnlyX(ctx context.Context) *City

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

func (*CityQuery) Order

func (cq *CityQuery) Order(o ...city.OrderOption) *CityQuery

Order specifies how the records should be ordered.

func (*CityQuery) QueryCountry

func (cq *CityQuery) QueryCountry() *CountryQuery

QueryCountry chains the current query on the "country" edge.

func (*CityQuery) QueryRegion

func (cq *CityQuery) QueryRegion() *RegionQuery

QueryRegion chains the current query on the "region" edge.

func (*CityQuery) QueryUsers

func (cq *CityQuery) QueryUsers() *UserQuery

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

func (*CityQuery) Select

func (cq *CityQuery) Select(fields ...string) *CitySelect

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

Example:

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

client.City.Query().
	Select(city.FieldCreatedAt).
	Scan(ctx, &v)

func (*CityQuery) Unique

func (cq *CityQuery) Unique(unique bool) *CityQuery

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

func (cq *CityQuery) Where(ps ...predicate.City) *CityQuery

Where adds a new predicate for the CityQuery builder.

func (*CityQuery) WithCountry

func (cq *CityQuery) WithCountry(opts ...func(*CountryQuery)) *CityQuery

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

func (*CityQuery) WithRegion

func (cq *CityQuery) WithRegion(opts ...func(*RegionQuery)) *CityQuery

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

func (*CityQuery) WithUsers

func (cq *CityQuery) WithUsers(opts ...func(*UserQuery)) *CityQuery

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

type CitySelect

type CitySelect struct {
	*CityQuery
	// contains filtered or unexported fields
}

CitySelect is the builder for selecting fields of City entities.

func (*CitySelect) Aggregate

func (cs *CitySelect) Aggregate(fns ...AggregateFunc) *CitySelect

Aggregate adds the given aggregation functions to the selector query.

func (*CitySelect) Bool

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

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

func (*CitySelect) BoolX

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

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

func (*CitySelect) Bools

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

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

func (*CitySelect) BoolsX

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

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

func (*CitySelect) Float64

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

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

func (*CitySelect) Float64X

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

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

func (*CitySelect) Float64s

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

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

func (*CitySelect) Float64sX

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

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

func (*CitySelect) Int

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

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

func (*CitySelect) IntX

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

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

func (*CitySelect) Ints

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

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

func (*CitySelect) IntsX

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

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

func (*CitySelect) Scan

func (cs *CitySelect) Scan(ctx context.Context, v any) error

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

func (*CitySelect) ScanX

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

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

func (*CitySelect) String

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

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

func (*CitySelect) StringX

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

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

func (*CitySelect) Strings

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

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

func (*CitySelect) StringsX

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

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

type CityUpdate

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

CityUpdate is the builder for updating City entities.

func (*CityUpdate) AddUserIDs

func (cu *CityUpdate) AddUserIDs(ids ...uuid.UUID) *CityUpdate

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

func (*CityUpdate) AddUsers

func (cu *CityUpdate) AddUsers(u ...*User) *CityUpdate

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

func (*CityUpdate) ClearCountry

func (cu *CityUpdate) ClearCountry() *CityUpdate

ClearCountry clears the "country" edge to the Country entity.

func (*CityUpdate) ClearRegion

func (cu *CityUpdate) ClearRegion() *CityUpdate

ClearRegion clears the "region" edge to the Region entity.

func (*CityUpdate) ClearRegionID

func (cu *CityUpdate) ClearRegionID() *CityUpdate

ClearRegionID clears the value of the "region_id" field.

func (*CityUpdate) ClearUsers

func (cu *CityUpdate) ClearUsers() *CityUpdate

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

func (*CityUpdate) Exec

func (cu *CityUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CityUpdate) ExecX

func (cu *CityUpdate) ExecX(ctx context.Context)

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

func (*CityUpdate) Mutation

func (cu *CityUpdate) Mutation() *CityMutation

Mutation returns the CityMutation object of the builder.

func (*CityUpdate) RemoveUserIDs

func (cu *CityUpdate) RemoveUserIDs(ids ...uuid.UUID) *CityUpdate

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

func (*CityUpdate) RemoveUsers

func (cu *CityUpdate) RemoveUsers(u ...*User) *CityUpdate

RemoveUsers removes "users" edges to User entities.

func (*CityUpdate) Save

func (cu *CityUpdate) Save(ctx context.Context) (int, error)

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

func (*CityUpdate) SaveX

func (cu *CityUpdate) SaveX(ctx context.Context) int

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

func (*CityUpdate) SetCountry

func (cu *CityUpdate) SetCountry(c *Country) *CityUpdate

SetCountry sets the "country" edge to the Country entity.

func (*CityUpdate) SetCountryID

func (cu *CityUpdate) SetCountryID(u uuid.UUID) *CityUpdate

SetCountryID sets the "country_id" field.

func (*CityUpdate) SetCreatedAt

func (cu *CityUpdate) SetCreatedAt(t time.Time) *CityUpdate

SetCreatedAt sets the "created_at" field.

func (*CityUpdate) SetName

func (cu *CityUpdate) SetName(s string) *CityUpdate

SetName sets the "name" field.

func (*CityUpdate) SetNillableCountryID

func (cu *CityUpdate) SetNillableCountryID(u *uuid.UUID) *CityUpdate

SetNillableCountryID sets the "country_id" field if the given value is not nil.

func (*CityUpdate) SetNillableCreatedAt

func (cu *CityUpdate) SetNillableCreatedAt(t *time.Time) *CityUpdate

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

func (*CityUpdate) SetNillableName

func (cu *CityUpdate) SetNillableName(s *string) *CityUpdate

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

func (*CityUpdate) SetNillableRegionID

func (cu *CityUpdate) SetNillableRegionID(u *uuid.UUID) *CityUpdate

SetNillableRegionID sets the "region_id" field if the given value is not nil.

func (*CityUpdate) SetRegion

func (cu *CityUpdate) SetRegion(r *Region) *CityUpdate

SetRegion sets the "region" edge to the Region entity.

func (*CityUpdate) SetRegionID

func (cu *CityUpdate) SetRegionID(u uuid.UUID) *CityUpdate

SetRegionID sets the "region_id" field.

func (*CityUpdate) SetUpdatedAt

func (cu *CityUpdate) SetUpdatedAt(t time.Time) *CityUpdate

SetUpdatedAt sets the "updated_at" field.

func (*CityUpdate) Where

func (cu *CityUpdate) Where(ps ...predicate.City) *CityUpdate

Where appends a list predicates to the CityUpdate builder.

type CityUpdateOne

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

CityUpdateOne is the builder for updating a single City entity.

func (*CityUpdateOne) AddUserIDs

func (cuo *CityUpdateOne) AddUserIDs(ids ...uuid.UUID) *CityUpdateOne

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

func (*CityUpdateOne) AddUsers

func (cuo *CityUpdateOne) AddUsers(u ...*User) *CityUpdateOne

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

func (*CityUpdateOne) ClearCountry

func (cuo *CityUpdateOne) ClearCountry() *CityUpdateOne

ClearCountry clears the "country" edge to the Country entity.

func (*CityUpdateOne) ClearRegion

func (cuo *CityUpdateOne) ClearRegion() *CityUpdateOne

ClearRegion clears the "region" edge to the Region entity.

func (*CityUpdateOne) ClearRegionID

func (cuo *CityUpdateOne) ClearRegionID() *CityUpdateOne

ClearRegionID clears the value of the "region_id" field.

func (*CityUpdateOne) ClearUsers

func (cuo *CityUpdateOne) ClearUsers() *CityUpdateOne

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

func (*CityUpdateOne) Exec

func (cuo *CityUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CityUpdateOne) ExecX

func (cuo *CityUpdateOne) ExecX(ctx context.Context)

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

func (*CityUpdateOne) Mutation

func (cuo *CityUpdateOne) Mutation() *CityMutation

Mutation returns the CityMutation object of the builder.

func (*CityUpdateOne) RemoveUserIDs

func (cuo *CityUpdateOne) RemoveUserIDs(ids ...uuid.UUID) *CityUpdateOne

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

func (*CityUpdateOne) RemoveUsers

func (cuo *CityUpdateOne) RemoveUsers(u ...*User) *CityUpdateOne

RemoveUsers removes "users" edges to User entities.

func (*CityUpdateOne) Save

func (cuo *CityUpdateOne) Save(ctx context.Context) (*City, error)

Save executes the query and returns the updated City entity.

func (*CityUpdateOne) SaveX

func (cuo *CityUpdateOne) SaveX(ctx context.Context) *City

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

func (*CityUpdateOne) Select

func (cuo *CityUpdateOne) Select(field string, fields ...string) *CityUpdateOne

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

func (*CityUpdateOne) SetCountry

func (cuo *CityUpdateOne) SetCountry(c *Country) *CityUpdateOne

SetCountry sets the "country" edge to the Country entity.

func (*CityUpdateOne) SetCountryID

func (cuo *CityUpdateOne) SetCountryID(u uuid.UUID) *CityUpdateOne

SetCountryID sets the "country_id" field.

func (*CityUpdateOne) SetCreatedAt

func (cuo *CityUpdateOne) SetCreatedAt(t time.Time) *CityUpdateOne

SetCreatedAt sets the "created_at" field.

func (*CityUpdateOne) SetName

func (cuo *CityUpdateOne) SetName(s string) *CityUpdateOne

SetName sets the "name" field.

func (*CityUpdateOne) SetNillableCountryID

func (cuo *CityUpdateOne) SetNillableCountryID(u *uuid.UUID) *CityUpdateOne

SetNillableCountryID sets the "country_id" field if the given value is not nil.

func (*CityUpdateOne) SetNillableCreatedAt

func (cuo *CityUpdateOne) SetNillableCreatedAt(t *time.Time) *CityUpdateOne

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

func (*CityUpdateOne) SetNillableName

func (cuo *CityUpdateOne) SetNillableName(s *string) *CityUpdateOne

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

func (*CityUpdateOne) SetNillableRegionID

func (cuo *CityUpdateOne) SetNillableRegionID(u *uuid.UUID) *CityUpdateOne

SetNillableRegionID sets the "region_id" field if the given value is not nil.

func (*CityUpdateOne) SetRegion

func (cuo *CityUpdateOne) SetRegion(r *Region) *CityUpdateOne

SetRegion sets the "region" edge to the Region entity.

func (*CityUpdateOne) SetRegionID

func (cuo *CityUpdateOne) SetRegionID(u uuid.UUID) *CityUpdateOne

SetRegionID sets the "region_id" field.

func (*CityUpdateOne) SetUpdatedAt

func (cuo *CityUpdateOne) SetUpdatedAt(t time.Time) *CityUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*CityUpdateOne) Where

func (cuo *CityUpdateOne) Where(ps ...predicate.City) *CityUpdateOne

Where appends a list predicates to the CityUpdate builder.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Chat is the client for interacting with the Chat builders.
	Chat *ChatClient
	// City is the client for interacting with the City builders.
	City *CityClient
	// Comment is the client for interacting with the Comment builders.
	Comment *CommentClient
	// Country is the client for interacting with the Country builders.
	Country *CountryClient
	// File is the client for interacting with the File builders.
	File *FileClient
	// Friend is the client for interacting with the Friend builders.
	Friend *FriendClient
	// Message is the client for interacting with the Message builders.
	Message *MessageClient
	// Notification is the client for interacting with the Notification builders.
	Notification *NotificationClient
	// Otp is the client for interacting with the Otp builders.
	Otp *OtpClient
	// Post is the client for interacting with the Post builders.
	Post *PostClient
	// Reaction is the client for interacting with the Reaction builders.
	Reaction *ReactionClient
	// Region is the client for interacting with the Region builders.
	Region *RegionClient
	// Reply is the client for interacting with the Reply builders.
	Reply *ReplyClient
	// SiteDetail is the client for interacting with the SiteDetail builders.
	SiteDetail *SiteDetailClient
	// 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().
	Chat.
	Query().
	Count(ctx)

func (*Client) Intercept

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

Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.

func (*Client) Mutate

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

Mutate implements the ent.Mutator interface.

func (*Client) Tx

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

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

func (*Client) Use

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

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

type Comment

type Comment struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Text holds the value of the "text" field.
	Text string `json:"text,omitempty"`
	// Slug holds the value of the "slug" field.
	Slug string `json:"slug,omitempty"`
	// AuthorID holds the value of the "author_id" field.
	AuthorID uuid.UUID `json:"author_id,omitempty"`
	// PostID holds the value of the "post_id" field.
	PostID uuid.UUID `json:"post_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the CommentQuery when eager-loading is set.
	Edges CommentEdges `json:"edges"`
	// contains filtered or unexported fields
}

Comment is the model entity for the Comment schema.

func (*Comment) QueryAuthor

func (c *Comment) QueryAuthor() *UserQuery

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

func (*Comment) QueryNotifications

func (c *Comment) QueryNotifications() *NotificationQuery

QueryNotifications queries the "notifications" edge of the Comment entity.

func (*Comment) QueryPost

func (c *Comment) QueryPost() *PostQuery

QueryPost queries the "post" edge of the Comment entity.

func (*Comment) QueryReactions

func (c *Comment) QueryReactions() *ReactionQuery

QueryReactions queries the "reactions" edge of the Comment entity.

func (*Comment) QueryReplies

func (c *Comment) QueryReplies() *ReplyQuery

QueryReplies queries the "replies" edge of the Comment entity.

func (*Comment) String

func (c *Comment) String() string

String implements the fmt.Stringer.

func (*Comment) Unwrap

func (c *Comment) Unwrap() *Comment

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

func (c *Comment) Update() *CommentUpdateOne

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

func (*Comment) Value

func (c *Comment) Value(name string) (ent.Value, error)

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

type CommentClient

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

CommentClient is a client for the Comment schema.

func NewCommentClient

func NewCommentClient(c config) *CommentClient

NewCommentClient returns a client for the Comment from the given config.

func (*CommentClient) Create

func (c *CommentClient) Create() *CommentCreate

Create returns a builder for creating a Comment entity.

func (*CommentClient) CreateBulk

func (c *CommentClient) CreateBulk(builders ...*CommentCreate) *CommentCreateBulk

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

func (*CommentClient) Delete

func (c *CommentClient) Delete() *CommentDelete

Delete returns a delete builder for Comment.

func (*CommentClient) DeleteOne

func (c *CommentClient) DeleteOne(co *Comment) *CommentDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CommentClient) DeleteOneID

func (c *CommentClient) DeleteOneID(id uuid.UUID) *CommentDeleteOne

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

func (*CommentClient) Get

func (c *CommentClient) Get(ctx context.Context, id uuid.UUID) (*Comment, error)

Get returns a Comment entity by its id.

func (*CommentClient) GetX

func (c *CommentClient) GetX(ctx context.Context, id uuid.UUID) *Comment

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

func (*CommentClient) Hooks

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

Hooks returns the client hooks.

func (*CommentClient) Intercept

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

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

func (*CommentClient) Interceptors

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

Interceptors returns the client interceptors.

func (*CommentClient) MapCreateBulk

func (c *CommentClient) MapCreateBulk(slice any, setFunc func(*CommentCreate, int)) *CommentCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*CommentClient) Query

func (c *CommentClient) Query() *CommentQuery

Query returns a query builder for Comment.

func (*CommentClient) QueryAuthor

func (c *CommentClient) QueryAuthor(co *Comment) *UserQuery

QueryAuthor queries the author edge of a Comment.

func (*CommentClient) QueryNotifications

func (c *CommentClient) QueryNotifications(co *Comment) *NotificationQuery

QueryNotifications queries the notifications edge of a Comment.

func (*CommentClient) QueryPost

func (c *CommentClient) QueryPost(co *Comment) *PostQuery

QueryPost queries the post edge of a Comment.

func (*CommentClient) QueryReactions

func (c *CommentClient) QueryReactions(co *Comment) *ReactionQuery

QueryReactions queries the reactions edge of a Comment.

func (*CommentClient) QueryReplies

func (c *CommentClient) QueryReplies(co *Comment) *ReplyQuery

QueryReplies queries the replies edge of a Comment.

func (*CommentClient) Update

func (c *CommentClient) Update() *CommentUpdate

Update returns an update builder for Comment.

func (*CommentClient) UpdateOne

func (c *CommentClient) UpdateOne(co *Comment) *CommentUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CommentClient) UpdateOneID

func (c *CommentClient) UpdateOneID(id uuid.UUID) *CommentUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CommentClient) Use

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

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

type CommentCreate

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

CommentCreate is the builder for creating a Comment entity.

func (*CommentCreate) AddNotificationIDs

func (cc *CommentCreate) AddNotificationIDs(ids ...uuid.UUID) *CommentCreate

AddNotificationIDs adds the "notifications" edge to the Notification entity by IDs.

func (*CommentCreate) AddNotifications

func (cc *CommentCreate) AddNotifications(n ...*Notification) *CommentCreate

AddNotifications adds the "notifications" edges to the Notification entity.

func (*CommentCreate) AddReactionIDs

func (cc *CommentCreate) AddReactionIDs(ids ...uuid.UUID) *CommentCreate

AddReactionIDs adds the "reactions" edge to the Reaction entity by IDs.

func (*CommentCreate) AddReactions

func (cc *CommentCreate) AddReactions(r ...*Reaction) *CommentCreate

AddReactions adds the "reactions" edges to the Reaction entity.

func (*CommentCreate) AddReplies

func (cc *CommentCreate) AddReplies(r ...*Reply) *CommentCreate

AddReplies adds the "replies" edges to the Reply entity.

func (*CommentCreate) AddReplyIDs

func (cc *CommentCreate) AddReplyIDs(ids ...uuid.UUID) *CommentCreate

AddReplyIDs adds the "replies" edge to the Reply entity by IDs.

func (*CommentCreate) Exec

func (cc *CommentCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*CommentCreate) ExecX

func (cc *CommentCreate) ExecX(ctx context.Context)

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

func (*CommentCreate) Mutation

func (cc *CommentCreate) Mutation() *CommentMutation

Mutation returns the CommentMutation object of the builder.

func (*CommentCreate) Save

func (cc *CommentCreate) Save(ctx context.Context) (*Comment, error)

Save creates the Comment in the database.

func (*CommentCreate) SaveX

func (cc *CommentCreate) SaveX(ctx context.Context) *Comment

SaveX calls Save and panics if Save returns an error.

func (*CommentCreate) SetAuthor

func (cc *CommentCreate) SetAuthor(u *User) *CommentCreate

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

func (*CommentCreate) SetAuthorID

func (cc *CommentCreate) SetAuthorID(u uuid.UUID) *CommentCreate

SetAuthorID sets the "author_id" field.

func (*CommentCreate) SetCreatedAt

func (cc *CommentCreate) SetCreatedAt(t time.Time) *CommentCreate

SetCreatedAt sets the "created_at" field.

func (*CommentCreate) SetID

func (cc *CommentCreate) SetID(u uuid.UUID) *CommentCreate

SetID sets the "id" field.

func (*CommentCreate) SetNillableCreatedAt

func (cc *CommentCreate) SetNillableCreatedAt(t *time.Time) *CommentCreate

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

func (*CommentCreate) SetNillableID

func (cc *CommentCreate) SetNillableID(u *uuid.UUID) *CommentCreate

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

func (*CommentCreate) SetNillableUpdatedAt

func (cc *CommentCreate) SetNillableUpdatedAt(t *time.Time) *CommentCreate

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

func (*CommentCreate) SetPost

func (cc *CommentCreate) SetPost(p *Post) *CommentCreate

SetPost sets the "post" edge to the Post entity.

func (*CommentCreate) SetPostID

func (cc *CommentCreate) SetPostID(u uuid.UUID) *CommentCreate

SetPostID sets the "post_id" field.

func (*CommentCreate) SetSlug

func (cc *CommentCreate) SetSlug(s string) *CommentCreate

SetSlug sets the "slug" field.

func (*CommentCreate) SetText

func (cc *CommentCreate) SetText(s string) *CommentCreate

SetText sets the "text" field.

func (*CommentCreate) SetUpdatedAt

func (cc *CommentCreate) SetUpdatedAt(t time.Time) *CommentCreate

SetUpdatedAt sets the "updated_at" field.

type CommentCreateBulk

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

CommentCreateBulk is the builder for creating many Comment entities in bulk.

func (*CommentCreateBulk) Exec

func (ccb *CommentCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*CommentCreateBulk) ExecX

func (ccb *CommentCreateBulk) ExecX(ctx context.Context)

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

func (*CommentCreateBulk) Save

func (ccb *CommentCreateBulk) Save(ctx context.Context) ([]*Comment, error)

Save creates the Comment entities in the database.

func (*CommentCreateBulk) SaveX

func (ccb *CommentCreateBulk) SaveX(ctx context.Context) []*Comment

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

type CommentDelete

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

CommentDelete is the builder for deleting a Comment entity.

func (*CommentDelete) Exec

func (cd *CommentDelete) Exec(ctx context.Context) (int, error)

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

func (*CommentDelete) ExecX

func (cd *CommentDelete) ExecX(ctx context.Context) int

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

func (*CommentDelete) Where

func (cd *CommentDelete) Where(ps ...predicate.Comment) *CommentDelete

Where appends a list predicates to the CommentDelete builder.

type CommentDeleteOne

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

CommentDeleteOne is the builder for deleting a single Comment entity.

func (*CommentDeleteOne) Exec

func (cdo *CommentDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*CommentDeleteOne) ExecX

func (cdo *CommentDeleteOne) ExecX(ctx context.Context)

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

func (*CommentDeleteOne) Where

Where appends a list predicates to the CommentDelete builder.

type CommentEdges

type CommentEdges struct {
	// Reactions holds the value of the reactions edge.
	Reactions []*Reaction `json:"reactions,omitempty"`
	// Author holds the value of the author edge.
	Author *User `json:"author,omitempty"`
	// Post holds the value of the post edge.
	Post *Post `json:"post,omitempty"`
	// Replies holds the value of the replies edge.
	Replies []*Reply `json:"replies,omitempty"`
	// Notifications holds the value of the notifications edge.
	Notifications []*Notification `json:"notifications,omitempty"`
	// contains filtered or unexported fields
}

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

func (CommentEdges) AuthorOrErr

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

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

func (CommentEdges) NotificationsOrErr

func (e CommentEdges) NotificationsOrErr() ([]*Notification, error)

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

func (CommentEdges) PostOrErr

func (e CommentEdges) PostOrErr() (*Post, error)

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

func (CommentEdges) ReactionsOrErr

func (e CommentEdges) ReactionsOrErr() ([]*Reaction, error)

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

func (CommentEdges) RepliesOrErr

func (e CommentEdges) RepliesOrErr() ([]*Reply, error)

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

type CommentGroupBy

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

CommentGroupBy is the group-by builder for Comment entities.

func (*CommentGroupBy) Aggregate

func (cgb *CommentGroupBy) Aggregate(fns ...AggregateFunc) *CommentGroupBy

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

func (*CommentGroupBy) Bool

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

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

func (*CommentGroupBy) BoolX

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

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

func (*CommentGroupBy) Bools

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

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

func (*CommentGroupBy) BoolsX

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

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

func (*CommentGroupBy) Float64

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

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

func (*CommentGroupBy) Float64X

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

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

func (*CommentGroupBy) Float64s

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

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

func (*CommentGroupBy) Float64sX

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

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

func (*CommentGroupBy) Int

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

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

func (*CommentGroupBy) IntX

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

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

func (*CommentGroupBy) Ints

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

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

func (*CommentGroupBy) IntsX

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

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

func (*CommentGroupBy) Scan

func (cgb *CommentGroupBy) Scan(ctx context.Context, v any) error

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

func (*CommentGroupBy) ScanX

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

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

func (*CommentGroupBy) String

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

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

func (*CommentGroupBy) StringX

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

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

func (*CommentGroupBy) Strings

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

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

func (*CommentGroupBy) StringsX

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

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

type CommentMutation

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

CommentMutation represents an operation that mutates the Comment nodes in the graph.

func (*CommentMutation) AddField

func (m *CommentMutation) 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 (*CommentMutation) AddNotificationIDs

func (m *CommentMutation) AddNotificationIDs(ids ...uuid.UUID)

AddNotificationIDs adds the "notifications" edge to the Notification entity by ids.

func (*CommentMutation) AddReactionIDs

func (m *CommentMutation) AddReactionIDs(ids ...uuid.UUID)

AddReactionIDs adds the "reactions" edge to the Reaction entity by ids.

func (*CommentMutation) AddReplyIDs

func (m *CommentMutation) AddReplyIDs(ids ...uuid.UUID)

AddReplyIDs adds the "replies" edge to the Reply entity by ids.

func (*CommentMutation) AddedEdges

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

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

func (*CommentMutation) AddedField

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

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

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

func (*CommentMutation) AddedIDs

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

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

func (*CommentMutation) AuthorCleared

func (m *CommentMutation) AuthorCleared() bool

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

func (*CommentMutation) AuthorID

func (m *CommentMutation) AuthorID() (r uuid.UUID, exists bool)

AuthorID returns the value of the "author_id" field in the mutation.

func (*CommentMutation) AuthorIDs

func (m *CommentMutation) AuthorIDs() (ids []uuid.UUID)

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

func (*CommentMutation) ClearAuthor

func (m *CommentMutation) ClearAuthor()

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

func (*CommentMutation) ClearEdge

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

func (m *CommentMutation) 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 (*CommentMutation) ClearNotifications

func (m *CommentMutation) ClearNotifications()

ClearNotifications clears the "notifications" edge to the Notification entity.

func (*CommentMutation) ClearPost

func (m *CommentMutation) ClearPost()

ClearPost clears the "post" edge to the Post entity.

func (*CommentMutation) ClearReactions

func (m *CommentMutation) ClearReactions()

ClearReactions clears the "reactions" edge to the Reaction entity.

func (*CommentMutation) ClearReplies

func (m *CommentMutation) ClearReplies()

ClearReplies clears the "replies" edge to the Reply entity.

func (*CommentMutation) ClearedEdges

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

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

func (*CommentMutation) ClearedFields

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

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

func (CommentMutation) Client

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

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

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

func (*CommentMutation) EdgeCleared

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

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

func (*CommentMutation) Field

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

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

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

func (*CommentMutation) Fields

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

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

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

func (*CommentMutation) IDs

func (m *CommentMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*CommentMutation) NotificationsCleared

func (m *CommentMutation) NotificationsCleared() bool

NotificationsCleared reports if the "notifications" edge to the Notification entity was cleared.

func (*CommentMutation) NotificationsIDs

func (m *CommentMutation) NotificationsIDs() (ids []uuid.UUID)

NotificationsIDs returns the "notifications" edge IDs in the mutation.

func (*CommentMutation) OldAuthorID

func (m *CommentMutation) OldAuthorID(ctx context.Context) (v uuid.UUID, err error)

OldAuthorID returns the old "author_id" field's value of the Comment entity. If the Comment 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 (*CommentMutation) OldCreatedAt

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

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

func (m *CommentMutation) 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 (*CommentMutation) OldPostID

func (m *CommentMutation) OldPostID(ctx context.Context) (v uuid.UUID, err error)

OldPostID returns the old "post_id" field's value of the Comment entity. If the Comment 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 (*CommentMutation) OldSlug

func (m *CommentMutation) OldSlug(ctx context.Context) (v string, err error)

OldSlug returns the old "slug" field's value of the Comment entity. If the Comment 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 (*CommentMutation) OldText

func (m *CommentMutation) OldText(ctx context.Context) (v string, err error)

OldText returns the old "text" field's value of the Comment entity. If the Comment 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 (*CommentMutation) OldUpdatedAt

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

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

func (m *CommentMutation) Op() Op

Op returns the operation name.

func (*CommentMutation) PostCleared

func (m *CommentMutation) PostCleared() bool

PostCleared reports if the "post" edge to the Post entity was cleared.

func (*CommentMutation) PostID

func (m *CommentMutation) PostID() (r uuid.UUID, exists bool)

PostID returns the value of the "post_id" field in the mutation.

func (*CommentMutation) PostIDs

func (m *CommentMutation) PostIDs() (ids []uuid.UUID)

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

func (*CommentMutation) ReactionsCleared

func (m *CommentMutation) ReactionsCleared() bool

ReactionsCleared reports if the "reactions" edge to the Reaction entity was cleared.

func (*CommentMutation) ReactionsIDs

func (m *CommentMutation) ReactionsIDs() (ids []uuid.UUID)

ReactionsIDs returns the "reactions" edge IDs in the mutation.

func (*CommentMutation) RemoveNotificationIDs

func (m *CommentMutation) RemoveNotificationIDs(ids ...uuid.UUID)

RemoveNotificationIDs removes the "notifications" edge to the Notification entity by IDs.

func (*CommentMutation) RemoveReactionIDs

func (m *CommentMutation) RemoveReactionIDs(ids ...uuid.UUID)

RemoveReactionIDs removes the "reactions" edge to the Reaction entity by IDs.

func (*CommentMutation) RemoveReplyIDs

func (m *CommentMutation) RemoveReplyIDs(ids ...uuid.UUID)

RemoveReplyIDs removes the "replies" edge to the Reply entity by IDs.

func (*CommentMutation) RemovedEdges

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

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

func (*CommentMutation) RemovedIDs

func (m *CommentMutation) 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 (*CommentMutation) RemovedNotificationsIDs

func (m *CommentMutation) RemovedNotificationsIDs() (ids []uuid.UUID)

RemovedNotifications returns the removed IDs of the "notifications" edge to the Notification entity.

func (*CommentMutation) RemovedReactionsIDs

func (m *CommentMutation) RemovedReactionsIDs() (ids []uuid.UUID)

RemovedReactions returns the removed IDs of the "reactions" edge to the Reaction entity.

func (*CommentMutation) RemovedRepliesIDs

func (m *CommentMutation) RemovedRepliesIDs() (ids []uuid.UUID)

RemovedReplies returns the removed IDs of the "replies" edge to the Reply entity.

func (*CommentMutation) RepliesCleared

func (m *CommentMutation) RepliesCleared() bool

RepliesCleared reports if the "replies" edge to the Reply entity was cleared.

func (*CommentMutation) RepliesIDs

func (m *CommentMutation) RepliesIDs() (ids []uuid.UUID)

RepliesIDs returns the "replies" edge IDs in the mutation.

func (*CommentMutation) ResetAuthor

func (m *CommentMutation) ResetAuthor()

ResetAuthor resets all changes to the "author" edge.

func (*CommentMutation) ResetAuthorID

func (m *CommentMutation) ResetAuthorID()

ResetAuthorID resets all changes to the "author_id" field.

func (*CommentMutation) ResetCreatedAt

func (m *CommentMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*CommentMutation) ResetEdge

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

func (m *CommentMutation) 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 (*CommentMutation) ResetNotifications

func (m *CommentMutation) ResetNotifications()

ResetNotifications resets all changes to the "notifications" edge.

func (*CommentMutation) ResetPost

func (m *CommentMutation) ResetPost()

ResetPost resets all changes to the "post" edge.

func (*CommentMutation) ResetPostID

func (m *CommentMutation) ResetPostID()

ResetPostID resets all changes to the "post_id" field.

func (*CommentMutation) ResetReactions

func (m *CommentMutation) ResetReactions()

ResetReactions resets all changes to the "reactions" edge.

func (*CommentMutation) ResetReplies

func (m *CommentMutation) ResetReplies()

ResetReplies resets all changes to the "replies" edge.

func (*CommentMutation) ResetSlug

func (m *CommentMutation) ResetSlug()

ResetSlug resets all changes to the "slug" field.

func (*CommentMutation) ResetText

func (m *CommentMutation) ResetText()

ResetText resets all changes to the "text" field.

func (*CommentMutation) ResetUpdatedAt

func (m *CommentMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*CommentMutation) SetAuthorID

func (m *CommentMutation) SetAuthorID(u uuid.UUID)

SetAuthorID sets the "author_id" field.

func (*CommentMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*CommentMutation) SetField

func (m *CommentMutation) 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 (*CommentMutation) SetID

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

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

func (*CommentMutation) SetOp

func (m *CommentMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CommentMutation) SetPostID

func (m *CommentMutation) SetPostID(u uuid.UUID)

SetPostID sets the "post_id" field.

func (*CommentMutation) SetSlug

func (m *CommentMutation) SetSlug(s string)

SetSlug sets the "slug" field.

func (*CommentMutation) SetText

func (m *CommentMutation) SetText(s string)

SetText sets the "text" field.

func (*CommentMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*CommentMutation) Slug

func (m *CommentMutation) Slug() (r string, exists bool)

Slug returns the value of the "slug" field in the mutation.

func (*CommentMutation) Text

func (m *CommentMutation) Text() (r string, exists bool)

Text returns the value of the "text" field in the mutation.

func (CommentMutation) Tx

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

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

func (*CommentMutation) Type

func (m *CommentMutation) Type() string

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

func (*CommentMutation) UpdatedAt

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

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

func (*CommentMutation) Where

func (m *CommentMutation) Where(ps ...predicate.Comment)

Where appends a list predicates to the CommentMutation builder.

func (*CommentMutation) WhereP

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

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

type CommentQuery

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

CommentQuery is the builder for querying Comment entities.

func (*CommentQuery) Aggregate

func (cq *CommentQuery) Aggregate(fns ...AggregateFunc) *CommentSelect

Aggregate returns a CommentSelect configured with the given aggregations.

func (*CommentQuery) All

func (cq *CommentQuery) All(ctx context.Context) ([]*Comment, error)

All executes the query and returns a list of Comments.

func (*CommentQuery) AllX

func (cq *CommentQuery) AllX(ctx context.Context) []*Comment

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

func (*CommentQuery) Clone

func (cq *CommentQuery) Clone() *CommentQuery

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

func (*CommentQuery) Count

func (cq *CommentQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CommentQuery) CountX

func (cq *CommentQuery) CountX(ctx context.Context) int

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

func (*CommentQuery) Exist

func (cq *CommentQuery) Exist(ctx context.Context) (bool, error)

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

func (*CommentQuery) ExistX

func (cq *CommentQuery) ExistX(ctx context.Context) bool

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

func (*CommentQuery) First

func (cq *CommentQuery) First(ctx context.Context) (*Comment, error)

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

func (*CommentQuery) FirstID

func (cq *CommentQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*CommentQuery) FirstIDX

func (cq *CommentQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*CommentQuery) FirstX

func (cq *CommentQuery) FirstX(ctx context.Context) *Comment

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

func (*CommentQuery) GroupBy

func (cq *CommentQuery) GroupBy(field string, fields ...string) *CommentGroupBy

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

Example:

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

client.Comment.Query().
	GroupBy(comment.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CommentQuery) IDs

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

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

func (*CommentQuery) IDsX

func (cq *CommentQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*CommentQuery) Limit

func (cq *CommentQuery) Limit(limit int) *CommentQuery

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

func (*CommentQuery) Offset

func (cq *CommentQuery) Offset(offset int) *CommentQuery

Offset to start from.

func (*CommentQuery) Only

func (cq *CommentQuery) Only(ctx context.Context) (*Comment, error)

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

func (*CommentQuery) OnlyID

func (cq *CommentQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*CommentQuery) OnlyIDX

func (cq *CommentQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*CommentQuery) OnlyX

func (cq *CommentQuery) OnlyX(ctx context.Context) *Comment

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

func (*CommentQuery) Order

func (cq *CommentQuery) Order(o ...comment.OrderOption) *CommentQuery

Order specifies how the records should be ordered.

func (*CommentQuery) QueryAuthor

func (cq *CommentQuery) QueryAuthor() *UserQuery

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

func (*CommentQuery) QueryNotifications

func (cq *CommentQuery) QueryNotifications() *NotificationQuery

QueryNotifications chains the current query on the "notifications" edge.

func (*CommentQuery) QueryPost

func (cq *CommentQuery) QueryPost() *PostQuery

QueryPost chains the current query on the "post" edge.

func (*CommentQuery) QueryReactions

func (cq *CommentQuery) QueryReactions() *ReactionQuery

QueryReactions chains the current query on the "reactions" edge.

func (*CommentQuery) QueryReplies

func (cq *CommentQuery) QueryReplies() *ReplyQuery

QueryReplies chains the current query on the "replies" edge.

func (*CommentQuery) Select

func (cq *CommentQuery) Select(fields ...string) *CommentSelect

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

Example:

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

client.Comment.Query().
	Select(comment.FieldCreatedAt).
	Scan(ctx, &v)

func (*CommentQuery) Unique

func (cq *CommentQuery) Unique(unique bool) *CommentQuery

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

func (cq *CommentQuery) Where(ps ...predicate.Comment) *CommentQuery

Where adds a new predicate for the CommentQuery builder.

func (*CommentQuery) WithAuthor

func (cq *CommentQuery) WithAuthor(opts ...func(*UserQuery)) *CommentQuery

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

func (*CommentQuery) WithNotifications

func (cq *CommentQuery) WithNotifications(opts ...func(*NotificationQuery)) *CommentQuery

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

func (*CommentQuery) WithPost

func (cq *CommentQuery) WithPost(opts ...func(*PostQuery)) *CommentQuery

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

func (*CommentQuery) WithReactions

func (cq *CommentQuery) WithReactions(opts ...func(*ReactionQuery)) *CommentQuery

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

func (*CommentQuery) WithReplies

func (cq *CommentQuery) WithReplies(opts ...func(*ReplyQuery)) *CommentQuery

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

type CommentSelect

type CommentSelect struct {
	*CommentQuery
	// contains filtered or unexported fields
}

CommentSelect is the builder for selecting fields of Comment entities.

func (*CommentSelect) Aggregate

func (cs *CommentSelect) Aggregate(fns ...AggregateFunc) *CommentSelect

Aggregate adds the given aggregation functions to the selector query.

func (*CommentSelect) Bool

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

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

func (*CommentSelect) BoolX

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

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

func (*CommentSelect) Bools

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

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

func (*CommentSelect) BoolsX

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

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

func (*CommentSelect) Float64

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

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

func (*CommentSelect) Float64X

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

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

func (*CommentSelect) Float64s

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

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

func (*CommentSelect) Float64sX

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

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

func (*CommentSelect) Int

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

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

func (*CommentSelect) IntX

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

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

func (*CommentSelect) Ints

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

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

func (*CommentSelect) IntsX

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

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

func (*CommentSelect) Scan

func (cs *CommentSelect) Scan(ctx context.Context, v any) error

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

func (*CommentSelect) ScanX

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

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

func (*CommentSelect) String

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

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

func (*CommentSelect) StringX

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

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

func (*CommentSelect) Strings

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

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

func (*CommentSelect) StringsX

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

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

type CommentUpdate

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

CommentUpdate is the builder for updating Comment entities.

func (*CommentUpdate) AddNotificationIDs

func (cu *CommentUpdate) AddNotificationIDs(ids ...uuid.UUID) *CommentUpdate

AddNotificationIDs adds the "notifications" edge to the Notification entity by IDs.

func (*CommentUpdate) AddNotifications

func (cu *CommentUpdate) AddNotifications(n ...*Notification) *CommentUpdate

AddNotifications adds the "notifications" edges to the Notification entity.

func (*CommentUpdate) AddReactionIDs

func (cu *CommentUpdate) AddReactionIDs(ids ...uuid.UUID) *CommentUpdate

AddReactionIDs adds the "reactions" edge to the Reaction entity by IDs.

func (*CommentUpdate) AddReactions

func (cu *CommentUpdate) AddReactions(r ...*Reaction) *CommentUpdate

AddReactions adds the "reactions" edges to the Reaction entity.

func (*CommentUpdate) AddReplies

func (cu *CommentUpdate) AddReplies(r ...*Reply) *CommentUpdate

AddReplies adds the "replies" edges to the Reply entity.

func (*CommentUpdate) AddReplyIDs

func (cu *CommentUpdate) AddReplyIDs(ids ...uuid.UUID) *CommentUpdate

AddReplyIDs adds the "replies" edge to the Reply entity by IDs.

func (*CommentUpdate) ClearAuthor

func (cu *CommentUpdate) ClearAuthor() *CommentUpdate

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

func (*CommentUpdate) ClearNotifications

func (cu *CommentUpdate) ClearNotifications() *CommentUpdate

ClearNotifications clears all "notifications" edges to the Notification entity.

func (*CommentUpdate) ClearPost

func (cu *CommentUpdate) ClearPost() *CommentUpdate

ClearPost clears the "post" edge to the Post entity.

func (*CommentUpdate) ClearReactions

func (cu *CommentUpdate) ClearReactions() *CommentUpdate

ClearReactions clears all "reactions" edges to the Reaction entity.

func (*CommentUpdate) ClearReplies

func (cu *CommentUpdate) ClearReplies() *CommentUpdate

ClearReplies clears all "replies" edges to the Reply entity.

func (*CommentUpdate) Exec

func (cu *CommentUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CommentUpdate) ExecX

func (cu *CommentUpdate) ExecX(ctx context.Context)

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

func (*CommentUpdate) Mutation

func (cu *CommentUpdate) Mutation() *CommentMutation

Mutation returns the CommentMutation object of the builder.

func (*CommentUpdate) RemoveNotificationIDs

func (cu *CommentUpdate) RemoveNotificationIDs(ids ...uuid.UUID) *CommentUpdate

RemoveNotificationIDs removes the "notifications" edge to Notification entities by IDs.

func (*CommentUpdate) RemoveNotifications

func (cu *CommentUpdate) RemoveNotifications(n ...*Notification) *CommentUpdate

RemoveNotifications removes "notifications" edges to Notification entities.

func (*CommentUpdate) RemoveReactionIDs

func (cu *CommentUpdate) RemoveReactionIDs(ids ...uuid.UUID) *CommentUpdate

RemoveReactionIDs removes the "reactions" edge to Reaction entities by IDs.

func (*CommentUpdate) RemoveReactions

func (cu *CommentUpdate) RemoveReactions(r ...*Reaction) *CommentUpdate

RemoveReactions removes "reactions" edges to Reaction entities.

func (*CommentUpdate) RemoveReplies

func (cu *CommentUpdate) RemoveReplies(r ...*Reply) *CommentUpdate

RemoveReplies removes "replies" edges to Reply entities.

func (*CommentUpdate) RemoveReplyIDs

func (cu *CommentUpdate) RemoveReplyIDs(ids ...uuid.UUID) *CommentUpdate

RemoveReplyIDs removes the "replies" edge to Reply entities by IDs.

func (*CommentUpdate) Save

func (cu *CommentUpdate) Save(ctx context.Context) (int, error)

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

func (*CommentUpdate) SaveX

func (cu *CommentUpdate) SaveX(ctx context.Context) int

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

func (*CommentUpdate) SetAuthor

func (cu *CommentUpdate) SetAuthor(u *User) *CommentUpdate

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

func (*CommentUpdate) SetAuthorID

func (cu *CommentUpdate) SetAuthorID(u uuid.UUID) *CommentUpdate

SetAuthorID sets the "author_id" field.

func (*CommentUpdate) SetCreatedAt

func (cu *CommentUpdate) SetCreatedAt(t time.Time) *CommentUpdate

SetCreatedAt sets the "created_at" field.

func (*CommentUpdate) SetNillableAuthorID

func (cu *CommentUpdate) SetNillableAuthorID(u *uuid.UUID) *CommentUpdate

SetNillableAuthorID sets the "author_id" field if the given value is not nil.

func (*CommentUpdate) SetNillableCreatedAt

func (cu *CommentUpdate) SetNillableCreatedAt(t *time.Time) *CommentUpdate

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

func (*CommentUpdate) SetNillablePostID

func (cu *CommentUpdate) SetNillablePostID(u *uuid.UUID) *CommentUpdate

SetNillablePostID sets the "post_id" field if the given value is not nil.

func (*CommentUpdate) SetNillableSlug

func (cu *CommentUpdate) SetNillableSlug(s *string) *CommentUpdate

SetNillableSlug sets the "slug" field if the given value is not nil.

func (*CommentUpdate) SetNillableText

func (cu *CommentUpdate) SetNillableText(s *string) *CommentUpdate

SetNillableText sets the "text" field if the given value is not nil.

func (*CommentUpdate) SetPost

func (cu *CommentUpdate) SetPost(p *Post) *CommentUpdate

SetPost sets the "post" edge to the Post entity.

func (*CommentUpdate) SetPostID

func (cu *CommentUpdate) SetPostID(u uuid.UUID) *CommentUpdate

SetPostID sets the "post_id" field.

func (*CommentUpdate) SetSlug

func (cu *CommentUpdate) SetSlug(s string) *CommentUpdate

SetSlug sets the "slug" field.

func (*CommentUpdate) SetText

func (cu *CommentUpdate) SetText(s string) *CommentUpdate

SetText sets the "text" field.

func (*CommentUpdate) SetUpdatedAt

func (cu *CommentUpdate) SetUpdatedAt(t time.Time) *CommentUpdate

SetUpdatedAt sets the "updated_at" field.

func (*CommentUpdate) Where

func (cu *CommentUpdate) Where(ps ...predicate.Comment) *CommentUpdate

Where appends a list predicates to the CommentUpdate builder.

type CommentUpdateOne

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

CommentUpdateOne is the builder for updating a single Comment entity.

func (*CommentUpdateOne) AddNotificationIDs

func (cuo *CommentUpdateOne) AddNotificationIDs(ids ...uuid.UUID) *CommentUpdateOne

AddNotificationIDs adds the "notifications" edge to the Notification entity by IDs.

func (*CommentUpdateOne) AddNotifications

func (cuo *CommentUpdateOne) AddNotifications(n ...*Notification) *CommentUpdateOne

AddNotifications adds the "notifications" edges to the Notification entity.

func (*CommentUpdateOne) AddReactionIDs

func (cuo *CommentUpdateOne) AddReactionIDs(ids ...uuid.UUID) *CommentUpdateOne

AddReactionIDs adds the "reactions" edge to the Reaction entity by IDs.

func (*CommentUpdateOne) AddReactions

func (cuo *CommentUpdateOne) AddReactions(r ...*Reaction) *CommentUpdateOne

AddReactions adds the "reactions" edges to the Reaction entity.

func (*CommentUpdateOne) AddReplies

func (cuo *CommentUpdateOne) AddReplies(r ...*Reply) *CommentUpdateOne

AddReplies adds the "replies" edges to the Reply entity.

func (*CommentUpdateOne) AddReplyIDs

func (cuo *CommentUpdateOne) AddReplyIDs(ids ...uuid.UUID) *CommentUpdateOne

AddReplyIDs adds the "replies" edge to the Reply entity by IDs.

func (*CommentUpdateOne) ClearAuthor

func (cuo *CommentUpdateOne) ClearAuthor() *CommentUpdateOne

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

func (*CommentUpdateOne) ClearNotifications

func (cuo *CommentUpdateOne) ClearNotifications() *CommentUpdateOne

ClearNotifications clears all "notifications" edges to the Notification entity.

func (*CommentUpdateOne) ClearPost

func (cuo *CommentUpdateOne) ClearPost() *CommentUpdateOne

ClearPost clears the "post" edge to the Post entity.

func (*CommentUpdateOne) ClearReactions

func (cuo *CommentUpdateOne) ClearReactions() *CommentUpdateOne

ClearReactions clears all "reactions" edges to the Reaction entity.

func (*CommentUpdateOne) ClearReplies

func (cuo *CommentUpdateOne) ClearReplies() *CommentUpdateOne

ClearReplies clears all "replies" edges to the Reply entity.

func (*CommentUpdateOne) Exec

func (cuo *CommentUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CommentUpdateOne) ExecX

func (cuo *CommentUpdateOne) ExecX(ctx context.Context)

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

func (*CommentUpdateOne) Mutation

func (cuo *CommentUpdateOne) Mutation() *CommentMutation

Mutation returns the CommentMutation object of the builder.

func (*CommentUpdateOne) RemoveNotificationIDs

func (cuo *CommentUpdateOne) RemoveNotificationIDs(ids ...uuid.UUID) *CommentUpdateOne

RemoveNotificationIDs removes the "notifications" edge to Notification entities by IDs.

func (*CommentUpdateOne) RemoveNotifications

func (cuo *CommentUpdateOne) RemoveNotifications(n ...*Notification) *CommentUpdateOne

RemoveNotifications removes "notifications" edges to Notification entities.

func (*CommentUpdateOne) RemoveReactionIDs

func (cuo *CommentUpdateOne) RemoveReactionIDs(ids ...uuid.UUID) *CommentUpdateOne

RemoveReactionIDs removes the "reactions" edge to Reaction entities by IDs.

func (*CommentUpdateOne) RemoveReactions

func (cuo *CommentUpdateOne) RemoveReactions(r ...*Reaction) *CommentUpdateOne

RemoveReactions removes "reactions" edges to Reaction entities.

func (*CommentUpdateOne) RemoveReplies

func (cuo *CommentUpdateOne) RemoveReplies(r ...*Reply) *CommentUpdateOne

RemoveReplies removes "replies" edges to Reply entities.

func (*CommentUpdateOne) RemoveReplyIDs

func (cuo *CommentUpdateOne) RemoveReplyIDs(ids ...uuid.UUID) *CommentUpdateOne

RemoveReplyIDs removes the "replies" edge to Reply entities by IDs.

func (*CommentUpdateOne) Save

func (cuo *CommentUpdateOne) Save(ctx context.Context) (*Comment, error)

Save executes the query and returns the updated Comment entity.

func (*CommentUpdateOne) SaveX

func (cuo *CommentUpdateOne) SaveX(ctx context.Context) *Comment

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

func (*CommentUpdateOne) Select

func (cuo *CommentUpdateOne) Select(field string, fields ...string) *CommentUpdateOne

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

func (*CommentUpdateOne) SetAuthor

func (cuo *CommentUpdateOne) SetAuthor(u *User) *CommentUpdateOne

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

func (*CommentUpdateOne) SetAuthorID

func (cuo *CommentUpdateOne) SetAuthorID(u uuid.UUID) *CommentUpdateOne

SetAuthorID sets the "author_id" field.

func (*CommentUpdateOne) SetCreatedAt

func (cuo *CommentUpdateOne) SetCreatedAt(t time.Time) *CommentUpdateOne

SetCreatedAt sets the "created_at" field.

func (*CommentUpdateOne) SetNillableAuthorID

func (cuo *CommentUpdateOne) SetNillableAuthorID(u *uuid.UUID) *CommentUpdateOne

SetNillableAuthorID sets the "author_id" field if the given value is not nil.

func (*CommentUpdateOne) SetNillableCreatedAt

func (cuo *CommentUpdateOne) SetNillableCreatedAt(t *time.Time) *CommentUpdateOne

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

func (*CommentUpdateOne) SetNillablePostID

func (cuo *CommentUpdateOne) SetNillablePostID(u *uuid.UUID) *CommentUpdateOne

SetNillablePostID sets the "post_id" field if the given value is not nil.

func (*CommentUpdateOne) SetNillableSlug

func (cuo *CommentUpdateOne) SetNillableSlug(s *string) *CommentUpdateOne

SetNillableSlug sets the "slug" field if the given value is not nil.

func (*CommentUpdateOne) SetNillableText

func (cuo *CommentUpdateOne) SetNillableText(s *string) *CommentUpdateOne

SetNillableText sets the "text" field if the given value is not nil.

func (*CommentUpdateOne) SetPost

func (cuo *CommentUpdateOne) SetPost(p *Post) *CommentUpdateOne

SetPost sets the "post" edge to the Post entity.

func (*CommentUpdateOne) SetPostID

func (cuo *CommentUpdateOne) SetPostID(u uuid.UUID) *CommentUpdateOne

SetPostID sets the "post_id" field.

func (*CommentUpdateOne) SetSlug

func (cuo *CommentUpdateOne) SetSlug(s string) *CommentUpdateOne

SetSlug sets the "slug" field.

func (*CommentUpdateOne) SetText

func (cuo *CommentUpdateOne) SetText(s string) *CommentUpdateOne

SetText sets the "text" field.

func (*CommentUpdateOne) SetUpdatedAt

func (cuo *CommentUpdateOne) SetUpdatedAt(t time.Time) *CommentUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*CommentUpdateOne) Where

Where appends a list predicates to the CommentUpdate builder.

type Comments

type Comments []*Comment

Comments is a parsable slice of Comment.

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 Countries

type Countries []*Country

Countries is a parsable slice of Country.

type Country

type Country struct {

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

Country is the model entity for the Country schema.

func (*Country) QueryCities

func (c *Country) QueryCities() *CityQuery

QueryCities queries the "cities" edge of the Country entity.

func (*Country) QueryRegions

func (c *Country) QueryRegions() *RegionQuery

QueryRegions queries the "regions" edge of the Country entity.

func (*Country) String

func (c *Country) String() string

String implements the fmt.Stringer.

func (*Country) Unwrap

func (c *Country) Unwrap() *Country

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

func (c *Country) Update() *CountryUpdateOne

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

func (*Country) Value

func (c *Country) Value(name string) (ent.Value, error)

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

type CountryClient

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

CountryClient is a client for the Country schema.

func NewCountryClient

func NewCountryClient(c config) *CountryClient

NewCountryClient returns a client for the Country from the given config.

func (*CountryClient) Create

func (c *CountryClient) Create() *CountryCreate

Create returns a builder for creating a Country entity.

func (*CountryClient) CreateBulk

func (c *CountryClient) CreateBulk(builders ...*CountryCreate) *CountryCreateBulk

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

func (*CountryClient) Delete

func (c *CountryClient) Delete() *CountryDelete

Delete returns a delete builder for Country.

func (*CountryClient) DeleteOne

func (c *CountryClient) DeleteOne(co *Country) *CountryDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CountryClient) DeleteOneID

func (c *CountryClient) DeleteOneID(id uuid.UUID) *CountryDeleteOne

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

func (*CountryClient) Get

func (c *CountryClient) Get(ctx context.Context, id uuid.UUID) (*Country, error)

Get returns a Country entity by its id.

func (*CountryClient) GetX

func (c *CountryClient) GetX(ctx context.Context, id uuid.UUID) *Country

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

func (*CountryClient) Hooks

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

Hooks returns the client hooks.

func (*CountryClient) Intercept

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

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

func (*CountryClient) Interceptors

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

Interceptors returns the client interceptors.

func (*CountryClient) MapCreateBulk

func (c *CountryClient) MapCreateBulk(slice any, setFunc func(*CountryCreate, int)) *CountryCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*CountryClient) Query

func (c *CountryClient) Query() *CountryQuery

Query returns a query builder for Country.

func (*CountryClient) QueryCities

func (c *CountryClient) QueryCities(co *Country) *CityQuery

QueryCities queries the cities edge of a Country.

func (*CountryClient) QueryRegions

func (c *CountryClient) QueryRegions(co *Country) *RegionQuery

QueryRegions queries the regions edge of a Country.

func (*CountryClient) Update

func (c *CountryClient) Update() *CountryUpdate

Update returns an update builder for Country.

func (*CountryClient) UpdateOne

func (c *CountryClient) UpdateOne(co *Country) *CountryUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CountryClient) UpdateOneID

func (c *CountryClient) UpdateOneID(id uuid.UUID) *CountryUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CountryClient) Use

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

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

type CountryCreate

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

CountryCreate is the builder for creating a Country entity.

func (*CountryCreate) AddCities

func (cc *CountryCreate) AddCities(c ...*City) *CountryCreate

AddCities adds the "cities" edges to the City entity.

func (*CountryCreate) AddCityIDs

func (cc *CountryCreate) AddCityIDs(ids ...uuid.UUID) *CountryCreate

AddCityIDs adds the "cities" edge to the City entity by IDs.

func (*CountryCreate) AddRegionIDs

func (cc *CountryCreate) AddRegionIDs(ids ...uuid.UUID) *CountryCreate

AddRegionIDs adds the "regions" edge to the Region entity by IDs.

func (*CountryCreate) AddRegions

func (cc *CountryCreate) AddRegions(r ...*Region) *CountryCreate

AddRegions adds the "regions" edges to the Region entity.

func (*CountryCreate) Exec

func (cc *CountryCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*CountryCreate) ExecX

func (cc *CountryCreate) ExecX(ctx context.Context)

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

func (*CountryCreate) Mutation

func (cc *CountryCreate) Mutation() *CountryMutation

Mutation returns the CountryMutation object of the builder.

func (*CountryCreate) Save

func (cc *CountryCreate) Save(ctx context.Context) (*Country, error)

Save creates the Country in the database.

func (*CountryCreate) SaveX

func (cc *CountryCreate) SaveX(ctx context.Context) *Country

SaveX calls Save and panics if Save returns an error.

func (*CountryCreate) SetCode

func (cc *CountryCreate) SetCode(s string) *CountryCreate

SetCode sets the "code" field.

func (*CountryCreate) SetCreatedAt

func (cc *CountryCreate) SetCreatedAt(t time.Time) *CountryCreate

SetCreatedAt sets the "created_at" field.

func (*CountryCreate) SetID

func (cc *CountryCreate) SetID(u uuid.UUID) *CountryCreate

SetID sets the "id" field.

func (*CountryCreate) SetName

func (cc *CountryCreate) SetName(s string) *CountryCreate

SetName sets the "name" field.

func (*CountryCreate) SetNillableCreatedAt

func (cc *CountryCreate) SetNillableCreatedAt(t *time.Time) *CountryCreate

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

func (*CountryCreate) SetNillableID

func (cc *CountryCreate) SetNillableID(u *uuid.UUID) *CountryCreate

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

func (*CountryCreate) SetNillableUpdatedAt

func (cc *CountryCreate) SetNillableUpdatedAt(t *time.Time) *CountryCreate

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

func (*CountryCreate) SetUpdatedAt

func (cc *CountryCreate) SetUpdatedAt(t time.Time) *CountryCreate

SetUpdatedAt sets the "updated_at" field.

type CountryCreateBulk

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

CountryCreateBulk is the builder for creating many Country entities in bulk.

func (*CountryCreateBulk) Exec

func (ccb *CountryCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*CountryCreateBulk) ExecX

func (ccb *CountryCreateBulk) ExecX(ctx context.Context)

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

func (*CountryCreateBulk) Save

func (ccb *CountryCreateBulk) Save(ctx context.Context) ([]*Country, error)

Save creates the Country entities in the database.

func (*CountryCreateBulk) SaveX

func (ccb *CountryCreateBulk) SaveX(ctx context.Context) []*Country

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

type CountryDelete

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

CountryDelete is the builder for deleting a Country entity.

func (*CountryDelete) Exec

func (cd *CountryDelete) Exec(ctx context.Context) (int, error)

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

func (*CountryDelete) ExecX

func (cd *CountryDelete) ExecX(ctx context.Context) int

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

func (*CountryDelete) Where

func (cd *CountryDelete) Where(ps ...predicate.Country) *CountryDelete

Where appends a list predicates to the CountryDelete builder.

type CountryDeleteOne

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

CountryDeleteOne is the builder for deleting a single Country entity.

func (*CountryDeleteOne) Exec

func (cdo *CountryDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*CountryDeleteOne) ExecX

func (cdo *CountryDeleteOne) ExecX(ctx context.Context)

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

func (*CountryDeleteOne) Where

Where appends a list predicates to the CountryDelete builder.

type CountryEdges

type CountryEdges struct {
	// Cities holds the value of the cities edge.
	Cities []*City `json:"cities,omitempty"`
	// Regions holds the value of the regions edge.
	Regions []*Region `json:"regions,omitempty"`
	// contains filtered or unexported fields
}

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

func (CountryEdges) CitiesOrErr

func (e CountryEdges) CitiesOrErr() ([]*City, error)

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

func (CountryEdges) RegionsOrErr

func (e CountryEdges) RegionsOrErr() ([]*Region, error)

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

type CountryGroupBy

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

CountryGroupBy is the group-by builder for Country entities.

func (*CountryGroupBy) Aggregate

func (cgb *CountryGroupBy) Aggregate(fns ...AggregateFunc) *CountryGroupBy

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

func (*CountryGroupBy) Bool

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

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

func (*CountryGroupBy) BoolX

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

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

func (*CountryGroupBy) Bools

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

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

func (*CountryGroupBy) BoolsX

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

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

func (*CountryGroupBy) Float64

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

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

func (*CountryGroupBy) Float64X

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

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

func (*CountryGroupBy) Float64s

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

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

func (*CountryGroupBy) Float64sX

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

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

func (*CountryGroupBy) Int

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

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

func (*CountryGroupBy) IntX

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

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

func (*CountryGroupBy) Ints

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

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

func (*CountryGroupBy) IntsX

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

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

func (*CountryGroupBy) Scan

func (cgb *CountryGroupBy) Scan(ctx context.Context, v any) error

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

func (*CountryGroupBy) ScanX

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

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

func (*CountryGroupBy) String

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

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

func (*CountryGroupBy) StringX

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

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

func (*CountryGroupBy) Strings

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

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

func (*CountryGroupBy) StringsX

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

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

type CountryMutation

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

CountryMutation represents an operation that mutates the Country nodes in the graph.

func (*CountryMutation) AddCityIDs

func (m *CountryMutation) AddCityIDs(ids ...uuid.UUID)

AddCityIDs adds the "cities" edge to the City entity by ids.

func (*CountryMutation) AddField

func (m *CountryMutation) 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 (*CountryMutation) AddRegionIDs

func (m *CountryMutation) AddRegionIDs(ids ...uuid.UUID)

AddRegionIDs adds the "regions" edge to the Region entity by ids.

func (*CountryMutation) AddedEdges

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

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

func (*CountryMutation) AddedField

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

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

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

func (*CountryMutation) AddedIDs

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

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

func (*CountryMutation) CitiesCleared

func (m *CountryMutation) CitiesCleared() bool

CitiesCleared reports if the "cities" edge to the City entity was cleared.

func (*CountryMutation) CitiesIDs

func (m *CountryMutation) CitiesIDs() (ids []uuid.UUID)

CitiesIDs returns the "cities" edge IDs in the mutation.

func (*CountryMutation) ClearCities

func (m *CountryMutation) ClearCities()

ClearCities clears the "cities" edge to the City entity.

func (*CountryMutation) ClearEdge

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

func (m *CountryMutation) 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 (*CountryMutation) ClearRegions

func (m *CountryMutation) ClearRegions()

ClearRegions clears the "regions" edge to the Region entity.

func (*CountryMutation) ClearedEdges

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

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

func (*CountryMutation) ClearedFields

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

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

func (CountryMutation) Client

func (m CountryMutation) 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 (*CountryMutation) Code

func (m *CountryMutation) Code() (r string, exists bool)

Code returns the value of the "code" field in the mutation.

func (*CountryMutation) CreatedAt

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

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

func (*CountryMutation) EdgeCleared

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

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

func (*CountryMutation) Field

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

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

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

func (*CountryMutation) Fields

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

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

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

func (*CountryMutation) IDs

func (m *CountryMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*CountryMutation) Name

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

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

func (*CountryMutation) OldCode

func (m *CountryMutation) OldCode(ctx context.Context) (v string, err error)

OldCode returns the old "code" field's value of the Country entity. If the Country 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 (*CountryMutation) OldCreatedAt

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

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

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

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

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

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

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

func (m *CountryMutation) Op() Op

Op returns the operation name.

func (*CountryMutation) RegionsCleared

func (m *CountryMutation) RegionsCleared() bool

RegionsCleared reports if the "regions" edge to the Region entity was cleared.

func (*CountryMutation) RegionsIDs

func (m *CountryMutation) RegionsIDs() (ids []uuid.UUID)

RegionsIDs returns the "regions" edge IDs in the mutation.

func (*CountryMutation) RemoveCityIDs

func (m *CountryMutation) RemoveCityIDs(ids ...uuid.UUID)

RemoveCityIDs removes the "cities" edge to the City entity by IDs.

func (*CountryMutation) RemoveRegionIDs

func (m *CountryMutation) RemoveRegionIDs(ids ...uuid.UUID)

RemoveRegionIDs removes the "regions" edge to the Region entity by IDs.

func (*CountryMutation) RemovedCitiesIDs

func (m *CountryMutation) RemovedCitiesIDs() (ids []uuid.UUID)

RemovedCities returns the removed IDs of the "cities" edge to the City entity.

func (*CountryMutation) RemovedEdges

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

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

func (*CountryMutation) RemovedIDs

func (m *CountryMutation) 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 (*CountryMutation) RemovedRegionsIDs

func (m *CountryMutation) RemovedRegionsIDs() (ids []uuid.UUID)

RemovedRegions returns the removed IDs of the "regions" edge to the Region entity.

func (*CountryMutation) ResetCities

func (m *CountryMutation) ResetCities()

ResetCities resets all changes to the "cities" edge.

func (*CountryMutation) ResetCode

func (m *CountryMutation) ResetCode()

ResetCode resets all changes to the "code" field.

func (*CountryMutation) ResetCreatedAt

func (m *CountryMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*CountryMutation) ResetEdge

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

func (m *CountryMutation) 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 (*CountryMutation) ResetName

func (m *CountryMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*CountryMutation) ResetRegions

func (m *CountryMutation) ResetRegions()

ResetRegions resets all changes to the "regions" edge.

func (*CountryMutation) ResetUpdatedAt

func (m *CountryMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*CountryMutation) SetCode

func (m *CountryMutation) SetCode(s string)

SetCode sets the "code" field.

func (*CountryMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*CountryMutation) SetField

func (m *CountryMutation) 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 (*CountryMutation) SetID

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

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

func (*CountryMutation) SetName

func (m *CountryMutation) SetName(s string)

SetName sets the "name" field.

func (*CountryMutation) SetOp

func (m *CountryMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CountryMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (CountryMutation) Tx

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

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

func (*CountryMutation) Type

func (m *CountryMutation) Type() string

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

func (*CountryMutation) UpdatedAt

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

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

func (*CountryMutation) Where

func (m *CountryMutation) Where(ps ...predicate.Country)

Where appends a list predicates to the CountryMutation builder.

func (*CountryMutation) WhereP

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

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

type CountryQuery

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

CountryQuery is the builder for querying Country entities.

func (*CountryQuery) Aggregate

func (cq *CountryQuery) Aggregate(fns ...AggregateFunc) *CountrySelect

Aggregate returns a CountrySelect configured with the given aggregations.

func (*CountryQuery) All

func (cq *CountryQuery) All(ctx context.Context) ([]*Country, error)

All executes the query and returns a list of Countries.

func (*CountryQuery) AllX

func (cq *CountryQuery) AllX(ctx context.Context) []*Country

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

func (*CountryQuery) Clone

func (cq *CountryQuery) Clone() *CountryQuery

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

func (*CountryQuery) Count

func (cq *CountryQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CountryQuery) CountX

func (cq *CountryQuery) CountX(ctx context.Context) int

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

func (*CountryQuery) Exist

func (cq *CountryQuery) Exist(ctx context.Context) (bool, error)

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

func (*CountryQuery) ExistX

func (cq *CountryQuery) ExistX(ctx context.Context) bool

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

func (*CountryQuery) First

func (cq *CountryQuery) First(ctx context.Context) (*Country, error)

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

func (*CountryQuery) FirstID

func (cq *CountryQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*CountryQuery) FirstIDX

func (cq *CountryQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*CountryQuery) FirstX

func (cq *CountryQuery) FirstX(ctx context.Context) *Country

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

func (*CountryQuery) GroupBy

func (cq *CountryQuery) GroupBy(field string, fields ...string) *CountryGroupBy

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

Example:

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

client.Country.Query().
	GroupBy(country.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CountryQuery) IDs

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

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

func (*CountryQuery) IDsX

func (cq *CountryQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*CountryQuery) Limit

func (cq *CountryQuery) Limit(limit int) *CountryQuery

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

func (*CountryQuery) Offset

func (cq *CountryQuery) Offset(offset int) *CountryQuery

Offset to start from.

func (*CountryQuery) Only

func (cq *CountryQuery) Only(ctx context.Context) (*Country, error)

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

func (*CountryQuery) OnlyID

func (cq *CountryQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*CountryQuery) OnlyIDX

func (cq *CountryQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*CountryQuery) OnlyX

func (cq *CountryQuery) OnlyX(ctx context.Context) *Country

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

func (*CountryQuery) Order

func (cq *CountryQuery) Order(o ...country.OrderOption) *CountryQuery

Order specifies how the records should be ordered.

func (*CountryQuery) QueryCities

func (cq *CountryQuery) QueryCities() *CityQuery

QueryCities chains the current query on the "cities" edge.

func (*CountryQuery) QueryRegions

func (cq *CountryQuery) QueryRegions() *RegionQuery

QueryRegions chains the current query on the "regions" edge.

func (*CountryQuery) Select

func (cq *CountryQuery) Select(fields ...string) *CountrySelect

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

Example:

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

client.Country.Query().
	Select(country.FieldCreatedAt).
	Scan(ctx, &v)

func (*CountryQuery) Unique

func (cq *CountryQuery) Unique(unique bool) *CountryQuery

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

func (cq *CountryQuery) Where(ps ...predicate.Country) *CountryQuery

Where adds a new predicate for the CountryQuery builder.

func (*CountryQuery) WithCities

func (cq *CountryQuery) WithCities(opts ...func(*CityQuery)) *CountryQuery

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

func (*CountryQuery) WithRegions

func (cq *CountryQuery) WithRegions(opts ...func(*RegionQuery)) *CountryQuery

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

type CountrySelect

type CountrySelect struct {
	*CountryQuery
	// contains filtered or unexported fields
}

CountrySelect is the builder for selecting fields of Country entities.

func (*CountrySelect) Aggregate

func (cs *CountrySelect) Aggregate(fns ...AggregateFunc) *CountrySelect

Aggregate adds the given aggregation functions to the selector query.

func (*CountrySelect) Bool

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

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

func (*CountrySelect) BoolX

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

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

func (*CountrySelect) Bools

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

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

func (*CountrySelect) BoolsX

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

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

func (*CountrySelect) Float64

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

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

func (*CountrySelect) Float64X

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

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

func (*CountrySelect) Float64s

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

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

func (*CountrySelect) Float64sX

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

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

func (*CountrySelect) Int

func (s *CountrySelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*CountrySelect) IntX

func (s *CountrySelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*CountrySelect) Ints

func (s *CountrySelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*CountrySelect) IntsX

func (s *CountrySelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*CountrySelect) Scan

func (cs *CountrySelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*CountrySelect) ScanX

func (s *CountrySelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*CountrySelect) String

func (s *CountrySelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*CountrySelect) StringX

func (s *CountrySelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*CountrySelect) Strings

func (s *CountrySelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*CountrySelect) StringsX

func (s *CountrySelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type CountryUpdate

type CountryUpdate struct {
	// contains filtered or unexported fields
}

CountryUpdate is the builder for updating Country entities.

func (*CountryUpdate) AddCities

func (cu *CountryUpdate) AddCities(c ...*City) *CountryUpdate

AddCities adds the "cities" edges to the City entity.

func (*CountryUpdate) AddCityIDs

func (cu *CountryUpdate) AddCityIDs(ids ...uuid.UUID) *CountryUpdate

AddCityIDs adds the "cities" edge to the City entity by IDs.

func (*CountryUpdate) AddRegionIDs

func (cu *CountryUpdate) AddRegionIDs(ids ...uuid.UUID) *CountryUpdate

AddRegionIDs adds the "regions" edge to the Region entity by IDs.

func (*CountryUpdate) AddRegions

func (cu *CountryUpdate) AddRegions(r ...*Region) *CountryUpdate

AddRegions adds the "regions" edges to the Region entity.

func (*CountryUpdate) ClearCities

func (cu *CountryUpdate) ClearCities() *CountryUpdate

ClearCities clears all "cities" edges to the City entity.

func (*CountryUpdate) ClearRegions

func (cu *CountryUpdate) ClearRegions() *CountryUpdate

ClearRegions clears all "regions" edges to the Region entity.

func (*CountryUpdate) Exec

func (cu *CountryUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CountryUpdate) ExecX

func (cu *CountryUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CountryUpdate) Mutation

func (cu *CountryUpdate) Mutation() *CountryMutation

Mutation returns the CountryMutation object of the builder.

func (*CountryUpdate) RemoveCities

func (cu *CountryUpdate) RemoveCities(c ...*City) *CountryUpdate

RemoveCities removes "cities" edges to City entities.

func (*CountryUpdate) RemoveCityIDs

func (cu *CountryUpdate) RemoveCityIDs(ids ...uuid.UUID) *CountryUpdate

RemoveCityIDs removes the "cities" edge to City entities by IDs.

func (*CountryUpdate) RemoveRegionIDs

func (cu *CountryUpdate) RemoveRegionIDs(ids ...uuid.UUID) *CountryUpdate

RemoveRegionIDs removes the "regions" edge to Region entities by IDs.

func (*CountryUpdate) RemoveRegions

func (cu *CountryUpdate) RemoveRegions(r ...*Region) *CountryUpdate

RemoveRegions removes "regions" edges to Region entities.

func (*CountryUpdate) Save

func (cu *CountryUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*CountryUpdate) SaveX

func (cu *CountryUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*CountryUpdate) SetCode

func (cu *CountryUpdate) SetCode(s string) *CountryUpdate

SetCode sets the "code" field.

func (*CountryUpdate) SetCreatedAt

func (cu *CountryUpdate) SetCreatedAt(t time.Time) *CountryUpdate

SetCreatedAt sets the "created_at" field.

func (*CountryUpdate) SetName

func (cu *CountryUpdate) SetName(s string) *CountryUpdate

SetName sets the "name" field.

func (*CountryUpdate) SetNillableCode

func (cu *CountryUpdate) SetNillableCode(s *string) *CountryUpdate

SetNillableCode sets the "code" field if the given value is not nil.

func (*CountryUpdate) SetNillableCreatedAt

func (cu *CountryUpdate) SetNillableCreatedAt(t *time.Time) *CountryUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*CountryUpdate) SetNillableName

func (cu *CountryUpdate) SetNillableName(s *string) *CountryUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*CountryUpdate) SetUpdatedAt

func (cu *CountryUpdate) SetUpdatedAt(t time.Time) *CountryUpdate

SetUpdatedAt sets the "updated_at" field.

func (*CountryUpdate) Where

func (cu *CountryUpdate) Where(ps ...predicate.Country) *CountryUpdate

Where appends a list predicates to the CountryUpdate builder.

type CountryUpdateOne

type CountryUpdateOne struct {
	// contains filtered or unexported fields
}

CountryUpdateOne is the builder for updating a single Country entity.

func (*CountryUpdateOne) AddCities

func (cuo *CountryUpdateOne) AddCities(c ...*City) *CountryUpdateOne

AddCities adds the "cities" edges to the City entity.

func (*CountryUpdateOne) AddCityIDs

func (cuo *CountryUpdateOne) AddCityIDs(ids ...uuid.UUID) *CountryUpdateOne

AddCityIDs adds the "cities" edge to the City entity by IDs.

func (*CountryUpdateOne) AddRegionIDs

func (cuo *CountryUpdateOne) AddRegionIDs(ids ...uuid.UUID) *CountryUpdateOne

AddRegionIDs adds the "regions" edge to the Region entity by IDs.

func (*CountryUpdateOne) AddRegions

func (cuo *CountryUpdateOne) AddRegions(r ...*Region) *CountryUpdateOne

AddRegions adds the "regions" edges to the Region entity.

func (*CountryUpdateOne) ClearCities

func (cuo *CountryUpdateOne) ClearCities() *CountryUpdateOne

ClearCities clears all "cities" edges to the City entity.

func (*CountryUpdateOne) ClearRegions

func (cuo *CountryUpdateOne) ClearRegions() *CountryUpdateOne

ClearRegions clears all "regions" edges to the Region entity.

func (*CountryUpdateOne) Exec

func (cuo *CountryUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CountryUpdateOne) ExecX

func (cuo *CountryUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CountryUpdateOne) Mutation

func (cuo *CountryUpdateOne) Mutation() *CountryMutation

Mutation returns the CountryMutation object of the builder.

func (*CountryUpdateOne) RemoveCities

func (cuo *CountryUpdateOne) RemoveCities(c ...*City) *CountryUpdateOne

RemoveCities removes "cities" edges to City entities.

func (*CountryUpdateOne) RemoveCityIDs

func (cuo *CountryUpdateOne) RemoveCityIDs(ids ...uuid.UUID) *CountryUpdateOne

RemoveCityIDs removes the "cities" edge to City entities by IDs.

func (*CountryUpdateOne) RemoveRegionIDs

func (cuo *CountryUpdateOne) RemoveRegionIDs(ids ...uuid.UUID) *CountryUpdateOne

RemoveRegionIDs removes the "regions" edge to Region entities by IDs.

func (*CountryUpdateOne) RemoveRegions

func (cuo *CountryUpdateOne) RemoveRegions(r ...*Region) *CountryUpdateOne

RemoveRegions removes "regions" edges to Region entities.

func (*CountryUpdateOne) Save

func (cuo *CountryUpdateOne) Save(ctx context.Context) (*Country, error)

Save executes the query and returns the updated Country entity.

func (*CountryUpdateOne) SaveX

func (cuo *CountryUpdateOne) SaveX(ctx context.Context) *Country

SaveX is like Save, but panics if an error occurs.

func (*CountryUpdateOne) Select

func (cuo *CountryUpdateOne) Select(field string, fields ...string) *CountryUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*CountryUpdateOne) SetCode

func (cuo *CountryUpdateOne) SetCode(s string) *CountryUpdateOne

SetCode sets the "code" field.

func (*CountryUpdateOne) SetCreatedAt

func (cuo *CountryUpdateOne) SetCreatedAt(t time.Time) *CountryUpdateOne

SetCreatedAt sets the "created_at" field.

func (*CountryUpdateOne) SetName

func (cuo *CountryUpdateOne) SetName(s string) *CountryUpdateOne

SetName sets the "name" field.

func (*CountryUpdateOne) SetNillableCode

func (cuo *CountryUpdateOne) SetNillableCode(s *string) *CountryUpdateOne

SetNillableCode sets the "code" field if the given value is not nil.

func (*CountryUpdateOne) SetNillableCreatedAt

func (cuo *CountryUpdateOne) SetNillableCreatedAt(t *time.Time) *CountryUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*CountryUpdateOne) SetNillableName

func (cuo *CountryUpdateOne) SetNillableName(s *string) *CountryUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*CountryUpdateOne) SetUpdatedAt

func (cuo *CountryUpdateOne) SetUpdatedAt(t time.Time) *CountryUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*CountryUpdateOne) Where

Where appends a list predicates to the CountryUpdate builder.

type File

type File struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// ResourceType holds the value of the "resource_type" field.
	ResourceType string `json:"resource_type,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the FileQuery when eager-loading is set.
	Edges FileEdges `json:"edges"`
	// contains filtered or unexported fields
}

File is the model entity for the File schema.

func (*File) QueryChats

func (f *File) QueryChats() *ChatQuery

QueryChats queries the "chats" edge of the File entity.

func (*File) QueryMessages

func (f *File) QueryMessages() *MessageQuery

QueryMessages queries the "messages" edge of the File entity.

func (*File) QueryPosts

func (f *File) QueryPosts() *PostQuery

QueryPosts queries the "posts" edge of the File entity.

func (*File) QueryUsers

func (f *File) QueryUsers() *UserQuery

QueryUsers queries the "users" edge of the File entity.

func (*File) String

func (f *File) String() string

String implements the fmt.Stringer.

func (*File) Unwrap

func (f *File) Unwrap() *File

Unwrap unwraps the File 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 (*File) Update

func (f *File) Update() *FileUpdateOne

Update returns a builder for updating this File. Note that you need to call File.Unwrap() before calling this method if this File was returned from a transaction, and the transaction was committed or rolled back.

func (*File) Value

func (f *File) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the File. This includes values selected through modifiers, order, etc.

type FileClient

type FileClient struct {
	// contains filtered or unexported fields
}

FileClient is a client for the File schema.

func NewFileClient

func NewFileClient(c config) *FileClient

NewFileClient returns a client for the File from the given config.

func (*FileClient) Create

func (c *FileClient) Create() *FileCreate

Create returns a builder for creating a File entity.

func (*FileClient) CreateBulk

func (c *FileClient) CreateBulk(builders ...*FileCreate) *FileCreateBulk

CreateBulk returns a builder for creating a bulk of File entities.

func (*FileClient) Delete

func (c *FileClient) Delete() *FileDelete

Delete returns a delete builder for File.

func (*FileClient) DeleteOne

func (c *FileClient) DeleteOne(f *File) *FileDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*FileClient) DeleteOneID

func (c *FileClient) DeleteOneID(id uuid.UUID) *FileDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*FileClient) Get

func (c *FileClient) Get(ctx context.Context, id uuid.UUID) (*File, error)

Get returns a File entity by its id.

func (*FileClient) GetX

func (c *FileClient) GetX(ctx context.Context, id uuid.UUID) *File

GetX is like Get, but panics if an error occurs.

func (*FileClient) Hooks

func (c *FileClient) Hooks() []Hook

Hooks returns the client hooks.

func (*FileClient) Intercept

func (c *FileClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `file.Intercept(f(g(h())))`.

func (*FileClient) Interceptors

func (c *FileClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*FileClient) MapCreateBulk

func (c *FileClient) MapCreateBulk(slice any, setFunc func(*FileCreate, int)) *FileCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*FileClient) Query

func (c *FileClient) Query() *FileQuery

Query returns a query builder for File.

func (*FileClient) QueryChats

func (c *FileClient) QueryChats(f *File) *ChatQuery

QueryChats queries the chats edge of a File.

func (*FileClient) QueryMessages

func (c *FileClient) QueryMessages(f *File) *MessageQuery

QueryMessages queries the messages edge of a File.

func (*FileClient) QueryPosts

func (c *FileClient) QueryPosts(f *File) *PostQuery

QueryPosts queries the posts edge of a File.

func (*FileClient) QueryUsers

func (c *FileClient) QueryUsers(f *File) *UserQuery

QueryUsers queries the users edge of a File.

func (*FileClient) Update

func (c *FileClient) Update() *FileUpdate

Update returns an update builder for File.

func (*FileClient) UpdateOne

func (c *FileClient) UpdateOne(f *File) *FileUpdateOne

UpdateOne returns an update builder for the given entity.

func (*FileClient) UpdateOneID

func (c *FileClient) UpdateOneID(id uuid.UUID) *FileUpdateOne

UpdateOneID returns an update builder for the given id.

func (*FileClient) Use

func (c *FileClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `file.Hooks(f(g(h())))`.

type FileCreate

type FileCreate struct {
	// contains filtered or unexported fields
}

FileCreate is the builder for creating a File entity.

func (*FileCreate) AddChatIDs

func (fc *FileCreate) AddChatIDs(ids ...uuid.UUID) *FileCreate

AddChatIDs adds the "chats" edge to the Chat entity by IDs.

func (*FileCreate) AddChats

func (fc *FileCreate) AddChats(c ...*Chat) *FileCreate

AddChats adds the "chats" edges to the Chat entity.

func (*FileCreate) AddMessageIDs

func (fc *FileCreate) AddMessageIDs(ids ...uuid.UUID) *FileCreate

AddMessageIDs adds the "messages" edge to the Message entity by IDs.

func (*FileCreate) AddMessages

func (fc *FileCreate) AddMessages(m ...*Message) *FileCreate

AddMessages adds the "messages" edges to the Message entity.

func (*FileCreate) AddPostIDs

func (fc *FileCreate) AddPostIDs(ids ...uuid.UUID) *FileCreate

AddPostIDs adds the "posts" edge to the Post entity by IDs.

func (*FileCreate) AddPosts

func (fc *FileCreate) AddPosts(p ...*Post) *FileCreate

AddPosts adds the "posts" edges to the Post entity.

func (*FileCreate) AddUserIDs

func (fc *FileCreate) AddUserIDs(ids ...uuid.UUID) *FileCreate

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*FileCreate) AddUsers

func (fc *FileCreate) AddUsers(u ...*User) *FileCreate

AddUsers adds the "users" edges to the User entity.

func (*FileCreate) Exec

func (fc *FileCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*FileCreate) ExecX

func (fc *FileCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FileCreate) Mutation

func (fc *FileCreate) Mutation() *FileMutation

Mutation returns the FileMutation object of the builder.

func (*FileCreate) Save

func (fc *FileCreate) Save(ctx context.Context) (*File, error)

Save creates the File in the database.

func (*FileCreate) SaveX

func (fc *FileCreate) SaveX(ctx context.Context) *File

SaveX calls Save and panics if Save returns an error.

func (*FileCreate) SetCreatedAt

func (fc *FileCreate) SetCreatedAt(t time.Time) *FileCreate

SetCreatedAt sets the "created_at" field.

func (*FileCreate) SetID

func (fc *FileCreate) SetID(u uuid.UUID) *FileCreate

SetID sets the "id" field.

func (*FileCreate) SetNillableCreatedAt

func (fc *FileCreate) SetNillableCreatedAt(t *time.Time) *FileCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*FileCreate) SetNillableID

func (fc *FileCreate) SetNillableID(u *uuid.UUID) *FileCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*FileCreate) SetNillableUpdatedAt

func (fc *FileCreate) SetNillableUpdatedAt(t *time.Time) *FileCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*FileCreate) SetResourceType

func (fc *FileCreate) SetResourceType(s string) *FileCreate

SetResourceType sets the "resource_type" field.

func (*FileCreate) SetUpdatedAt

func (fc *FileCreate) SetUpdatedAt(t time.Time) *FileCreate

SetUpdatedAt sets the "updated_at" field.

type FileCreateBulk

type FileCreateBulk struct {
	// contains filtered or unexported fields
}

FileCreateBulk is the builder for creating many File entities in bulk.

func (*FileCreateBulk) Exec

func (fcb *FileCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*FileCreateBulk) ExecX

func (fcb *FileCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FileCreateBulk) Save

func (fcb *FileCreateBulk) Save(ctx context.Context) ([]*File, error)

Save creates the File entities in the database.

func (*FileCreateBulk) SaveX

func (fcb *FileCreateBulk) SaveX(ctx context.Context) []*File

SaveX is like Save, but panics if an error occurs.

type FileDelete

type FileDelete struct {
	// contains filtered or unexported fields
}

FileDelete is the builder for deleting a File entity.

func (*FileDelete) Exec

func (fd *FileDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*FileDelete) ExecX

func (fd *FileDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*FileDelete) Where

func (fd *FileDelete) Where(ps ...predicate.File) *FileDelete

Where appends a list predicates to the FileDelete builder.

type FileDeleteOne

type FileDeleteOne struct {
	// contains filtered or unexported fields
}

FileDeleteOne is the builder for deleting a single File entity.

func (*FileDeleteOne) Exec

func (fdo *FileDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*FileDeleteOne) ExecX

func (fdo *FileDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FileDeleteOne) Where

func (fdo *FileDeleteOne) Where(ps ...predicate.File) *FileDeleteOne

Where appends a list predicates to the FileDelete builder.

type FileEdges

type FileEdges struct {
	// Users holds the value of the users edge.
	Users []*User `json:"users,omitempty"`
	// Posts holds the value of the posts edge.
	Posts []*Post `json:"posts,omitempty"`
	// Chats holds the value of the chats edge.
	Chats []*Chat `json:"chats,omitempty"`
	// Messages holds the value of the messages edge.
	Messages []*Message `json:"messages,omitempty"`
	// contains filtered or unexported fields
}

FileEdges holds the relations/edges for other nodes in the graph.

func (FileEdges) ChatsOrErr

func (e FileEdges) ChatsOrErr() ([]*Chat, error)

ChatsOrErr returns the Chats value or an error if the edge was not loaded in eager-loading.

func (FileEdges) MessagesOrErr

func (e FileEdges) MessagesOrErr() ([]*Message, error)

MessagesOrErr returns the Messages value or an error if the edge was not loaded in eager-loading.

func (FileEdges) PostsOrErr

func (e FileEdges) PostsOrErr() ([]*Post, error)

PostsOrErr returns the Posts value or an error if the edge was not loaded in eager-loading.

func (FileEdges) UsersOrErr

func (e FileEdges) UsersOrErr() ([]*User, error)

UsersOrErr returns the Users value or an error if the edge was not loaded in eager-loading.

type FileGroupBy

type FileGroupBy struct {
	// contains filtered or unexported fields
}

FileGroupBy is the group-by builder for File entities.

func (*FileGroupBy) Aggregate

func (fgb *FileGroupBy) Aggregate(fns ...AggregateFunc) *FileGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*FileGroupBy) Bool

func (s *FileGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*FileGroupBy) BoolX

func (s *FileGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*FileGroupBy) Bools

func (s *FileGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*FileGroupBy) BoolsX

func (s *FileGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*FileGroupBy) Float64

func (s *FileGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*FileGroupBy) Float64X

func (s *FileGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*FileGroupBy) Float64s

func (s *FileGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*FileGroupBy) Float64sX

func (s *FileGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*FileGroupBy) Int

func (s *FileGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*FileGroupBy) IntX

func (s *FileGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*FileGroupBy) Ints

func (s *FileGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*FileGroupBy) IntsX

func (s *FileGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*FileGroupBy) Scan

func (fgb *FileGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*FileGroupBy) ScanX

func (s *FileGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*FileGroupBy) String

func (s *FileGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*FileGroupBy) StringX

func (s *FileGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*FileGroupBy) Strings

func (s *FileGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*FileGroupBy) StringsX

func (s *FileGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type FileMutation

type FileMutation struct {
	// contains filtered or unexported fields
}

FileMutation represents an operation that mutates the File nodes in the graph.

func (*FileMutation) AddChatIDs

func (m *FileMutation) AddChatIDs(ids ...uuid.UUID)

AddChatIDs adds the "chats" edge to the Chat entity by ids.

func (*FileMutation) AddField

func (m *FileMutation) 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 (*FileMutation) AddMessageIDs

func (m *FileMutation) AddMessageIDs(ids ...uuid.UUID)

AddMessageIDs adds the "messages" edge to the Message entity by ids.

func (*FileMutation) AddPostIDs

func (m *FileMutation) AddPostIDs(ids ...uuid.UUID)

AddPostIDs adds the "posts" edge to the Post entity by ids.

func (*FileMutation) AddUserIDs

func (m *FileMutation) AddUserIDs(ids ...uuid.UUID)

AddUserIDs adds the "users" edge to the User entity by ids.

func (*FileMutation) AddedEdges

func (m *FileMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*FileMutation) AddedField

func (m *FileMutation) 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 (*FileMutation) AddedFields

func (m *FileMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*FileMutation) AddedIDs

func (m *FileMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*FileMutation) ChatsCleared

func (m *FileMutation) ChatsCleared() bool

ChatsCleared reports if the "chats" edge to the Chat entity was cleared.

func (*FileMutation) ChatsIDs

func (m *FileMutation) ChatsIDs() (ids []uuid.UUID)

ChatsIDs returns the "chats" edge IDs in the mutation.

func (*FileMutation) ClearChats

func (m *FileMutation) ClearChats()

ClearChats clears the "chats" edge to the Chat entity.

func (*FileMutation) ClearEdge

func (m *FileMutation) 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 (*FileMutation) ClearField

func (m *FileMutation) 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 (*FileMutation) ClearMessages

func (m *FileMutation) ClearMessages()

ClearMessages clears the "messages" edge to the Message entity.

func (*FileMutation) ClearPosts

func (m *FileMutation) ClearPosts()

ClearPosts clears the "posts" edge to the Post entity.

func (*FileMutation) ClearUsers

func (m *FileMutation) ClearUsers()

ClearUsers clears the "users" edge to the User entity.

func (*FileMutation) ClearedEdges

func (m *FileMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*FileMutation) ClearedFields

func (m *FileMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (FileMutation) Client

func (m FileMutation) 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 (*FileMutation) CreatedAt

func (m *FileMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*FileMutation) EdgeCleared

func (m *FileMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*FileMutation) Field

func (m *FileMutation) 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 (*FileMutation) FieldCleared

func (m *FileMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*FileMutation) Fields

func (m *FileMutation) 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 (*FileMutation) ID

func (m *FileMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*FileMutation) IDs

func (m *FileMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*FileMutation) MessagesCleared

func (m *FileMutation) MessagesCleared() bool

MessagesCleared reports if the "messages" edge to the Message entity was cleared.

func (*FileMutation) MessagesIDs

func (m *FileMutation) MessagesIDs() (ids []uuid.UUID)

MessagesIDs returns the "messages" edge IDs in the mutation.

func (*FileMutation) OldCreatedAt

func (m *FileMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the File entity. If the File 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 (*FileMutation) OldField

func (m *FileMutation) 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 (*FileMutation) OldResourceType

func (m *FileMutation) OldResourceType(ctx context.Context) (v string, err error)

OldResourceType returns the old "resource_type" field's value of the File entity. If the File 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 (*FileMutation) OldUpdatedAt

func (m *FileMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the File entity. If the File 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 (*FileMutation) Op

func (m *FileMutation) Op() Op

Op returns the operation name.

func (*FileMutation) PostsCleared

func (m *FileMutation) PostsCleared() bool

PostsCleared reports if the "posts" edge to the Post entity was cleared.

func (*FileMutation) PostsIDs

func (m *FileMutation) PostsIDs() (ids []uuid.UUID)

PostsIDs returns the "posts" edge IDs in the mutation.

func (*FileMutation) RemoveChatIDs

func (m *FileMutation) RemoveChatIDs(ids ...uuid.UUID)

RemoveChatIDs removes the "chats" edge to the Chat entity by IDs.

func (*FileMutation) RemoveMessageIDs

func (m *FileMutation) RemoveMessageIDs(ids ...uuid.UUID)

RemoveMessageIDs removes the "messages" edge to the Message entity by IDs.

func (*FileMutation) RemovePostIDs

func (m *FileMutation) RemovePostIDs(ids ...uuid.UUID)

RemovePostIDs removes the "posts" edge to the Post entity by IDs.

func (*FileMutation) RemoveUserIDs

func (m *FileMutation) RemoveUserIDs(ids ...uuid.UUID)

RemoveUserIDs removes the "users" edge to the User entity by IDs.

func (*FileMutation) RemovedChatsIDs

func (m *FileMutation) RemovedChatsIDs() (ids []uuid.UUID)

RemovedChats returns the removed IDs of the "chats" edge to the Chat entity.

func (*FileMutation) RemovedEdges

func (m *FileMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*FileMutation) RemovedIDs

func (m *FileMutation) 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 (*FileMutation) RemovedMessagesIDs

func (m *FileMutation) RemovedMessagesIDs() (ids []uuid.UUID)

RemovedMessages returns the removed IDs of the "messages" edge to the Message entity.

func (*FileMutation) RemovedPostsIDs

func (m *FileMutation) RemovedPostsIDs() (ids []uuid.UUID)

RemovedPosts returns the removed IDs of the "posts" edge to the Post entity.

func (*FileMutation) RemovedUsersIDs

func (m *FileMutation) RemovedUsersIDs() (ids []uuid.UUID)

RemovedUsers returns the removed IDs of the "users" edge to the User entity.

func (*FileMutation) ResetChats

func (m *FileMutation) ResetChats()

ResetChats resets all changes to the "chats" edge.

func (*FileMutation) ResetCreatedAt

func (m *FileMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*FileMutation) ResetEdge

func (m *FileMutation) 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 (*FileMutation) ResetField

func (m *FileMutation) 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 (*FileMutation) ResetMessages

func (m *FileMutation) ResetMessages()

ResetMessages resets all changes to the "messages" edge.

func (*FileMutation) ResetPosts

func (m *FileMutation) ResetPosts()

ResetPosts resets all changes to the "posts" edge.

func (*FileMutation) ResetResourceType

func (m *FileMutation) ResetResourceType()

ResetResourceType resets all changes to the "resource_type" field.

func (*FileMutation) ResetUpdatedAt

func (m *FileMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*FileMutation) ResetUsers

func (m *FileMutation) ResetUsers()

ResetUsers resets all changes to the "users" edge.

func (*FileMutation) ResourceType

func (m *FileMutation) ResourceType() (r string, exists bool)

ResourceType returns the value of the "resource_type" field in the mutation.

func (*FileMutation) SetCreatedAt

func (m *FileMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*FileMutation) SetField

func (m *FileMutation) 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 (*FileMutation) SetID

func (m *FileMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of File entities.

func (*FileMutation) SetOp

func (m *FileMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*FileMutation) SetResourceType

func (m *FileMutation) SetResourceType(s string)

SetResourceType sets the "resource_type" field.

func (*FileMutation) SetUpdatedAt

func (m *FileMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (FileMutation) Tx

func (m FileMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*FileMutation) Type

func (m *FileMutation) Type() string

Type returns the node type of this mutation (File).

func (*FileMutation) UpdatedAt

func (m *FileMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*FileMutation) UsersCleared

func (m *FileMutation) UsersCleared() bool

UsersCleared reports if the "users" edge to the User entity was cleared.

func (*FileMutation) UsersIDs

func (m *FileMutation) UsersIDs() (ids []uuid.UUID)

UsersIDs returns the "users" edge IDs in the mutation.

func (*FileMutation) Where

func (m *FileMutation) Where(ps ...predicate.File)

Where appends a list predicates to the FileMutation builder.

func (*FileMutation) WhereP

func (m *FileMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the FileMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type FileQuery

type FileQuery struct {
	// contains filtered or unexported fields
}

FileQuery is the builder for querying File entities.

func (*FileQuery) Aggregate

func (fq *FileQuery) Aggregate(fns ...AggregateFunc) *FileSelect

Aggregate returns a FileSelect configured with the given aggregations.

func (*FileQuery) All

func (fq *FileQuery) All(ctx context.Context) ([]*File, error)

All executes the query and returns a list of Files.

func (*FileQuery) AllX

func (fq *FileQuery) AllX(ctx context.Context) []*File

AllX is like All, but panics if an error occurs.

func (*FileQuery) Clone

func (fq *FileQuery) Clone() *FileQuery

Clone returns a duplicate of the FileQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*FileQuery) Count

func (fq *FileQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*FileQuery) CountX

func (fq *FileQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*FileQuery) Exist

func (fq *FileQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*FileQuery) ExistX

func (fq *FileQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*FileQuery) First

func (fq *FileQuery) First(ctx context.Context) (*File, error)

First returns the first File entity from the query. Returns a *NotFoundError when no File was found.

func (*FileQuery) FirstID

func (fq *FileQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first File ID from the query. Returns a *NotFoundError when no File ID was found.

func (*FileQuery) FirstIDX

func (fq *FileQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*FileQuery) FirstX

func (fq *FileQuery) FirstX(ctx context.Context) *File

FirstX is like First, but panics if an error occurs.

func (*FileQuery) GroupBy

func (fq *FileQuery) GroupBy(field string, fields ...string) *FileGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.File.Query().
	GroupBy(file.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*FileQuery) IDs

func (fq *FileQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of File IDs.

func (*FileQuery) IDsX

func (fq *FileQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*FileQuery) Limit

func (fq *FileQuery) Limit(limit int) *FileQuery

Limit the number of records to be returned by this query.

func (*FileQuery) Offset

func (fq *FileQuery) Offset(offset int) *FileQuery

Offset to start from.

func (*FileQuery) Only

func (fq *FileQuery) Only(ctx context.Context) (*File, error)

Only returns a single File entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one File entity is found. Returns a *NotFoundError when no File entities are found.

func (*FileQuery) OnlyID

func (fq *FileQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only File ID in the query. Returns a *NotSingularError when more than one File ID is found. Returns a *NotFoundError when no entities are found.

func (*FileQuery) OnlyIDX

func (fq *FileQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*FileQuery) OnlyX

func (fq *FileQuery) OnlyX(ctx context.Context) *File

OnlyX is like Only, but panics if an error occurs.

func (*FileQuery) Order

func (fq *FileQuery) Order(o ...file.OrderOption) *FileQuery

Order specifies how the records should be ordered.

func (*FileQuery) QueryChats

func (fq *FileQuery) QueryChats() *ChatQuery

QueryChats chains the current query on the "chats" edge.

func (*FileQuery) QueryMessages

func (fq *FileQuery) QueryMessages() *MessageQuery

QueryMessages chains the current query on the "messages" edge.

func (*FileQuery) QueryPosts

func (fq *FileQuery) QueryPosts() *PostQuery

QueryPosts chains the current query on the "posts" edge.

func (*FileQuery) QueryUsers

func (fq *FileQuery) QueryUsers() *UserQuery

QueryUsers chains the current query on the "users" edge.

func (*FileQuery) Select

func (fq *FileQuery) Select(fields ...string) *FileSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.File.Query().
	Select(file.FieldCreatedAt).
	Scan(ctx, &v)

func (*FileQuery) Unique

func (fq *FileQuery) Unique(unique bool) *FileQuery

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 (*FileQuery) Where

func (fq *FileQuery) Where(ps ...predicate.File) *FileQuery

Where adds a new predicate for the FileQuery builder.

func (*FileQuery) WithChats

func (fq *FileQuery) WithChats(opts ...func(*ChatQuery)) *FileQuery

WithChats tells the query-builder to eager-load the nodes that are connected to the "chats" edge. The optional arguments are used to configure the query builder of the edge.

func (*FileQuery) WithMessages

func (fq *FileQuery) WithMessages(opts ...func(*MessageQuery)) *FileQuery

WithMessages tells the query-builder to eager-load the nodes that are connected to the "messages" edge. The optional arguments are used to configure the query builder of the edge.

func (*FileQuery) WithPosts

func (fq *FileQuery) WithPosts(opts ...func(*PostQuery)) *FileQuery

WithPosts tells the query-builder to eager-load the nodes that are connected to the "posts" edge. The optional arguments are used to configure the query builder of the edge.

func (*FileQuery) WithUsers

func (fq *FileQuery) WithUsers(opts ...func(*UserQuery)) *FileQuery

WithUsers tells the query-builder to eager-load the nodes that are connected to the "users" edge. The optional arguments are used to configure the query builder of the edge.

type FileSelect

type FileSelect struct {
	*FileQuery
	// contains filtered or unexported fields
}

FileSelect is the builder for selecting fields of File entities.

func (*FileSelect) Aggregate

func (fs *FileSelect) Aggregate(fns ...AggregateFunc) *FileSelect

Aggregate adds the given aggregation functions to the selector query.

func (*FileSelect) Bool

func (s *FileSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*FileSelect) BoolX

func (s *FileSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*FileSelect) Bools

func (s *FileSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*FileSelect) BoolsX

func (s *FileSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*FileSelect) Float64

func (s *FileSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*FileSelect) Float64X

func (s *FileSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*FileSelect) Float64s

func (s *FileSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*FileSelect) Float64sX

func (s *FileSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*FileSelect) Int

func (s *FileSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*FileSelect) IntX

func (s *FileSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*FileSelect) Ints

func (s *FileSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*FileSelect) IntsX

func (s *FileSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*FileSelect) Scan

func (fs *FileSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*FileSelect) ScanX

func (s *FileSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*FileSelect) String

func (s *FileSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*FileSelect) StringX

func (s *FileSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*FileSelect) Strings

func (s *FileSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*FileSelect) StringsX

func (s *FileSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type FileUpdate

type FileUpdate struct {
	// contains filtered or unexported fields
}

FileUpdate is the builder for updating File entities.

func (*FileUpdate) AddChatIDs

func (fu *FileUpdate) AddChatIDs(ids ...uuid.UUID) *FileUpdate

AddChatIDs adds the "chats" edge to the Chat entity by IDs.

func (*FileUpdate) AddChats

func (fu *FileUpdate) AddChats(c ...*Chat) *FileUpdate

AddChats adds the "chats" edges to the Chat entity.

func (*FileUpdate) AddMessageIDs

func (fu *FileUpdate) AddMessageIDs(ids ...uuid.UUID) *FileUpdate

AddMessageIDs adds the "messages" edge to the Message entity by IDs.

func (*FileUpdate) AddMessages

func (fu *FileUpdate) AddMessages(m ...*Message) *FileUpdate

AddMessages adds the "messages" edges to the Message entity.

func (*FileUpdate) AddPostIDs

func (fu *FileUpdate) AddPostIDs(ids ...uuid.UUID) *FileUpdate

AddPostIDs adds the "posts" edge to the Post entity by IDs.

func (*FileUpdate) AddPosts

func (fu *FileUpdate) AddPosts(p ...*Post) *FileUpdate

AddPosts adds the "posts" edges to the Post entity.

func (*FileUpdate) AddUserIDs

func (fu *FileUpdate) AddUserIDs(ids ...uuid.UUID) *FileUpdate

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*FileUpdate) AddUsers

func (fu *FileUpdate) AddUsers(u ...*User) *FileUpdate

AddUsers adds the "users" edges to the User entity.

func (*FileUpdate) ClearChats

func (fu *FileUpdate) ClearChats() *FileUpdate

ClearChats clears all "chats" edges to the Chat entity.

func (*FileUpdate) ClearMessages

func (fu *FileUpdate) ClearMessages() *FileUpdate

ClearMessages clears all "messages" edges to the Message entity.

func (*FileUpdate) ClearPosts

func (fu *FileUpdate) ClearPosts() *FileUpdate

ClearPosts clears all "posts" edges to the Post entity.

func (*FileUpdate) ClearUsers

func (fu *FileUpdate) ClearUsers() *FileUpdate

ClearUsers clears all "users" edges to the User entity.

func (*FileUpdate) Exec

func (fu *FileUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*FileUpdate) ExecX

func (fu *FileUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FileUpdate) Mutation

func (fu *FileUpdate) Mutation() *FileMutation

Mutation returns the FileMutation object of the builder.

func (*FileUpdate) RemoveChatIDs

func (fu *FileUpdate) RemoveChatIDs(ids ...uuid.UUID) *FileUpdate

RemoveChatIDs removes the "chats" edge to Chat entities by IDs.

func (*FileUpdate) RemoveChats

func (fu *FileUpdate) RemoveChats(c ...*Chat) *FileUpdate

RemoveChats removes "chats" edges to Chat entities.

func (*FileUpdate) RemoveMessageIDs

func (fu *FileUpdate) RemoveMessageIDs(ids ...uuid.UUID) *FileUpdate

RemoveMessageIDs removes the "messages" edge to Message entities by IDs.

func (*FileUpdate) RemoveMessages

func (fu *FileUpdate) RemoveMessages(m ...*Message) *FileUpdate

RemoveMessages removes "messages" edges to Message entities.

func (*FileUpdate) RemovePostIDs

func (fu *FileUpdate) RemovePostIDs(ids ...uuid.UUID) *FileUpdate

RemovePostIDs removes the "posts" edge to Post entities by IDs.

func (*FileUpdate) RemovePosts

func (fu *FileUpdate) RemovePosts(p ...*Post) *FileUpdate

RemovePosts removes "posts" edges to Post entities.

func (*FileUpdate) RemoveUserIDs

func (fu *FileUpdate) RemoveUserIDs(ids ...uuid.UUID) *FileUpdate

RemoveUserIDs removes the "users" edge to User entities by IDs.

func (*FileUpdate) RemoveUsers

func (fu *FileUpdate) RemoveUsers(u ...*User) *FileUpdate

RemoveUsers removes "users" edges to User entities.

func (*FileUpdate) Save

func (fu *FileUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*FileUpdate) SaveX

func (fu *FileUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*FileUpdate) SetCreatedAt

func (fu *FileUpdate) SetCreatedAt(t time.Time) *FileUpdate

SetCreatedAt sets the "created_at" field.

func (*FileUpdate) SetNillableCreatedAt

func (fu *FileUpdate) SetNillableCreatedAt(t *time.Time) *FileUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*FileUpdate) SetNillableResourceType

func (fu *FileUpdate) SetNillableResourceType(s *string) *FileUpdate

SetNillableResourceType sets the "resource_type" field if the given value is not nil.

func (*FileUpdate) SetResourceType

func (fu *FileUpdate) SetResourceType(s string) *FileUpdate

SetResourceType sets the "resource_type" field.

func (*FileUpdate) SetUpdatedAt

func (fu *FileUpdate) SetUpdatedAt(t time.Time) *FileUpdate

SetUpdatedAt sets the "updated_at" field.

func (*FileUpdate) Where

func (fu *FileUpdate) Where(ps ...predicate.File) *FileUpdate

Where appends a list predicates to the FileUpdate builder.

type FileUpdateOne

type FileUpdateOne struct {
	// contains filtered or unexported fields
}

FileUpdateOne is the builder for updating a single File entity.

func (*FileUpdateOne) AddChatIDs

func (fuo *FileUpdateOne) AddChatIDs(ids ...uuid.UUID) *FileUpdateOne

AddChatIDs adds the "chats" edge to the Chat entity by IDs.

func (*FileUpdateOne) AddChats

func (fuo *FileUpdateOne) AddChats(c ...*Chat) *FileUpdateOne

AddChats adds the "chats" edges to the Chat entity.

func (*FileUpdateOne) AddMessageIDs

func (fuo *FileUpdateOne) AddMessageIDs(ids ...uuid.UUID) *FileUpdateOne

AddMessageIDs adds the "messages" edge to the Message entity by IDs.

func (*FileUpdateOne) AddMessages

func (fuo *FileUpdateOne) AddMessages(m ...*Message) *FileUpdateOne

AddMessages adds the "messages" edges to the Message entity.

func (*FileUpdateOne) AddPostIDs

func (fuo *FileUpdateOne) AddPostIDs(ids ...uuid.UUID) *FileUpdateOne

AddPostIDs adds the "posts" edge to the Post entity by IDs.

func (*FileUpdateOne) AddPosts

func (fuo *FileUpdateOne) AddPosts(p ...*Post) *FileUpdateOne

AddPosts adds the "posts" edges to the Post entity.

func (*FileUpdateOne) AddUserIDs

func (fuo *FileUpdateOne) AddUserIDs(ids ...uuid.UUID) *FileUpdateOne

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*FileUpdateOne) AddUsers

func (fuo *FileUpdateOne) AddUsers(u ...*User) *FileUpdateOne

AddUsers adds the "users" edges to the User entity.

func (*FileUpdateOne) ClearChats

func (fuo *FileUpdateOne) ClearChats() *FileUpdateOne

ClearChats clears all "chats" edges to the Chat entity.

func (*FileUpdateOne) ClearMessages

func (fuo *FileUpdateOne) ClearMessages() *FileUpdateOne

ClearMessages clears all "messages" edges to the Message entity.

func (*FileUpdateOne) ClearPosts

func (fuo *FileUpdateOne) ClearPosts() *FileUpdateOne

ClearPosts clears all "posts" edges to the Post entity.

func (*FileUpdateOne) ClearUsers

func (fuo *FileUpdateOne) ClearUsers() *FileUpdateOne

ClearUsers clears all "users" edges to the User entity.

func (*FileUpdateOne) Exec

func (fuo *FileUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*FileUpdateOne) ExecX

func (fuo *FileUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FileUpdateOne) Mutation

func (fuo *FileUpdateOne) Mutation() *FileMutation

Mutation returns the FileMutation object of the builder.

func (*FileUpdateOne) RemoveChatIDs

func (fuo *FileUpdateOne) RemoveChatIDs(ids ...uuid.UUID) *FileUpdateOne

RemoveChatIDs removes the "chats" edge to Chat entities by IDs.

func (*FileUpdateOne) RemoveChats

func (fuo *FileUpdateOne) RemoveChats(c ...*Chat) *FileUpdateOne

RemoveChats removes "chats" edges to Chat entities.

func (*FileUpdateOne) RemoveMessageIDs

func (fuo *FileUpdateOne) RemoveMessageIDs(ids ...uuid.UUID) *FileUpdateOne

RemoveMessageIDs removes the "messages" edge to Message entities by IDs.

func (*FileUpdateOne) RemoveMessages

func (fuo *FileUpdateOne) RemoveMessages(m ...*Message) *FileUpdateOne

RemoveMessages removes "messages" edges to Message entities.

func (*FileUpdateOne) RemovePostIDs

func (fuo *FileUpdateOne) RemovePostIDs(ids ...uuid.UUID) *FileUpdateOne

RemovePostIDs removes the "posts" edge to Post entities by IDs.

func (*FileUpdateOne) RemovePosts

func (fuo *FileUpdateOne) RemovePosts(p ...*Post) *FileUpdateOne

RemovePosts removes "posts" edges to Post entities.

func (*FileUpdateOne) RemoveUserIDs

func (fuo *FileUpdateOne) RemoveUserIDs(ids ...uuid.UUID) *FileUpdateOne

RemoveUserIDs removes the "users" edge to User entities by IDs.

func (*FileUpdateOne) RemoveUsers

func (fuo *FileUpdateOne) RemoveUsers(u ...*User) *FileUpdateOne

RemoveUsers removes "users" edges to User entities.

func (*FileUpdateOne) Save

func (fuo *FileUpdateOne) Save(ctx context.Context) (*File, error)

Save executes the query and returns the updated File entity.

func (*FileUpdateOne) SaveX

func (fuo *FileUpdateOne) SaveX(ctx context.Context) *File

SaveX is like Save, but panics if an error occurs.

func (*FileUpdateOne) Select

func (fuo *FileUpdateOne) Select(field string, fields ...string) *FileUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*FileUpdateOne) SetCreatedAt

func (fuo *FileUpdateOne) SetCreatedAt(t time.Time) *FileUpdateOne

SetCreatedAt sets the "created_at" field.

func (*FileUpdateOne) SetNillableCreatedAt

func (fuo *FileUpdateOne) SetNillableCreatedAt(t *time.Time) *FileUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*FileUpdateOne) SetNillableResourceType

func (fuo *FileUpdateOne) SetNillableResourceType(s *string) *FileUpdateOne

SetNillableResourceType sets the "resource_type" field if the given value is not nil.

func (*FileUpdateOne) SetResourceType

func (fuo *FileUpdateOne) SetResourceType(s string) *FileUpdateOne

SetResourceType sets the "resource_type" field.

func (*FileUpdateOne) SetUpdatedAt

func (fuo *FileUpdateOne) SetUpdatedAt(t time.Time) *FileUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*FileUpdateOne) Where

func (fuo *FileUpdateOne) Where(ps ...predicate.File) *FileUpdateOne

Where appends a list predicates to the FileUpdate builder.

type Files

type Files []*File

Files is a parsable slice of File.

type Friend

type Friend struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// RequesterID holds the value of the "requester_id" field.
	RequesterID uuid.UUID `json:"requester_id,omitempty"`
	// RequesteeID holds the value of the "requestee_id" field.
	RequesteeID uuid.UUID `json:"requestee_id,omitempty"`
	// Status holds the value of the "status" field.
	Status friend.Status `json:"status,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the FriendQuery when eager-loading is set.
	Edges FriendEdges `json:"edges"`
	// contains filtered or unexported fields
}

Friend is the model entity for the Friend schema.

func (*Friend) QueryRequestee

func (f *Friend) QueryRequestee() *UserQuery

QueryRequestee queries the "requestee" edge of the Friend entity.

func (*Friend) QueryRequester

func (f *Friend) QueryRequester() *UserQuery

QueryRequester queries the "requester" edge of the Friend entity.

func (*Friend) String

func (f *Friend) String() string

String implements the fmt.Stringer.

func (*Friend) Unwrap

func (f *Friend) Unwrap() *Friend

Unwrap unwraps the Friend 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 (*Friend) Update

func (f *Friend) Update() *FriendUpdateOne

Update returns a builder for updating this Friend. Note that you need to call Friend.Unwrap() before calling this method if this Friend was returned from a transaction, and the transaction was committed or rolled back.

func (*Friend) Value

func (f *Friend) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Friend. This includes values selected through modifiers, order, etc.

type FriendClient

type FriendClient struct {
	// contains filtered or unexported fields
}

FriendClient is a client for the Friend schema.

func NewFriendClient

func NewFriendClient(c config) *FriendClient

NewFriendClient returns a client for the Friend from the given config.

func (*FriendClient) Create

func (c *FriendClient) Create() *FriendCreate

Create returns a builder for creating a Friend entity.

func (*FriendClient) CreateBulk

func (c *FriendClient) CreateBulk(builders ...*FriendCreate) *FriendCreateBulk

CreateBulk returns a builder for creating a bulk of Friend entities.

func (*FriendClient) Delete

func (c *FriendClient) Delete() *FriendDelete

Delete returns a delete builder for Friend.

func (*FriendClient) DeleteOne

func (c *FriendClient) DeleteOne(f *Friend) *FriendDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*FriendClient) DeleteOneID

func (c *FriendClient) DeleteOneID(id uuid.UUID) *FriendDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*FriendClient) Get

func (c *FriendClient) Get(ctx context.Context, id uuid.UUID) (*Friend, error)

Get returns a Friend entity by its id.

func (*FriendClient) GetX

func (c *FriendClient) GetX(ctx context.Context, id uuid.UUID) *Friend

GetX is like Get, but panics if an error occurs.

func (*FriendClient) Hooks

func (c *FriendClient) Hooks() []Hook

Hooks returns the client hooks.

func (*FriendClient) Intercept

func (c *FriendClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `friend.Intercept(f(g(h())))`.

func (*FriendClient) Interceptors

func (c *FriendClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*FriendClient) MapCreateBulk

func (c *FriendClient) MapCreateBulk(slice any, setFunc func(*FriendCreate, int)) *FriendCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*FriendClient) Query

func (c *FriendClient) Query() *FriendQuery

Query returns a query builder for Friend.

func (*FriendClient) QueryRequestee

func (c *FriendClient) QueryRequestee(f *Friend) *UserQuery

QueryRequestee queries the requestee edge of a Friend.

func (*FriendClient) QueryRequester

func (c *FriendClient) QueryRequester(f *Friend) *UserQuery

QueryRequester queries the requester edge of a Friend.

func (*FriendClient) Update

func (c *FriendClient) Update() *FriendUpdate

Update returns an update builder for Friend.

func (*FriendClient) UpdateOne

func (c *FriendClient) UpdateOne(f *Friend) *FriendUpdateOne

UpdateOne returns an update builder for the given entity.

func (*FriendClient) UpdateOneID

func (c *FriendClient) UpdateOneID(id uuid.UUID) *FriendUpdateOne

UpdateOneID returns an update builder for the given id.

func (*FriendClient) Use

func (c *FriendClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `friend.Hooks(f(g(h())))`.

type FriendCreate

type FriendCreate struct {
	// contains filtered or unexported fields
}

FriendCreate is the builder for creating a Friend entity.

func (*FriendCreate) Exec

func (fc *FriendCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*FriendCreate) ExecX

func (fc *FriendCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FriendCreate) Mutation

func (fc *FriendCreate) Mutation() *FriendMutation

Mutation returns the FriendMutation object of the builder.

func (*FriendCreate) Save

func (fc *FriendCreate) Save(ctx context.Context) (*Friend, error)

Save creates the Friend in the database.

func (*FriendCreate) SaveX

func (fc *FriendCreate) SaveX(ctx context.Context) *Friend

SaveX calls Save and panics if Save returns an error.

func (*FriendCreate) SetCreatedAt

func (fc *FriendCreate) SetCreatedAt(t time.Time) *FriendCreate

SetCreatedAt sets the "created_at" field.

func (*FriendCreate) SetID

func (fc *FriendCreate) SetID(u uuid.UUID) *FriendCreate

SetID sets the "id" field.

func (*FriendCreate) SetNillableCreatedAt

func (fc *FriendCreate) SetNillableCreatedAt(t *time.Time) *FriendCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*FriendCreate) SetNillableID

func (fc *FriendCreate) SetNillableID(u *uuid.UUID) *FriendCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*FriendCreate) SetNillableStatus

func (fc *FriendCreate) SetNillableStatus(f *friend.Status) *FriendCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*FriendCreate) SetNillableUpdatedAt

func (fc *FriendCreate) SetNillableUpdatedAt(t *time.Time) *FriendCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*FriendCreate) SetRequestee

func (fc *FriendCreate) SetRequestee(u *User) *FriendCreate

SetRequestee sets the "requestee" edge to the User entity.

func (*FriendCreate) SetRequesteeID

func (fc *FriendCreate) SetRequesteeID(u uuid.UUID) *FriendCreate

SetRequesteeID sets the "requestee_id" field.

func (*FriendCreate) SetRequester

func (fc *FriendCreate) SetRequester(u *User) *FriendCreate

SetRequester sets the "requester" edge to the User entity.

func (*FriendCreate) SetRequesterID

func (fc *FriendCreate) SetRequesterID(u uuid.UUID) *FriendCreate

SetRequesterID sets the "requester_id" field.

func (*FriendCreate) SetStatus

func (fc *FriendCreate) SetStatus(f friend.Status) *FriendCreate

SetStatus sets the "status" field.

func (*FriendCreate) SetUpdatedAt

func (fc *FriendCreate) SetUpdatedAt(t time.Time) *FriendCreate

SetUpdatedAt sets the "updated_at" field.

type FriendCreateBulk

type FriendCreateBulk struct {
	// contains filtered or unexported fields
}

FriendCreateBulk is the builder for creating many Friend entities in bulk.

func (*FriendCreateBulk) Exec

func (fcb *FriendCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*FriendCreateBulk) ExecX

func (fcb *FriendCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FriendCreateBulk) Save

func (fcb *FriendCreateBulk) Save(ctx context.Context) ([]*Friend, error)

Save creates the Friend entities in the database.

func (*FriendCreateBulk) SaveX

func (fcb *FriendCreateBulk) SaveX(ctx context.Context) []*Friend

SaveX is like Save, but panics if an error occurs.

type FriendDelete

type FriendDelete struct {
	// contains filtered or unexported fields
}

FriendDelete is the builder for deleting a Friend entity.

func (*FriendDelete) Exec

func (fd *FriendDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*FriendDelete) ExecX

func (fd *FriendDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*FriendDelete) Where

func (fd *FriendDelete) Where(ps ...predicate.Friend) *FriendDelete

Where appends a list predicates to the FriendDelete builder.

type FriendDeleteOne

type FriendDeleteOne struct {
	// contains filtered or unexported fields
}

FriendDeleteOne is the builder for deleting a single Friend entity.

func (*FriendDeleteOne) Exec

func (fdo *FriendDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*FriendDeleteOne) ExecX

func (fdo *FriendDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FriendDeleteOne) Where

func (fdo *FriendDeleteOne) Where(ps ...predicate.Friend) *FriendDeleteOne

Where appends a list predicates to the FriendDelete builder.

type FriendEdges

type FriendEdges struct {
	// Requester holds the value of the requester edge.
	Requester *User `json:"requester,omitempty"`
	// Requestee holds the value of the requestee edge.
	Requestee *User `json:"requestee,omitempty"`
	// contains filtered or unexported fields
}

FriendEdges holds the relations/edges for other nodes in the graph.

func (FriendEdges) RequesteeOrErr

func (e FriendEdges) RequesteeOrErr() (*User, error)

RequesteeOrErr returns the Requestee value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (FriendEdges) RequesterOrErr

func (e FriendEdges) RequesterOrErr() (*User, error)

RequesterOrErr returns the Requester value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type FriendGroupBy

type FriendGroupBy struct {
	// contains filtered or unexported fields
}

FriendGroupBy is the group-by builder for Friend entities.

func (*FriendGroupBy) Aggregate

func (fgb *FriendGroupBy) Aggregate(fns ...AggregateFunc) *FriendGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*FriendGroupBy) Bool

func (s *FriendGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*FriendGroupBy) BoolX

func (s *FriendGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*FriendGroupBy) Bools

func (s *FriendGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*FriendGroupBy) BoolsX

func (s *FriendGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*FriendGroupBy) Float64

func (s *FriendGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*FriendGroupBy) Float64X

func (s *FriendGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*FriendGroupBy) Float64s

func (s *FriendGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*FriendGroupBy) Float64sX

func (s *FriendGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*FriendGroupBy) Int

func (s *FriendGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*FriendGroupBy) IntX

func (s *FriendGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*FriendGroupBy) Ints

func (s *FriendGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*FriendGroupBy) IntsX

func (s *FriendGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*FriendGroupBy) Scan

func (fgb *FriendGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*FriendGroupBy) ScanX

func (s *FriendGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*FriendGroupBy) String

func (s *FriendGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*FriendGroupBy) StringX

func (s *FriendGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*FriendGroupBy) Strings

func (s *FriendGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*FriendGroupBy) StringsX

func (s *FriendGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type FriendMutation

type FriendMutation struct {
	// contains filtered or unexported fields
}

FriendMutation represents an operation that mutates the Friend nodes in the graph.

func (*FriendMutation) AddField

func (m *FriendMutation) 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 (*FriendMutation) AddedEdges

func (m *FriendMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*FriendMutation) AddedField

func (m *FriendMutation) 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 (*FriendMutation) AddedFields

func (m *FriendMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*FriendMutation) AddedIDs

func (m *FriendMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*FriendMutation) ClearEdge

func (m *FriendMutation) 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 (*FriendMutation) ClearField

func (m *FriendMutation) 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 (*FriendMutation) ClearRequestee

func (m *FriendMutation) ClearRequestee()

ClearRequestee clears the "requestee" edge to the User entity.

func (*FriendMutation) ClearRequester

func (m *FriendMutation) ClearRequester()

ClearRequester clears the "requester" edge to the User entity.

func (*FriendMutation) ClearedEdges

func (m *FriendMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*FriendMutation) ClearedFields

func (m *FriendMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (FriendMutation) Client

func (m FriendMutation) 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 (*FriendMutation) CreatedAt

func (m *FriendMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*FriendMutation) EdgeCleared

func (m *FriendMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*FriendMutation) Field

func (m *FriendMutation) 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 (*FriendMutation) FieldCleared

func (m *FriendMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*FriendMutation) Fields

func (m *FriendMutation) 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 (*FriendMutation) ID

func (m *FriendMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*FriendMutation) IDs

func (m *FriendMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*FriendMutation) OldCreatedAt

func (m *FriendMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Friend entity. If the Friend 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 (*FriendMutation) OldField

func (m *FriendMutation) 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 (*FriendMutation) OldRequesteeID

func (m *FriendMutation) OldRequesteeID(ctx context.Context) (v uuid.UUID, err error)

OldRequesteeID returns the old "requestee_id" field's value of the Friend entity. If the Friend 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 (*FriendMutation) OldRequesterID

func (m *FriendMutation) OldRequesterID(ctx context.Context) (v uuid.UUID, err error)

OldRequesterID returns the old "requester_id" field's value of the Friend entity. If the Friend 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 (*FriendMutation) OldStatus

func (m *FriendMutation) OldStatus(ctx context.Context) (v friend.Status, err error)

OldStatus returns the old "status" field's value of the Friend entity. If the Friend 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 (*FriendMutation) OldUpdatedAt

func (m *FriendMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Friend entity. If the Friend 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 (*FriendMutation) Op

func (m *FriendMutation) Op() Op

Op returns the operation name.

func (*FriendMutation) RemovedEdges

func (m *FriendMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*FriendMutation) RemovedIDs

func (m *FriendMutation) 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 (*FriendMutation) RequesteeCleared

func (m *FriendMutation) RequesteeCleared() bool

RequesteeCleared reports if the "requestee" edge to the User entity was cleared.

func (*FriendMutation) RequesteeID

func (m *FriendMutation) RequesteeID() (r uuid.UUID, exists bool)

RequesteeID returns the value of the "requestee_id" field in the mutation.

func (*FriendMutation) RequesteeIDs

func (m *FriendMutation) RequesteeIDs() (ids []uuid.UUID)

RequesteeIDs returns the "requestee" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use RequesteeID instead. It exists only for internal usage by the builders.

func (*FriendMutation) RequesterCleared

func (m *FriendMutation) RequesterCleared() bool

RequesterCleared reports if the "requester" edge to the User entity was cleared.

func (*FriendMutation) RequesterID

func (m *FriendMutation) RequesterID() (r uuid.UUID, exists bool)

RequesterID returns the value of the "requester_id" field in the mutation.

func (*FriendMutation) RequesterIDs

func (m *FriendMutation) RequesterIDs() (ids []uuid.UUID)

RequesterIDs returns the "requester" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use RequesterID instead. It exists only for internal usage by the builders.

func (*FriendMutation) ResetCreatedAt

func (m *FriendMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*FriendMutation) ResetEdge

func (m *FriendMutation) 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 (*FriendMutation) ResetField

func (m *FriendMutation) 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 (*FriendMutation) ResetRequestee

func (m *FriendMutation) ResetRequestee()

ResetRequestee resets all changes to the "requestee" edge.

func (*FriendMutation) ResetRequesteeID

func (m *FriendMutation) ResetRequesteeID()

ResetRequesteeID resets all changes to the "requestee_id" field.

func (*FriendMutation) ResetRequester

func (m *FriendMutation) ResetRequester()

ResetRequester resets all changes to the "requester" edge.

func (*FriendMutation) ResetRequesterID

func (m *FriendMutation) ResetRequesterID()

ResetRequesterID resets all changes to the "requester_id" field.

func (*FriendMutation) ResetStatus

func (m *FriendMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*FriendMutation) ResetUpdatedAt

func (m *FriendMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*FriendMutation) SetCreatedAt

func (m *FriendMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*FriendMutation) SetField

func (m *FriendMutation) 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 (*FriendMutation) SetID

func (m *FriendMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Friend entities.

func (*FriendMutation) SetOp

func (m *FriendMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*FriendMutation) SetRequesteeID

func (m *FriendMutation) SetRequesteeID(u uuid.UUID)

SetRequesteeID sets the "requestee_id" field.

func (*FriendMutation) SetRequesterID

func (m *FriendMutation) SetRequesterID(u uuid.UUID)

SetRequesterID sets the "requester_id" field.

func (*FriendMutation) SetStatus

func (m *FriendMutation) SetStatus(f friend.Status)

SetStatus sets the "status" field.

func (*FriendMutation) SetUpdatedAt

func (m *FriendMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*FriendMutation) Status

func (m *FriendMutation) Status() (r friend.Status, exists bool)

Status returns the value of the "status" field in the mutation.

func (FriendMutation) Tx

func (m FriendMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*FriendMutation) Type

func (m *FriendMutation) Type() string

Type returns the node type of this mutation (Friend).

func (*FriendMutation) UpdatedAt

func (m *FriendMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*FriendMutation) Where

func (m *FriendMutation) Where(ps ...predicate.Friend)

Where appends a list predicates to the FriendMutation builder.

func (*FriendMutation) WhereP

func (m *FriendMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the FriendMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type FriendQuery

type FriendQuery struct {
	// contains filtered or unexported fields
}

FriendQuery is the builder for querying Friend entities.

func (*FriendQuery) Aggregate

func (fq *FriendQuery) Aggregate(fns ...AggregateFunc) *FriendSelect

Aggregate returns a FriendSelect configured with the given aggregations.

func (*FriendQuery) All

func (fq *FriendQuery) All(ctx context.Context) ([]*Friend, error)

All executes the query and returns a list of Friends.

func (*FriendQuery) AllX

func (fq *FriendQuery) AllX(ctx context.Context) []*Friend

AllX is like All, but panics if an error occurs.

func (*FriendQuery) Clone

func (fq *FriendQuery) Clone() *FriendQuery

Clone returns a duplicate of the FriendQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*FriendQuery) Count

func (fq *FriendQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*FriendQuery) CountX

func (fq *FriendQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*FriendQuery) Exist

func (fq *FriendQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*FriendQuery) ExistX

func (fq *FriendQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*FriendQuery) First

func (fq *FriendQuery) First(ctx context.Context) (*Friend, error)

First returns the first Friend entity from the query. Returns a *NotFoundError when no Friend was found.

func (*FriendQuery) FirstID

func (fq *FriendQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Friend ID from the query. Returns a *NotFoundError when no Friend ID was found.

func (*FriendQuery) FirstIDX

func (fq *FriendQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*FriendQuery) FirstX

func (fq *FriendQuery) FirstX(ctx context.Context) *Friend

FirstX is like First, but panics if an error occurs.

func (*FriendQuery) GroupBy

func (fq *FriendQuery) GroupBy(field string, fields ...string) *FriendGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Friend.Query().
	GroupBy(friend.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*FriendQuery) IDs

func (fq *FriendQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Friend IDs.

func (*FriendQuery) IDsX

func (fq *FriendQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*FriendQuery) Limit

func (fq *FriendQuery) Limit(limit int) *FriendQuery

Limit the number of records to be returned by this query.

func (*FriendQuery) Offset

func (fq *FriendQuery) Offset(offset int) *FriendQuery

Offset to start from.

func (*FriendQuery) Only

func (fq *FriendQuery) Only(ctx context.Context) (*Friend, error)

Only returns a single Friend entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Friend entity is found. Returns a *NotFoundError when no Friend entities are found.

func (*FriendQuery) OnlyID

func (fq *FriendQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Friend ID in the query. Returns a *NotSingularError when more than one Friend ID is found. Returns a *NotFoundError when no entities are found.

func (*FriendQuery) OnlyIDX

func (fq *FriendQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*FriendQuery) OnlyX

func (fq *FriendQuery) OnlyX(ctx context.Context) *Friend

OnlyX is like Only, but panics if an error occurs.

func (*FriendQuery) Order

func (fq *FriendQuery) Order(o ...friend.OrderOption) *FriendQuery

Order specifies how the records should be ordered.

func (*FriendQuery) QueryRequestee

func (fq *FriendQuery) QueryRequestee() *UserQuery

QueryRequestee chains the current query on the "requestee" edge.

func (*FriendQuery) QueryRequester

func (fq *FriendQuery) QueryRequester() *UserQuery

QueryRequester chains the current query on the "requester" edge.

func (*FriendQuery) Select

func (fq *FriendQuery) Select(fields ...string) *FriendSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Friend.Query().
	Select(friend.FieldCreatedAt).
	Scan(ctx, &v)

func (*FriendQuery) Unique

func (fq *FriendQuery) Unique(unique bool) *FriendQuery

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 (*FriendQuery) Where

func (fq *FriendQuery) Where(ps ...predicate.Friend) *FriendQuery

Where adds a new predicate for the FriendQuery builder.

func (*FriendQuery) WithRequestee

func (fq *FriendQuery) WithRequestee(opts ...func(*UserQuery)) *FriendQuery

WithRequestee tells the query-builder to eager-load the nodes that are connected to the "requestee" edge. The optional arguments are used to configure the query builder of the edge.

func (*FriendQuery) WithRequester

func (fq *FriendQuery) WithRequester(opts ...func(*UserQuery)) *FriendQuery

WithRequester tells the query-builder to eager-load the nodes that are connected to the "requester" edge. The optional arguments are used to configure the query builder of the edge.

type FriendSelect

type FriendSelect struct {
	*FriendQuery
	// contains filtered or unexported fields
}

FriendSelect is the builder for selecting fields of Friend entities.

func (*FriendSelect) Aggregate

func (fs *FriendSelect) Aggregate(fns ...AggregateFunc) *FriendSelect

Aggregate adds the given aggregation functions to the selector query.

func (*FriendSelect) Bool

func (s *FriendSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*FriendSelect) BoolX

func (s *FriendSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*FriendSelect) Bools

func (s *FriendSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*FriendSelect) BoolsX

func (s *FriendSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*FriendSelect) Float64

func (s *FriendSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*FriendSelect) Float64X

func (s *FriendSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*FriendSelect) Float64s

func (s *FriendSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*FriendSelect) Float64sX

func (s *FriendSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*FriendSelect) Int

func (s *FriendSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*FriendSelect) IntX

func (s *FriendSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*FriendSelect) Ints

func (s *FriendSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*FriendSelect) IntsX

func (s *FriendSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*FriendSelect) Scan

func (fs *FriendSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*FriendSelect) ScanX

func (s *FriendSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*FriendSelect) String

func (s *FriendSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*FriendSelect) StringX

func (s *FriendSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*FriendSelect) Strings

func (s *FriendSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*FriendSelect) StringsX

func (s *FriendSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type FriendUpdate

type FriendUpdate struct {
	// contains filtered or unexported fields
}

FriendUpdate is the builder for updating Friend entities.

func (*FriendUpdate) ClearRequestee

func (fu *FriendUpdate) ClearRequestee() *FriendUpdate

ClearRequestee clears the "requestee" edge to the User entity.

func (*FriendUpdate) ClearRequester

func (fu *FriendUpdate) ClearRequester() *FriendUpdate

ClearRequester clears the "requester" edge to the User entity.

func (*FriendUpdate) Exec

func (fu *FriendUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*FriendUpdate) ExecX

func (fu *FriendUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FriendUpdate) Mutation

func (fu *FriendUpdate) Mutation() *FriendMutation

Mutation returns the FriendMutation object of the builder.

func (*FriendUpdate) Save

func (fu *FriendUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*FriendUpdate) SaveX

func (fu *FriendUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*FriendUpdate) SetCreatedAt

func (fu *FriendUpdate) SetCreatedAt(t time.Time) *FriendUpdate

SetCreatedAt sets the "created_at" field.

func (*FriendUpdate) SetNillableCreatedAt

func (fu *FriendUpdate) SetNillableCreatedAt(t *time.Time) *FriendUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*FriendUpdate) SetNillableRequesteeID

func (fu *FriendUpdate) SetNillableRequesteeID(u *uuid.UUID) *FriendUpdate

SetNillableRequesteeID sets the "requestee_id" field if the given value is not nil.

func (*FriendUpdate) SetNillableRequesterID

func (fu *FriendUpdate) SetNillableRequesterID(u *uuid.UUID) *FriendUpdate

SetNillableRequesterID sets the "requester_id" field if the given value is not nil.

func (*FriendUpdate) SetNillableStatus

func (fu *FriendUpdate) SetNillableStatus(f *friend.Status) *FriendUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*FriendUpdate) SetRequestee

func (fu *FriendUpdate) SetRequestee(u *User) *FriendUpdate

SetRequestee sets the "requestee" edge to the User entity.

func (*FriendUpdate) SetRequesteeID

func (fu *FriendUpdate) SetRequesteeID(u uuid.UUID) *FriendUpdate

SetRequesteeID sets the "requestee_id" field.

func (*FriendUpdate) SetRequester

func (fu *FriendUpdate) SetRequester(u *User) *FriendUpdate

SetRequester sets the "requester" edge to the User entity.

func (*FriendUpdate) SetRequesterID

func (fu *FriendUpdate) SetRequesterID(u uuid.UUID) *FriendUpdate

SetRequesterID sets the "requester_id" field.

func (*FriendUpdate) SetStatus

func (fu *FriendUpdate) SetStatus(f friend.Status) *FriendUpdate

SetStatus sets the "status" field.

func (*FriendUpdate) SetUpdatedAt

func (fu *FriendUpdate) SetUpdatedAt(t time.Time) *FriendUpdate

SetUpdatedAt sets the "updated_at" field.

func (*FriendUpdate) Where

func (fu *FriendUpdate) Where(ps ...predicate.Friend) *FriendUpdate

Where appends a list predicates to the FriendUpdate builder.

type FriendUpdateOne

type FriendUpdateOne struct {
	// contains filtered or unexported fields
}

FriendUpdateOne is the builder for updating a single Friend entity.

func (*FriendUpdateOne) ClearRequestee

func (fuo *FriendUpdateOne) ClearRequestee() *FriendUpdateOne

ClearRequestee clears the "requestee" edge to the User entity.

func (*FriendUpdateOne) ClearRequester

func (fuo *FriendUpdateOne) ClearRequester() *FriendUpdateOne

ClearRequester clears the "requester" edge to the User entity.

func (*FriendUpdateOne) Exec

func (fuo *FriendUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*FriendUpdateOne) ExecX

func (fuo *FriendUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FriendUpdateOne) Mutation

func (fuo *FriendUpdateOne) Mutation() *FriendMutation

Mutation returns the FriendMutation object of the builder.

func (*FriendUpdateOne) Save

func (fuo *FriendUpdateOne) Save(ctx context.Context) (*Friend, error)

Save executes the query and returns the updated Friend entity.

func (*FriendUpdateOne) SaveX

func (fuo *FriendUpdateOne) SaveX(ctx context.Context) *Friend

SaveX is like Save, but panics if an error occurs.

func (*FriendUpdateOne) Select

func (fuo *FriendUpdateOne) Select(field string, fields ...string) *FriendUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*FriendUpdateOne) SetCreatedAt

func (fuo *FriendUpdateOne) SetCreatedAt(t time.Time) *FriendUpdateOne

SetCreatedAt sets the "created_at" field.

func (*FriendUpdateOne) SetNillableCreatedAt

func (fuo *FriendUpdateOne) SetNillableCreatedAt(t *time.Time) *FriendUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*FriendUpdateOne) SetNillableRequesteeID

func (fuo *FriendUpdateOne) SetNillableRequesteeID(u *uuid.UUID) *FriendUpdateOne

SetNillableRequesteeID sets the "requestee_id" field if the given value is not nil.

func (*FriendUpdateOne) SetNillableRequesterID

func (fuo *FriendUpdateOne) SetNillableRequesterID(u *uuid.UUID) *FriendUpdateOne

SetNillableRequesterID sets the "requester_id" field if the given value is not nil.

func (*FriendUpdateOne) SetNillableStatus

func (fuo *FriendUpdateOne) SetNillableStatus(f *friend.Status) *FriendUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*FriendUpdateOne) SetRequestee

func (fuo *FriendUpdateOne) SetRequestee(u *User) *FriendUpdateOne

SetRequestee sets the "requestee" edge to the User entity.

func (*FriendUpdateOne) SetRequesteeID

func (fuo *FriendUpdateOne) SetRequesteeID(u uuid.UUID) *FriendUpdateOne

SetRequesteeID sets the "requestee_id" field.

func (*FriendUpdateOne) SetRequester

func (fuo *FriendUpdateOne) SetRequester(u *User) *FriendUpdateOne

SetRequester sets the "requester" edge to the User entity.

func (*FriendUpdateOne) SetRequesterID

func (fuo *FriendUpdateOne) SetRequesterID(u uuid.UUID) *FriendUpdateOne

SetRequesterID sets the "requester_id" field.

func (*FriendUpdateOne) SetStatus

func (fuo *FriendUpdateOne) SetStatus(f friend.Status) *FriendUpdateOne

SetStatus sets the "status" field.

func (*FriendUpdateOne) SetUpdatedAt

func (fuo *FriendUpdateOne) SetUpdatedAt(t time.Time) *FriendUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*FriendUpdateOne) Where

func (fuo *FriendUpdateOne) Where(ps ...predicate.Friend) *FriendUpdateOne

Where appends a list predicates to the FriendUpdate builder.

type Friends

type Friends []*Friend

Friends is a parsable slice of Friend.

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

ent aliases to avoid import conflicts in user's code.

type Interceptor

type Interceptor = ent.Interceptor

ent aliases to avoid import conflicts in user's code.

type Message

type Message struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Text holds the value of the "text" field.
	Text *string `json:"text,omitempty"`
	// SenderID holds the value of the "sender_id" field.
	SenderID uuid.UUID `json:"sender_id,omitempty"`
	// ChatID holds the value of the "chat_id" field.
	ChatID uuid.UUID `json:"chat_id,omitempty"`
	// FileID holds the value of the "file_id" field.
	FileID *uuid.UUID `json:"file_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MessageQuery when eager-loading is set.
	Edges MessageEdges `json:"edges"`
	// contains filtered or unexported fields
}

Message is the model entity for the Message schema.

func (*Message) QueryChat

func (m *Message) QueryChat() *ChatQuery

QueryChat queries the "chat" edge of the Message entity.

func (*Message) QueryFile

func (m *Message) QueryFile() *FileQuery

QueryFile queries the "file" edge of the Message entity.

func (*Message) QuerySender

func (m *Message) QuerySender() *UserQuery

QuerySender queries the "sender" edge of the Message entity.

func (*Message) String

func (m *Message) String() string

String implements the fmt.Stringer.

func (*Message) Unwrap

func (m *Message) Unwrap() *Message

Unwrap unwraps the Message 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 (*Message) Update

func (m *Message) Update() *MessageUpdateOne

Update returns a builder for updating this Message. Note that you need to call Message.Unwrap() before calling this method if this Message was returned from a transaction, and the transaction was committed or rolled back.

func (*Message) Value

func (m *Message) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Message. This includes values selected through modifiers, order, etc.

type MessageClient

type MessageClient struct {
	// contains filtered or unexported fields
}

MessageClient is a client for the Message schema.

func NewMessageClient

func NewMessageClient(c config) *MessageClient

NewMessageClient returns a client for the Message from the given config.

func (*MessageClient) Create

func (c *MessageClient) Create() *MessageCreate

Create returns a builder for creating a Message entity.

func (*MessageClient) CreateBulk

func (c *MessageClient) CreateBulk(builders ...*MessageCreate) *MessageCreateBulk

CreateBulk returns a builder for creating a bulk of Message entities.

func (*MessageClient) Delete

func (c *MessageClient) Delete() *MessageDelete

Delete returns a delete builder for Message.

func (*MessageClient) DeleteOne

func (c *MessageClient) DeleteOne(m *Message) *MessageDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MessageClient) DeleteOneID

func (c *MessageClient) DeleteOneID(id uuid.UUID) *MessageDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*MessageClient) Get

func (c *MessageClient) Get(ctx context.Context, id uuid.UUID) (*Message, error)

Get returns a Message entity by its id.

func (*MessageClient) GetX

func (c *MessageClient) GetX(ctx context.Context, id uuid.UUID) *Message

GetX is like Get, but panics if an error occurs.

func (*MessageClient) Hooks

func (c *MessageClient) Hooks() []Hook

Hooks returns the client hooks.

func (*MessageClient) Intercept

func (c *MessageClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `message.Intercept(f(g(h())))`.

func (*MessageClient) Interceptors

func (c *MessageClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*MessageClient) MapCreateBulk

func (c *MessageClient) MapCreateBulk(slice any, setFunc func(*MessageCreate, int)) *MessageCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*MessageClient) Query

func (c *MessageClient) Query() *MessageQuery

Query returns a query builder for Message.

func (*MessageClient) QueryChat

func (c *MessageClient) QueryChat(m *Message) *ChatQuery

QueryChat queries the chat edge of a Message.

func (*MessageClient) QueryFile

func (c *MessageClient) QueryFile(m *Message) *FileQuery

QueryFile queries the file edge of a Message.

func (*MessageClient) QuerySender

func (c *MessageClient) QuerySender(m *Message) *UserQuery

QuerySender queries the sender edge of a Message.

func (*MessageClient) Update

func (c *MessageClient) Update() *MessageUpdate

Update returns an update builder for Message.

func (*MessageClient) UpdateOne

func (c *MessageClient) UpdateOne(m *Message) *MessageUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MessageClient) UpdateOneID

func (c *MessageClient) UpdateOneID(id uuid.UUID) *MessageUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MessageClient) Use

func (c *MessageClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `message.Hooks(f(g(h())))`.

type MessageCreate

type MessageCreate struct {
	// contains filtered or unexported fields
}

MessageCreate is the builder for creating a Message entity.

func (*MessageCreate) Exec

func (mc *MessageCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MessageCreate) ExecX

func (mc *MessageCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MessageCreate) Mutation

func (mc *MessageCreate) Mutation() *MessageMutation

Mutation returns the MessageMutation object of the builder.

func (*MessageCreate) Save

func (mc *MessageCreate) Save(ctx context.Context) (*Message, error)

Save creates the Message in the database.

func (*MessageCreate) SaveX

func (mc *MessageCreate) SaveX(ctx context.Context) *Message

SaveX calls Save and panics if Save returns an error.

func (*MessageCreate) SetChat

func (mc *MessageCreate) SetChat(c *Chat) *MessageCreate

SetChat sets the "chat" edge to the Chat entity.

func (*MessageCreate) SetChatID

func (mc *MessageCreate) SetChatID(u uuid.UUID) *MessageCreate

SetChatID sets the "chat_id" field.

func (*MessageCreate) SetCreatedAt

func (mc *MessageCreate) SetCreatedAt(t time.Time) *MessageCreate

SetCreatedAt sets the "created_at" field.

func (*MessageCreate) SetFile

func (mc *MessageCreate) SetFile(f *File) *MessageCreate

SetFile sets the "file" edge to the File entity.

func (*MessageCreate) SetFileID

func (mc *MessageCreate) SetFileID(u uuid.UUID) *MessageCreate

SetFileID sets the "file_id" field.

func (*MessageCreate) SetID

func (mc *MessageCreate) SetID(u uuid.UUID) *MessageCreate

SetID sets the "id" field.

func (*MessageCreate) SetNillableCreatedAt

func (mc *MessageCreate) SetNillableCreatedAt(t *time.Time) *MessageCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*MessageCreate) SetNillableFileID

func (mc *MessageCreate) SetNillableFileID(u *uuid.UUID) *MessageCreate

SetNillableFileID sets the "file_id" field if the given value is not nil.

func (*MessageCreate) SetNillableID

func (mc *MessageCreate) SetNillableID(u *uuid.UUID) *MessageCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*MessageCreate) SetNillableText

func (mc *MessageCreate) SetNillableText(s *string) *MessageCreate

SetNillableText sets the "text" field if the given value is not nil.

func (*MessageCreate) SetNillableUpdatedAt

func (mc *MessageCreate) SetNillableUpdatedAt(t *time.Time) *MessageCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*MessageCreate) SetSender

func (mc *MessageCreate) SetSender(u *User) *MessageCreate

SetSender sets the "sender" edge to the User entity.

func (*MessageCreate) SetSenderID

func (mc *MessageCreate) SetSenderID(u uuid.UUID) *MessageCreate

SetSenderID sets the "sender_id" field.

func (*MessageCreate) SetText

func (mc *MessageCreate) SetText(s string) *MessageCreate

SetText sets the "text" field.

func (*MessageCreate) SetUpdatedAt

func (mc *MessageCreate) SetUpdatedAt(t time.Time) *MessageCreate

SetUpdatedAt sets the "updated_at" field.

type MessageCreateBulk

type MessageCreateBulk struct {
	// contains filtered or unexported fields
}

MessageCreateBulk is the builder for creating many Message entities in bulk.

func (*MessageCreateBulk) Exec

func (mcb *MessageCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MessageCreateBulk) ExecX

func (mcb *MessageCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MessageCreateBulk) Save

func (mcb *MessageCreateBulk) Save(ctx context.Context) ([]*Message, error)

Save creates the Message entities in the database.

func (*MessageCreateBulk) SaveX

func (mcb *MessageCreateBulk) SaveX(ctx context.Context) []*Message

SaveX is like Save, but panics if an error occurs.

type MessageDelete

type MessageDelete struct {
	// contains filtered or unexported fields
}

MessageDelete is the builder for deleting a Message entity.

func (*MessageDelete) Exec

func (md *MessageDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*MessageDelete) ExecX

func (md *MessageDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*MessageDelete) Where

func (md *MessageDelete) Where(ps ...predicate.Message) *MessageDelete

Where appends a list predicates to the MessageDelete builder.

type MessageDeleteOne

type MessageDeleteOne struct {
	// contains filtered or unexported fields
}

MessageDeleteOne is the builder for deleting a single Message entity.

func (*MessageDeleteOne) Exec

func (mdo *MessageDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MessageDeleteOne) ExecX

func (mdo *MessageDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MessageDeleteOne) Where

Where appends a list predicates to the MessageDelete builder.

type MessageEdges

type MessageEdges struct {
	// Sender holds the value of the sender edge.
	Sender *User `json:"sender,omitempty"`
	// Chat holds the value of the chat edge.
	Chat *Chat `json:"chat,omitempty"`
	// File holds the value of the file edge.
	File *File `json:"file,omitempty"`
	// contains filtered or unexported fields
}

MessageEdges holds the relations/edges for other nodes in the graph.

func (MessageEdges) ChatOrErr

func (e MessageEdges) ChatOrErr() (*Chat, error)

ChatOrErr returns the Chat value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (MessageEdges) FileOrErr

func (e MessageEdges) FileOrErr() (*File, error)

FileOrErr returns the File value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (MessageEdges) SenderOrErr

func (e MessageEdges) SenderOrErr() (*User, error)

SenderOrErr returns the Sender value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type MessageGroupBy

type MessageGroupBy struct {
	// contains filtered or unexported fields
}

MessageGroupBy is the group-by builder for Message entities.

func (*MessageGroupBy) Aggregate

func (mgb *MessageGroupBy) Aggregate(fns ...AggregateFunc) *MessageGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*MessageGroupBy) Bool

func (s *MessageGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) BoolX

func (s *MessageGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MessageGroupBy) Bools

func (s *MessageGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) BoolsX

func (s *MessageGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MessageGroupBy) Float64

func (s *MessageGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) Float64X

func (s *MessageGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MessageGroupBy) Float64s

func (s *MessageGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) Float64sX

func (s *MessageGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MessageGroupBy) Int

func (s *MessageGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) IntX

func (s *MessageGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MessageGroupBy) Ints

func (s *MessageGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) IntsX

func (s *MessageGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MessageGroupBy) Scan

func (mgb *MessageGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MessageGroupBy) ScanX

func (s *MessageGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MessageGroupBy) String

func (s *MessageGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) StringX

func (s *MessageGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MessageGroupBy) Strings

func (s *MessageGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MessageGroupBy) StringsX

func (s *MessageGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MessageMutation

type MessageMutation struct {
	// contains filtered or unexported fields
}

MessageMutation represents an operation that mutates the Message nodes in the graph.

func (*MessageMutation) AddField

func (m *MessageMutation) 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 (*MessageMutation) AddedEdges

func (m *MessageMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*MessageMutation) AddedField

func (m *MessageMutation) 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 (*MessageMutation) AddedFields

func (m *MessageMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*MessageMutation) AddedIDs

func (m *MessageMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*MessageMutation) ChatCleared

func (m *MessageMutation) ChatCleared() bool

ChatCleared reports if the "chat" edge to the Chat entity was cleared.

func (*MessageMutation) ChatID

func (m *MessageMutation) ChatID() (r uuid.UUID, exists bool)

ChatID returns the value of the "chat_id" field in the mutation.

func (*MessageMutation) ChatIDs

func (m *MessageMutation) ChatIDs() (ids []uuid.UUID)

ChatIDs returns the "chat" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ChatID instead. It exists only for internal usage by the builders.

func (*MessageMutation) ClearChat

func (m *MessageMutation) ClearChat()

ClearChat clears the "chat" edge to the Chat entity.

func (*MessageMutation) ClearEdge

func (m *MessageMutation) 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 (*MessageMutation) ClearField

func (m *MessageMutation) 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 (*MessageMutation) ClearFile

func (m *MessageMutation) ClearFile()

ClearFile clears the "file" edge to the File entity.

func (*MessageMutation) ClearFileID

func (m *MessageMutation) ClearFileID()

ClearFileID clears the value of the "file_id" field.

func (*MessageMutation) ClearSender

func (m *MessageMutation) ClearSender()

ClearSender clears the "sender" edge to the User entity.

func (*MessageMutation) ClearText

func (m *MessageMutation) ClearText()

ClearText clears the value of the "text" field.

func (*MessageMutation) ClearedEdges

func (m *MessageMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*MessageMutation) ClearedFields

func (m *MessageMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (MessageMutation) Client

func (m MessageMutation) 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 (*MessageMutation) CreatedAt

func (m *MessageMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*MessageMutation) EdgeCleared

func (m *MessageMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*MessageMutation) Field

func (m *MessageMutation) 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 (*MessageMutation) FieldCleared

func (m *MessageMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*MessageMutation) Fields

func (m *MessageMutation) 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 (*MessageMutation) FileCleared

func (m *MessageMutation) FileCleared() bool

FileCleared reports if the "file" edge to the File entity was cleared.

func (*MessageMutation) FileID

func (m *MessageMutation) FileID() (r uuid.UUID, exists bool)

FileID returns the value of the "file_id" field in the mutation.

func (*MessageMutation) FileIDCleared

func (m *MessageMutation) FileIDCleared() bool

FileIDCleared returns if the "file_id" field was cleared in this mutation.

func (*MessageMutation) FileIDs

func (m *MessageMutation) FileIDs() (ids []uuid.UUID)

FileIDs returns the "file" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use FileID instead. It exists only for internal usage by the builders.

func (*MessageMutation) ID

func (m *MessageMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*MessageMutation) IDs

func (m *MessageMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*MessageMutation) OldChatID

func (m *MessageMutation) OldChatID(ctx context.Context) (v uuid.UUID, err error)

OldChatID returns the old "chat_id" field's value of the Message entity. If the Message 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 (*MessageMutation) OldCreatedAt

func (m *MessageMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Message entity. If the Message 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 (*MessageMutation) OldField

func (m *MessageMutation) 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 (*MessageMutation) OldFileID

func (m *MessageMutation) OldFileID(ctx context.Context) (v *uuid.UUID, err error)

OldFileID returns the old "file_id" field's value of the Message entity. If the Message 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 (*MessageMutation) OldSenderID

func (m *MessageMutation) OldSenderID(ctx context.Context) (v uuid.UUID, err error)

OldSenderID returns the old "sender_id" field's value of the Message entity. If the Message 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 (*MessageMutation) OldText

func (m *MessageMutation) OldText(ctx context.Context) (v *string, err error)

OldText returns the old "text" field's value of the Message entity. If the Message 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 (*MessageMutation) OldUpdatedAt

func (m *MessageMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Message entity. If the Message 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 (*MessageMutation) Op

func (m *MessageMutation) Op() Op

Op returns the operation name.

func (*MessageMutation) RemovedEdges

func (m *MessageMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*MessageMutation) RemovedIDs

func (m *MessageMutation) 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 (*MessageMutation) ResetChat

func (m *MessageMutation) ResetChat()

ResetChat resets all changes to the "chat" edge.

func (*MessageMutation) ResetChatID

func (m *MessageMutation) ResetChatID()

ResetChatID resets all changes to the "chat_id" field.

func (*MessageMutation) ResetCreatedAt

func (m *MessageMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*MessageMutation) ResetEdge

func (m *MessageMutation) 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 (*MessageMutation) ResetField

func (m *MessageMutation) 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 (*MessageMutation) ResetFile

func (m *MessageMutation) ResetFile()

ResetFile resets all changes to the "file" edge.

func (*MessageMutation) ResetFileID

func (m *MessageMutation) ResetFileID()

ResetFileID resets all changes to the "file_id" field.

func (*MessageMutation) ResetSender

func (m *MessageMutation) ResetSender()

ResetSender resets all changes to the "sender" edge.

func (*MessageMutation) ResetSenderID

func (m *MessageMutation) ResetSenderID()

ResetSenderID resets all changes to the "sender_id" field.

func (*MessageMutation) ResetText

func (m *MessageMutation) ResetText()

ResetText resets all changes to the "text" field.

func (*MessageMutation) ResetUpdatedAt

func (m *MessageMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*MessageMutation) SenderCleared

func (m *MessageMutation) SenderCleared() bool

SenderCleared reports if the "sender" edge to the User entity was cleared.

func (*MessageMutation) SenderID

func (m *MessageMutation) SenderID() (r uuid.UUID, exists bool)

SenderID returns the value of the "sender_id" field in the mutation.

func (*MessageMutation) SenderIDs

func (m *MessageMutation) SenderIDs() (ids []uuid.UUID)

SenderIDs returns the "sender" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use SenderID instead. It exists only for internal usage by the builders.

func (*MessageMutation) SetChatID

func (m *MessageMutation) SetChatID(u uuid.UUID)

SetChatID sets the "chat_id" field.

func (*MessageMutation) SetCreatedAt

func (m *MessageMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*MessageMutation) SetField

func (m *MessageMutation) 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 (*MessageMutation) SetFileID

func (m *MessageMutation) SetFileID(u uuid.UUID)

SetFileID sets the "file_id" field.

func (*MessageMutation) SetID

func (m *MessageMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Message entities.

func (*MessageMutation) SetOp

func (m *MessageMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*MessageMutation) SetSenderID

func (m *MessageMutation) SetSenderID(u uuid.UUID)

SetSenderID sets the "sender_id" field.

func (*MessageMutation) SetText

func (m *MessageMutation) SetText(s string)

SetText sets the "text" field.

func (*MessageMutation) SetUpdatedAt

func (m *MessageMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*MessageMutation) Text

func (m *MessageMutation) Text() (r string, exists bool)

Text returns the value of the "text" field in the mutation.

func (*MessageMutation) TextCleared

func (m *MessageMutation) TextCleared() bool

TextCleared returns if the "text" field was cleared in this mutation.

func (MessageMutation) Tx

func (m MessageMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*MessageMutation) Type

func (m *MessageMutation) Type() string

Type returns the node type of this mutation (Message).

func (*MessageMutation) UpdatedAt

func (m *MessageMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*MessageMutation) Where

func (m *MessageMutation) Where(ps ...predicate.Message)

Where appends a list predicates to the MessageMutation builder.

func (*MessageMutation) WhereP

func (m *MessageMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the MessageMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type MessageQuery

type MessageQuery struct {
	// contains filtered or unexported fields
}

MessageQuery is the builder for querying Message entities.

func (*MessageQuery) Aggregate

func (mq *MessageQuery) Aggregate(fns ...AggregateFunc) *MessageSelect

Aggregate returns a MessageSelect configured with the given aggregations.

func (*MessageQuery) All

func (mq *MessageQuery) All(ctx context.Context) ([]*Message, error)

All executes the query and returns a list of Messages.

func (*MessageQuery) AllX

func (mq *MessageQuery) AllX(ctx context.Context) []*Message

AllX is like All, but panics if an error occurs.

func (*MessageQuery) Clone

func (mq *MessageQuery) Clone() *MessageQuery

Clone returns a duplicate of the MessageQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*MessageQuery) Count

func (mq *MessageQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MessageQuery) CountX

func (mq *MessageQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*MessageQuery) Exist

func (mq *MessageQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*MessageQuery) ExistX

func (mq *MessageQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*MessageQuery) First

func (mq *MessageQuery) First(ctx context.Context) (*Message, error)

First returns the first Message entity from the query. Returns a *NotFoundError when no Message was found.

func (*MessageQuery) FirstID

func (mq *MessageQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Message ID from the query. Returns a *NotFoundError when no Message ID was found.

func (*MessageQuery) FirstIDX

func (mq *MessageQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*MessageQuery) FirstX

func (mq *MessageQuery) FirstX(ctx context.Context) *Message

FirstX is like First, but panics if an error occurs.

func (*MessageQuery) GroupBy

func (mq *MessageQuery) GroupBy(field string, fields ...string) *MessageGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Message.Query().
	GroupBy(message.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MessageQuery) IDs

func (mq *MessageQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Message IDs.

func (*MessageQuery) IDsX

func (mq *MessageQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*MessageQuery) Limit

func (mq *MessageQuery) Limit(limit int) *MessageQuery

Limit the number of records to be returned by this query.

func (*MessageQuery) Offset

func (mq *MessageQuery) Offset(offset int) *MessageQuery

Offset to start from.

func (*MessageQuery) Only

func (mq *MessageQuery) Only(ctx context.Context) (*Message, error)

Only returns a single Message entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Message entity is found. Returns a *NotFoundError when no Message entities are found.

func (*MessageQuery) OnlyID

func (mq *MessageQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Message ID in the query. Returns a *NotSingularError when more than one Message ID is found. Returns a *NotFoundError when no entities are found.

func (*MessageQuery) OnlyIDX

func (mq *MessageQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*MessageQuery) OnlyX

func (mq *MessageQuery) OnlyX(ctx context.Context) *Message

OnlyX is like Only, but panics if an error occurs.

func (*MessageQuery) Order

func (mq *MessageQuery) Order(o ...message.OrderOption) *MessageQuery

Order specifies how the records should be ordered.

func (*MessageQuery) QueryChat

func (mq *MessageQuery) QueryChat() *ChatQuery

QueryChat chains the current query on the "chat" edge.

func (*MessageQuery) QueryFile

func (mq *MessageQuery) QueryFile() *FileQuery

QueryFile chains the current query on the "file" edge.

func (*MessageQuery) QuerySender

func (mq *MessageQuery) QuerySender() *UserQuery

QuerySender chains the current query on the "sender" edge.

func (*MessageQuery) Select

func (mq *MessageQuery) Select(fields ...string) *MessageSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Message.Query().
	Select(message.FieldCreatedAt).
	Scan(ctx, &v)

func (*MessageQuery) Unique

func (mq *MessageQuery) Unique(unique bool) *MessageQuery

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 (*MessageQuery) Where

func (mq *MessageQuery) Where(ps ...predicate.Message) *MessageQuery

Where adds a new predicate for the MessageQuery builder.

func (*MessageQuery) WithChat

func (mq *MessageQuery) WithChat(opts ...func(*ChatQuery)) *MessageQuery

WithChat tells the query-builder to eager-load the nodes that are connected to the "chat" edge. The optional arguments are used to configure the query builder of the edge.

func (*MessageQuery) WithFile

func (mq *MessageQuery) WithFile(opts ...func(*FileQuery)) *MessageQuery

WithFile tells the query-builder to eager-load the nodes that are connected to the "file" edge. The optional arguments are used to configure the query builder of the edge.

func (*MessageQuery) WithSender

func (mq *MessageQuery) WithSender(opts ...func(*UserQuery)) *MessageQuery

WithSender tells the query-builder to eager-load the nodes that are connected to the "sender" edge. The optional arguments are used to configure the query builder of the edge.

type MessageSelect

type MessageSelect struct {
	*MessageQuery
	// contains filtered or unexported fields
}

MessageSelect is the builder for selecting fields of Message entities.

func (*MessageSelect) Aggregate

func (ms *MessageSelect) Aggregate(fns ...AggregateFunc) *MessageSelect

Aggregate adds the given aggregation functions to the selector query.

func (*MessageSelect) Bool

func (s *MessageSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MessageSelect) BoolX

func (s *MessageSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MessageSelect) Bools

func (s *MessageSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MessageSelect) BoolsX

func (s *MessageSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MessageSelect) Float64

func (s *MessageSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MessageSelect) Float64X

func (s *MessageSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MessageSelect) Float64s

func (s *MessageSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MessageSelect) Float64sX

func (s *MessageSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MessageSelect) Int

func (s *MessageSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MessageSelect) IntX

func (s *MessageSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MessageSelect) Ints

func (s *MessageSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MessageSelect) IntsX

func (s *MessageSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MessageSelect) Scan

func (ms *MessageSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MessageSelect) ScanX

func (s *MessageSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MessageSelect) String

func (s *MessageSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MessageSelect) StringX

func (s *MessageSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MessageSelect) Strings

func (s *MessageSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MessageSelect) StringsX

func (s *MessageSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MessageUpdate

type MessageUpdate struct {
	// contains filtered or unexported fields
}

MessageUpdate is the builder for updating Message entities.

func (*MessageUpdate) ClearChat

func (mu *MessageUpdate) ClearChat() *MessageUpdate

ClearChat clears the "chat" edge to the Chat entity.

func (*MessageUpdate) ClearFile

func (mu *MessageUpdate) ClearFile() *MessageUpdate

ClearFile clears the "file" edge to the File entity.

func (*MessageUpdate) ClearFileID

func (mu *MessageUpdate) ClearFileID() *MessageUpdate

ClearFileID clears the value of the "file_id" field.

func (*MessageUpdate) ClearSender

func (mu *MessageUpdate) ClearSender() *MessageUpdate

ClearSender clears the "sender" edge to the User entity.

func (*MessageUpdate) ClearText

func (mu *MessageUpdate) ClearText() *MessageUpdate

ClearText clears the value of the "text" field.

func (*MessageUpdate) Exec

func (mu *MessageUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MessageUpdate) ExecX

func (mu *MessageUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MessageUpdate) Mutation

func (mu *MessageUpdate) Mutation() *MessageMutation

Mutation returns the MessageMutation object of the builder.

func (*MessageUpdate) Save

func (mu *MessageUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*MessageUpdate) SaveX

func (mu *MessageUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*MessageUpdate) SetChat

func (mu *MessageUpdate) SetChat(c *Chat) *MessageUpdate

SetChat sets the "chat" edge to the Chat entity.

func (*MessageUpdate) SetChatID

func (mu *MessageUpdate) SetChatID(u uuid.UUID) *MessageUpdate

SetChatID sets the "chat_id" field.

func (*MessageUpdate) SetCreatedAt

func (mu *MessageUpdate) SetCreatedAt(t time.Time) *MessageUpdate

SetCreatedAt sets the "created_at" field.

func (*MessageUpdate) SetFile

func (mu *MessageUpdate) SetFile(f *File) *MessageUpdate

SetFile sets the "file" edge to the File entity.

func (*MessageUpdate) SetFileID

func (mu *MessageUpdate) SetFileID(u uuid.UUID) *MessageUpdate

SetFileID sets the "file_id" field.

func (*MessageUpdate) SetNillableChatID

func (mu *MessageUpdate) SetNillableChatID(u *uuid.UUID) *MessageUpdate

SetNillableChatID sets the "chat_id" field if the given value is not nil.

func (*MessageUpdate) SetNillableCreatedAt

func (mu *MessageUpdate) SetNillableCreatedAt(t *time.Time) *MessageUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*MessageUpdate) SetNillableFileID

func (mu *MessageUpdate) SetNillableFileID(u *uuid.UUID) *MessageUpdate

SetNillableFileID sets the "file_id" field if the given value is not nil.

func (*MessageUpdate) SetNillableSenderID

func (mu *MessageUpdate) SetNillableSenderID(u *uuid.UUID) *MessageUpdate

SetNillableSenderID sets the "sender_id" field if the given value is not nil.

func (*MessageUpdate) SetNillableText

func (mu *MessageUpdate) SetNillableText(s *string) *MessageUpdate

SetNillableText sets the "text" field if the given value is not nil.

func (*MessageUpdate) SetSender

func (mu *MessageUpdate) SetSender(u *User) *MessageUpdate

SetSender sets the "sender" edge to the User entity.

func (*MessageUpdate) SetSenderID

func (mu *MessageUpdate) SetSenderID(u uuid.UUID) *MessageUpdate

SetSenderID sets the "sender_id" field.

func (*MessageUpdate) SetText

func (mu *MessageUpdate) SetText(s string) *MessageUpdate

SetText sets the "text" field.

func (*MessageUpdate) SetUpdatedAt

func (mu *MessageUpdate) SetUpdatedAt(t time.Time) *MessageUpdate

SetUpdatedAt sets the "updated_at" field.

func (*MessageUpdate) Where

func (mu *MessageUpdate) Where(ps ...predicate.Message) *MessageUpdate

Where appends a list predicates to the MessageUpdate builder.

type MessageUpdateOne

type MessageUpdateOne struct {
	// contains filtered or unexported fields
}

MessageUpdateOne is the builder for updating a single Message entity.

func (*MessageUpdateOne) ClearChat

func (muo *MessageUpdateOne) ClearChat() *MessageUpdateOne

ClearChat clears the "chat" edge to the Chat entity.

func (*MessageUpdateOne) ClearFile

func (muo *MessageUpdateOne) ClearFile() *MessageUpdateOne

ClearFile clears the "file" edge to the File entity.

func (*MessageUpdateOne) ClearFileID

func (muo *MessageUpdateOne) ClearFileID() *MessageUpdateOne

ClearFileID clears the value of the "file_id" field.

func (*MessageUpdateOne) ClearSender

func (muo *MessageUpdateOne) ClearSender() *MessageUpdateOne

ClearSender clears the "sender" edge to the User entity.

func (*MessageUpdateOne) ClearText

func (muo *MessageUpdateOne) ClearText() *MessageUpdateOne

ClearText clears the value of the "text" field.

func (*MessageUpdateOne) Exec

func (muo *MessageUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MessageUpdateOne) ExecX

func (muo *MessageUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MessageUpdateOne) Mutation

func (muo *MessageUpdateOne) Mutation() *MessageMutation

Mutation returns the MessageMutation object of the builder.

func (*MessageUpdateOne) Save

func (muo *MessageUpdateOne) Save(ctx context.Context) (*Message, error)

Save executes the query and returns the updated Message entity.

func (*MessageUpdateOne) SaveX

func (muo *MessageUpdateOne) SaveX(ctx context.Context) *Message

SaveX is like Save, but panics if an error occurs.

func (*MessageUpdateOne) Select

func (muo *MessageUpdateOne) Select(field string, fields ...string) *MessageUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*MessageUpdateOne) SetChat

func (muo *MessageUpdateOne) SetChat(c *Chat) *MessageUpdateOne

SetChat sets the "chat" edge to the Chat entity.

func (*MessageUpdateOne) SetChatID

func (muo *MessageUpdateOne) SetChatID(u uuid.UUID) *MessageUpdateOne

SetChatID sets the "chat_id" field.

func (*MessageUpdateOne) SetCreatedAt

func (muo *MessageUpdateOne) SetCreatedAt(t time.Time) *MessageUpdateOne

SetCreatedAt sets the "created_at" field.

func (*MessageUpdateOne) SetFile

func (muo *MessageUpdateOne) SetFile(f *File) *MessageUpdateOne

SetFile sets the "file" edge to the File entity.

func (*MessageUpdateOne) SetFileID

func (muo *MessageUpdateOne) SetFileID(u uuid.UUID) *MessageUpdateOne

SetFileID sets the "file_id" field.

func (*MessageUpdateOne) SetNillableChatID

func (muo *MessageUpdateOne) SetNillableChatID(u *uuid.UUID) *MessageUpdateOne

SetNillableChatID sets the "chat_id" field if the given value is not nil.

func (*MessageUpdateOne) SetNillableCreatedAt

func (muo *MessageUpdateOne) SetNillableCreatedAt(t *time.Time) *MessageUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*MessageUpdateOne) SetNillableFileID

func (muo *MessageUpdateOne) SetNillableFileID(u *uuid.UUID) *MessageUpdateOne

SetNillableFileID sets the "file_id" field if the given value is not nil.

func (*MessageUpdateOne) SetNillableSenderID

func (muo *MessageUpdateOne) SetNillableSenderID(u *uuid.UUID) *MessageUpdateOne

SetNillableSenderID sets the "sender_id" field if the given value is not nil.

func (*MessageUpdateOne) SetNillableText

func (muo *MessageUpdateOne) SetNillableText(s *string) *MessageUpdateOne

SetNillableText sets the "text" field if the given value is not nil.

func (*MessageUpdateOne) SetSender

func (muo *MessageUpdateOne) SetSender(u *User) *MessageUpdateOne

SetSender sets the "sender" edge to the User entity.

func (*MessageUpdateOne) SetSenderID

func (muo *MessageUpdateOne) SetSenderID(u uuid.UUID) *MessageUpdateOne

SetSenderID sets the "sender_id" field.

func (*MessageUpdateOne) SetText

func (muo *MessageUpdateOne) SetText(s string) *MessageUpdateOne

SetText sets the "text" field.

func (*MessageUpdateOne) SetUpdatedAt

func (muo *MessageUpdateOne) SetUpdatedAt(t time.Time) *MessageUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*MessageUpdateOne) Where

Where appends a list predicates to the MessageUpdate builder.

type Messages

type Messages []*Message

Messages is a parsable slice of Message.

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 Notification

type Notification struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// SenderID holds the value of the "sender_id" field.
	SenderID *uuid.UUID `json:"sender_id,omitempty"`
	// Ntype holds the value of the "ntype" field.
	Ntype notification.Ntype `json:"ntype,omitempty"`
	// PostID holds the value of the "post_id" field.
	PostID *uuid.UUID `json:"post_id,omitempty"`
	// CommentID holds the value of the "comment_id" field.
	CommentID *uuid.UUID `json:"comment_id,omitempty"`
	// ReplyID holds the value of the "reply_id" field.
	ReplyID *uuid.UUID `json:"reply_id,omitempty"`
	// Text holds the value of the "text" field.
	Text *string `json:"text,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the NotificationQuery when eager-loading is set.
	Edges NotificationEdges `json:"edges"`
	// contains filtered or unexported fields
}

Notification is the model entity for the Notification schema.

func (*Notification) QueryComment

func (n *Notification) QueryComment() *CommentQuery

QueryComment queries the "comment" edge of the Notification entity.

func (*Notification) QueryPost

func (n *Notification) QueryPost() *PostQuery

QueryPost queries the "post" edge of the Notification entity.

func (*Notification) QueryReadBy

func (n *Notification) QueryReadBy() *UserQuery

QueryReadBy queries the "read_by" edge of the Notification entity.

func (*Notification) QueryReceivers

func (n *Notification) QueryReceivers() *UserQuery

QueryReceivers queries the "receivers" edge of the Notification entity.

func (*Notification) QueryReply

func (n *Notification) QueryReply() *ReplyQuery

QueryReply queries the "reply" edge of the Notification entity.

func (*Notification) QuerySender

func (n *Notification) QuerySender() *UserQuery

QuerySender queries the "sender" edge of the Notification entity.

func (*Notification) String

func (n *Notification) String() string

String implements the fmt.Stringer.

func (*Notification) Unwrap

func (n *Notification) Unwrap() *Notification

Unwrap unwraps the Notification 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 (*Notification) Update

func (n *Notification) Update() *NotificationUpdateOne

Update returns a builder for updating this Notification. Note that you need to call Notification.Unwrap() before calling this method if this Notification was returned from a transaction, and the transaction was committed or rolled back.

func (*Notification) Value

func (n *Notification) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Notification. This includes values selected through modifiers, order, etc.

type NotificationClient

type NotificationClient struct {
	// contains filtered or unexported fields
}

NotificationClient is a client for the Notification schema.

func NewNotificationClient

func NewNotificationClient(c config) *NotificationClient

NewNotificationClient returns a client for the Notification from the given config.

func (*NotificationClient) Create

Create returns a builder for creating a Notification entity.

func (*NotificationClient) CreateBulk

func (c *NotificationClient) CreateBulk(builders ...*NotificationCreate) *NotificationCreateBulk

CreateBulk returns a builder for creating a bulk of Notification entities.

func (*NotificationClient) Delete

Delete returns a delete builder for Notification.

func (*NotificationClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*NotificationClient) DeleteOneID

func (c *NotificationClient) DeleteOneID(id uuid.UUID) *NotificationDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*NotificationClient) Get

Get returns a Notification entity by its id.

func (*NotificationClient) GetX

GetX is like Get, but panics if an error occurs.

func (*NotificationClient) Hooks

func (c *NotificationClient) Hooks() []Hook

Hooks returns the client hooks.

func (*NotificationClient) Intercept

func (c *NotificationClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `notification.Intercept(f(g(h())))`.

func (*NotificationClient) Interceptors

func (c *NotificationClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*NotificationClient) MapCreateBulk

func (c *NotificationClient) MapCreateBulk(slice any, setFunc func(*NotificationCreate, int)) *NotificationCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*NotificationClient) Query

Query returns a query builder for Notification.

func (*NotificationClient) QueryComment

func (c *NotificationClient) QueryComment(n *Notification) *CommentQuery

QueryComment queries the comment edge of a Notification.

func (*NotificationClient) QueryPost

func (c *NotificationClient) QueryPost(n *Notification) *PostQuery

QueryPost queries the post edge of a Notification.

func (*NotificationClient) QueryReadBy

func (c *NotificationClient) QueryReadBy(n *Notification) *UserQuery

QueryReadBy queries the read_by edge of a Notification.

func (*NotificationClient) QueryReceivers

func (c *NotificationClient) QueryReceivers(n *Notification) *UserQuery

QueryReceivers queries the receivers edge of a Notification.

func (*NotificationClient) QueryReply

func (c *NotificationClient) QueryReply(n *Notification) *ReplyQuery

QueryReply queries the reply edge of a Notification.

func (*NotificationClient) QuerySender

func (c *NotificationClient) QuerySender(n *Notification) *UserQuery

QuerySender queries the sender edge of a Notification.

func (*NotificationClient) Update

Update returns an update builder for Notification.

func (*NotificationClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*NotificationClient) UpdateOneID

func (c *NotificationClient) UpdateOneID(id uuid.UUID) *NotificationUpdateOne

UpdateOneID returns an update builder for the given id.

func (*NotificationClient) Use

func (c *NotificationClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `notification.Hooks(f(g(h())))`.

type NotificationCreate

type NotificationCreate struct {
	// contains filtered or unexported fields
}

NotificationCreate is the builder for creating a Notification entity.

func (*NotificationCreate) AddReadBy

func (nc *NotificationCreate) AddReadBy(u ...*User) *NotificationCreate

AddReadBy adds the "read_by" edges to the User entity.

func (*NotificationCreate) AddReadByIDs

func (nc *NotificationCreate) AddReadByIDs(ids ...uuid.UUID) *NotificationCreate

AddReadByIDs adds the "read_by" edge to the User entity by IDs.

func (*NotificationCreate) AddReceiverIDs

func (nc *NotificationCreate) AddReceiverIDs(ids ...uuid.UUID) *NotificationCreate

AddReceiverIDs adds the "receivers" edge to the User entity by IDs.

func (*NotificationCreate) AddReceivers

func (nc *NotificationCreate) AddReceivers(u ...*User) *NotificationCreate

AddReceivers adds the "receivers" edges to the User entity.

func (*NotificationCreate) Exec

func (nc *NotificationCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*NotificationCreate) ExecX

func (nc *NotificationCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NotificationCreate) Mutation

func (nc *NotificationCreate) Mutation() *NotificationMutation

Mutation returns the NotificationMutation object of the builder.

func (*NotificationCreate) Save

Save creates the Notification in the database.

func (*NotificationCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*NotificationCreate) SetComment

func (nc *NotificationCreate) SetComment(c *Comment) *NotificationCreate

SetComment sets the "comment" edge to the Comment entity.

func (*NotificationCreate) SetCommentID

func (nc *NotificationCreate) SetCommentID(u uuid.UUID) *NotificationCreate

SetCommentID sets the "comment_id" field.

func (*NotificationCreate) SetCreatedAt

func (nc *NotificationCreate) SetCreatedAt(t time.Time) *NotificationCreate

SetCreatedAt sets the "created_at" field.

func (*NotificationCreate) SetID

SetID sets the "id" field.

func (*NotificationCreate) SetNillableCommentID

func (nc *NotificationCreate) SetNillableCommentID(u *uuid.UUID) *NotificationCreate

SetNillableCommentID sets the "comment_id" field if the given value is not nil.

func (*NotificationCreate) SetNillableCreatedAt

func (nc *NotificationCreate) SetNillableCreatedAt(t *time.Time) *NotificationCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*NotificationCreate) SetNillableID

func (nc *NotificationCreate) SetNillableID(u *uuid.UUID) *NotificationCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*NotificationCreate) SetNillablePostID

func (nc *NotificationCreate) SetNillablePostID(u *uuid.UUID) *NotificationCreate

SetNillablePostID sets the "post_id" field if the given value is not nil.

func (*NotificationCreate) SetNillableReplyID

func (nc *NotificationCreate) SetNillableReplyID(u *uuid.UUID) *NotificationCreate

SetNillableReplyID sets the "reply_id" field if the given value is not nil.

func (*NotificationCreate) SetNillableSenderID

func (nc *NotificationCreate) SetNillableSenderID(u *uuid.UUID) *NotificationCreate

SetNillableSenderID sets the "sender_id" field if the given value is not nil.

func (*NotificationCreate) SetNillableText

func (nc *NotificationCreate) SetNillableText(s *string) *NotificationCreate

SetNillableText sets the "text" field if the given value is not nil.

func (*NotificationCreate) SetNillableUpdatedAt

func (nc *NotificationCreate) SetNillableUpdatedAt(t *time.Time) *NotificationCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*NotificationCreate) SetNtype

SetNtype sets the "ntype" field.

func (*NotificationCreate) SetPost

func (nc *NotificationCreate) SetPost(p *Post) *NotificationCreate

SetPost sets the "post" edge to the Post entity.

func (*NotificationCreate) SetPostID

func (nc *NotificationCreate) SetPostID(u uuid.UUID) *NotificationCreate

SetPostID sets the "post_id" field.

func (*NotificationCreate) SetReply

func (nc *NotificationCreate) SetReply(r *Reply) *NotificationCreate

SetReply sets the "reply" edge to the Reply entity.

func (*NotificationCreate) SetReplyID

func (nc *NotificationCreate) SetReplyID(u uuid.UUID) *NotificationCreate

SetReplyID sets the "reply_id" field.

func (*NotificationCreate) SetSender

func (nc *NotificationCreate) SetSender(u *User) *NotificationCreate

SetSender sets the "sender" edge to the User entity.

func (*NotificationCreate) SetSenderID

func (nc *NotificationCreate) SetSenderID(u uuid.UUID) *NotificationCreate

SetSenderID sets the "sender_id" field.

func (*NotificationCreate) SetText

SetText sets the "text" field.

func (*NotificationCreate) SetUpdatedAt

func (nc *NotificationCreate) SetUpdatedAt(t time.Time) *NotificationCreate

SetUpdatedAt sets the "updated_at" field.

type NotificationCreateBulk

type NotificationCreateBulk struct {
	// contains filtered or unexported fields
}

NotificationCreateBulk is the builder for creating many Notification entities in bulk.

func (*NotificationCreateBulk) Exec

Exec executes the query.

func (*NotificationCreateBulk) ExecX

func (ncb *NotificationCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NotificationCreateBulk) Save

Save creates the Notification entities in the database.

func (*NotificationCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type NotificationDelete

type NotificationDelete struct {
	// contains filtered or unexported fields
}

NotificationDelete is the builder for deleting a Notification entity.

func (*NotificationDelete) Exec

func (nd *NotificationDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*NotificationDelete) ExecX

func (nd *NotificationDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*NotificationDelete) Where

Where appends a list predicates to the NotificationDelete builder.

type NotificationDeleteOne

type NotificationDeleteOne struct {
	// contains filtered or unexported fields
}

NotificationDeleteOne is the builder for deleting a single Notification entity.

func (*NotificationDeleteOne) Exec

func (ndo *NotificationDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*NotificationDeleteOne) ExecX

func (ndo *NotificationDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NotificationDeleteOne) Where

Where appends a list predicates to the NotificationDelete builder.

type NotificationEdges

type NotificationEdges struct {
	// Sender holds the value of the sender edge.
	Sender *User `json:"sender,omitempty"`
	// Receivers holds the value of the receivers edge.
	Receivers []*User `json:"receivers,omitempty"`
	// Post holds the value of the post edge.
	Post *Post `json:"post,omitempty"`
	// Comment holds the value of the comment edge.
	Comment *Comment `json:"comment,omitempty"`
	// Reply holds the value of the reply edge.
	Reply *Reply `json:"reply,omitempty"`
	// ReadBy holds the value of the read_by edge.
	ReadBy []*User `json:"read_by,omitempty"`
	// contains filtered or unexported fields
}

NotificationEdges holds the relations/edges for other nodes in the graph.

func (NotificationEdges) CommentOrErr

func (e NotificationEdges) CommentOrErr() (*Comment, error)

CommentOrErr returns the Comment value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (NotificationEdges) PostOrErr

func (e NotificationEdges) PostOrErr() (*Post, error)

PostOrErr returns the Post value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (NotificationEdges) ReadByOrErr

func (e NotificationEdges) ReadByOrErr() ([]*User, error)

ReadByOrErr returns the ReadBy value or an error if the edge was not loaded in eager-loading.

func (NotificationEdges) ReceiversOrErr

func (e NotificationEdges) ReceiversOrErr() ([]*User, error)

ReceiversOrErr returns the Receivers value or an error if the edge was not loaded in eager-loading.

func (NotificationEdges) ReplyOrErr

func (e NotificationEdges) ReplyOrErr() (*Reply, error)

ReplyOrErr returns the Reply value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (NotificationEdges) SenderOrErr

func (e NotificationEdges) SenderOrErr() (*User, error)

SenderOrErr returns the Sender value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type NotificationGroupBy

type NotificationGroupBy struct {
	// contains filtered or unexported fields
}

NotificationGroupBy is the group-by builder for Notification entities.

func (*NotificationGroupBy) Aggregate

func (ngb *NotificationGroupBy) Aggregate(fns ...AggregateFunc) *NotificationGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*NotificationGroupBy) Bool

func (s *NotificationGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*NotificationGroupBy) BoolX

func (s *NotificationGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NotificationGroupBy) Bools

func (s *NotificationGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*NotificationGroupBy) BoolsX

func (s *NotificationGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NotificationGroupBy) Float64

func (s *NotificationGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*NotificationGroupBy) Float64X

func (s *NotificationGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NotificationGroupBy) Float64s

func (s *NotificationGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*NotificationGroupBy) Float64sX

func (s *NotificationGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NotificationGroupBy) Int

func (s *NotificationGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*NotificationGroupBy) IntX

func (s *NotificationGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NotificationGroupBy) Ints

func (s *NotificationGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*NotificationGroupBy) IntsX

func (s *NotificationGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NotificationGroupBy) Scan

func (ngb *NotificationGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*NotificationGroupBy) ScanX

func (s *NotificationGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*NotificationGroupBy) String

func (s *NotificationGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*NotificationGroupBy) StringX

func (s *NotificationGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NotificationGroupBy) Strings

func (s *NotificationGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*NotificationGroupBy) StringsX

func (s *NotificationGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NotificationMutation

type NotificationMutation struct {
	// contains filtered or unexported fields
}

NotificationMutation represents an operation that mutates the Notification nodes in the graph.

func (*NotificationMutation) AddField

func (m *NotificationMutation) 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 (*NotificationMutation) AddReadByIDs

func (m *NotificationMutation) AddReadByIDs(ids ...uuid.UUID)

AddReadByIDs adds the "read_by" edge to the User entity by ids.

func (*NotificationMutation) AddReceiverIDs

func (m *NotificationMutation) AddReceiverIDs(ids ...uuid.UUID)

AddReceiverIDs adds the "receivers" edge to the User entity by ids.

func (*NotificationMutation) AddedEdges

func (m *NotificationMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*NotificationMutation) AddedField

func (m *NotificationMutation) 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 (*NotificationMutation) AddedFields

func (m *NotificationMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*NotificationMutation) AddedIDs

func (m *NotificationMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*NotificationMutation) ClearComment

func (m *NotificationMutation) ClearComment()

ClearComment clears the "comment" edge to the Comment entity.

func (*NotificationMutation) ClearCommentID

func (m *NotificationMutation) ClearCommentID()

ClearCommentID clears the value of the "comment_id" field.

func (*NotificationMutation) ClearEdge

func (m *NotificationMutation) 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 (*NotificationMutation) ClearField

func (m *NotificationMutation) 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 (*NotificationMutation) ClearPost

func (m *NotificationMutation) ClearPost()

ClearPost clears the "post" edge to the Post entity.

func (*NotificationMutation) ClearPostID

func (m *NotificationMutation) ClearPostID()

ClearPostID clears the value of the "post_id" field.

func (*NotificationMutation) ClearReadBy

func (m *NotificationMutation) ClearReadBy()

ClearReadBy clears the "read_by" edge to the User entity.

func (*NotificationMutation) ClearReceivers

func (m *NotificationMutation) ClearReceivers()

ClearReceivers clears the "receivers" edge to the User entity.

func (*NotificationMutation) ClearReply

func (m *NotificationMutation) ClearReply()

ClearReply clears the "reply" edge to the Reply entity.

func (*NotificationMutation) ClearReplyID

func (m *NotificationMutation) ClearReplyID()

ClearReplyID clears the value of the "reply_id" field.

func (*NotificationMutation) ClearSender

func (m *NotificationMutation) ClearSender()

ClearSender clears the "sender" edge to the User entity.

func (*NotificationMutation) ClearSenderID

func (m *NotificationMutation) ClearSenderID()

ClearSenderID clears the value of the "sender_id" field.

func (*NotificationMutation) ClearText

func (m *NotificationMutation) ClearText()

ClearText clears the value of the "text" field.

func (*NotificationMutation) ClearedEdges

func (m *NotificationMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*NotificationMutation) ClearedFields

func (m *NotificationMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (NotificationMutation) Client

func (m NotificationMutation) 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 (*NotificationMutation) CommentCleared

func (m *NotificationMutation) CommentCleared() bool

CommentCleared reports if the "comment" edge to the Comment entity was cleared.

func (*NotificationMutation) CommentID

func (m *NotificationMutation) CommentID() (r uuid.UUID, exists bool)

CommentID returns the value of the "comment_id" field in the mutation.

func (*NotificationMutation) CommentIDCleared

func (m *NotificationMutation) CommentIDCleared() bool

CommentIDCleared returns if the "comment_id" field was cleared in this mutation.

func (*NotificationMutation) CommentIDs

func (m *NotificationMutation) CommentIDs() (ids []uuid.UUID)

CommentIDs returns the "comment" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CommentID instead. It exists only for internal usage by the builders.

func (*NotificationMutation) CreatedAt

func (m *NotificationMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*NotificationMutation) EdgeCleared

func (m *NotificationMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*NotificationMutation) Field

func (m *NotificationMutation) 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 (*NotificationMutation) FieldCleared

func (m *NotificationMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*NotificationMutation) Fields

func (m *NotificationMutation) 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 (*NotificationMutation) ID

func (m *NotificationMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*NotificationMutation) IDs

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*NotificationMutation) Ntype

func (m *NotificationMutation) Ntype() (r notification.Ntype, exists bool)

Ntype returns the value of the "ntype" field in the mutation.

func (*NotificationMutation) OldCommentID

func (m *NotificationMutation) OldCommentID(ctx context.Context) (v *uuid.UUID, err error)

OldCommentID returns the old "comment_id" field's value of the Notification entity. If the Notification 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 (*NotificationMutation) OldCreatedAt

func (m *NotificationMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Notification entity. If the Notification 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 (*NotificationMutation) OldField

func (m *NotificationMutation) 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 (*NotificationMutation) OldNtype

func (m *NotificationMutation) OldNtype(ctx context.Context) (v notification.Ntype, err error)

OldNtype returns the old "ntype" field's value of the Notification entity. If the Notification 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 (*NotificationMutation) OldPostID

func (m *NotificationMutation) OldPostID(ctx context.Context) (v *uuid.UUID, err error)

OldPostID returns the old "post_id" field's value of the Notification entity. If the Notification 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 (*NotificationMutation) OldReplyID

func (m *NotificationMutation) OldReplyID(ctx context.Context) (v *uuid.UUID, err error)

OldReplyID returns the old "reply_id" field's value of the Notification entity. If the Notification 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 (*NotificationMutation) OldSenderID

func (m *NotificationMutation) OldSenderID(ctx context.Context) (v *uuid.UUID, err error)

OldSenderID returns the old "sender_id" field's value of the Notification entity. If the Notification 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 (*NotificationMutation) OldText

func (m *NotificationMutation) OldText(ctx context.Context) (v *string, err error)

OldText returns the old "text" field's value of the Notification entity. If the Notification 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 (*NotificationMutation) OldUpdatedAt

func (m *NotificationMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Notification entity. If the Notification 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 (*NotificationMutation) Op

func (m *NotificationMutation) Op() Op

Op returns the operation name.

func (*NotificationMutation) PostCleared

func (m *NotificationMutation) PostCleared() bool

PostCleared reports if the "post" edge to the Post entity was cleared.

func (*NotificationMutation) PostID

func (m *NotificationMutation) PostID() (r uuid.UUID, exists bool)

PostID returns the value of the "post_id" field in the mutation.

func (*NotificationMutation) PostIDCleared

func (m *NotificationMutation) PostIDCleared() bool

PostIDCleared returns if the "post_id" field was cleared in this mutation.

func (*NotificationMutation) PostIDs

func (m *NotificationMutation) PostIDs() (ids []uuid.UUID)

PostIDs returns the "post" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use PostID instead. It exists only for internal usage by the builders.

func (*NotificationMutation) ReadByCleared

func (m *NotificationMutation) ReadByCleared() bool

ReadByCleared reports if the "read_by" edge to the User entity was cleared.

func (*NotificationMutation) ReadByIDs

func (m *NotificationMutation) ReadByIDs() (ids []uuid.UUID)

ReadByIDs returns the "read_by" edge IDs in the mutation.

func (*NotificationMutation) ReceiversCleared

func (m *NotificationMutation) ReceiversCleared() bool

ReceiversCleared reports if the "receivers" edge to the User entity was cleared.

func (*NotificationMutation) ReceiversIDs

func (m *NotificationMutation) ReceiversIDs() (ids []uuid.UUID)

ReceiversIDs returns the "receivers" edge IDs in the mutation.

func (*NotificationMutation) RemoveReadByIDs

func (m *NotificationMutation) RemoveReadByIDs(ids ...uuid.UUID)

RemoveReadByIDs removes the "read_by" edge to the User entity by IDs.

func (*NotificationMutation) RemoveReceiverIDs

func (m *NotificationMutation) RemoveReceiverIDs(ids ...uuid.UUID)

RemoveReceiverIDs removes the "receivers" edge to the User entity by IDs.

func (*NotificationMutation) RemovedEdges

func (m *NotificationMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*NotificationMutation) RemovedIDs

func (m *NotificationMutation) 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 (*NotificationMutation) RemovedReadByIDs

func (m *NotificationMutation) RemovedReadByIDs() (ids []uuid.UUID)

RemovedReadBy returns the removed IDs of the "read_by" edge to the User entity.

func (*NotificationMutation) RemovedReceiversIDs

func (m *NotificationMutation) RemovedReceiversIDs() (ids []uuid.UUID)

RemovedReceivers returns the removed IDs of the "receivers" edge to the User entity.

func (*NotificationMutation) ReplyCleared

func (m *NotificationMutation) ReplyCleared() bool

ReplyCleared reports if the "reply" edge to the Reply entity was cleared.

func (*NotificationMutation) ReplyID

func (m *NotificationMutation) ReplyID() (r uuid.UUID, exists bool)

ReplyID returns the value of the "reply_id" field in the mutation.

func (*NotificationMutation) ReplyIDCleared

func (m *NotificationMutation) ReplyIDCleared() bool

ReplyIDCleared returns if the "reply_id" field was cleared in this mutation.

func (*NotificationMutation) ReplyIDs

func (m *NotificationMutation) ReplyIDs() (ids []uuid.UUID)

ReplyIDs returns the "reply" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ReplyID instead. It exists only for internal usage by the builders.

func (*NotificationMutation) ResetComment

func (m *NotificationMutation) ResetComment()

ResetComment resets all changes to the "comment" edge.

func (*NotificationMutation) ResetCommentID

func (m *NotificationMutation) ResetCommentID()

ResetCommentID resets all changes to the "comment_id" field.

func (*NotificationMutation) ResetCreatedAt

func (m *NotificationMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*NotificationMutation) ResetEdge

func (m *NotificationMutation) 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 (*NotificationMutation) ResetField

func (m *NotificationMutation) 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 (*NotificationMutation) ResetNtype

func (m *NotificationMutation) ResetNtype()

ResetNtype resets all changes to the "ntype" field.

func (*NotificationMutation) ResetPost

func (m *NotificationMutation) ResetPost()

ResetPost resets all changes to the "post" edge.

func (*NotificationMutation) ResetPostID

func (m *NotificationMutation) ResetPostID()

ResetPostID resets all changes to the "post_id" field.

func (*NotificationMutation) ResetReadBy

func (m *NotificationMutation) ResetReadBy()

ResetReadBy resets all changes to the "read_by" edge.

func (*NotificationMutation) ResetReceivers

func (m *NotificationMutation) ResetReceivers()

ResetReceivers resets all changes to the "receivers" edge.

func (*NotificationMutation) ResetReply

func (m *NotificationMutation) ResetReply()

ResetReply resets all changes to the "reply" edge.

func (*NotificationMutation) ResetReplyID

func (m *NotificationMutation) ResetReplyID()

ResetReplyID resets all changes to the "reply_id" field.

func (*NotificationMutation) ResetSender

func (m *NotificationMutation) ResetSender()

ResetSender resets all changes to the "sender" edge.

func (*NotificationMutation) ResetSenderID

func (m *NotificationMutation) ResetSenderID()

ResetSenderID resets all changes to the "sender_id" field.

func (*NotificationMutation) ResetText

func (m *NotificationMutation) ResetText()

ResetText resets all changes to the "text" field.

func (*NotificationMutation) ResetUpdatedAt

func (m *NotificationMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*NotificationMutation) SenderCleared

func (m *NotificationMutation) SenderCleared() bool

SenderCleared reports if the "sender" edge to the User entity was cleared.

func (*NotificationMutation) SenderID

func (m *NotificationMutation) SenderID() (r uuid.UUID, exists bool)

SenderID returns the value of the "sender_id" field in the mutation.

func (*NotificationMutation) SenderIDCleared

func (m *NotificationMutation) SenderIDCleared() bool

SenderIDCleared returns if the "sender_id" field was cleared in this mutation.

func (*NotificationMutation) SenderIDs

func (m *NotificationMutation) SenderIDs() (ids []uuid.UUID)

SenderIDs returns the "sender" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use SenderID instead. It exists only for internal usage by the builders.

func (*NotificationMutation) SetCommentID

func (m *NotificationMutation) SetCommentID(u uuid.UUID)

SetCommentID sets the "comment_id" field.

func (*NotificationMutation) SetCreatedAt

func (m *NotificationMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*NotificationMutation) SetField

func (m *NotificationMutation) 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 (*NotificationMutation) SetID

func (m *NotificationMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Notification entities.

func (*NotificationMutation) SetNtype

func (m *NotificationMutation) SetNtype(n notification.Ntype)

SetNtype sets the "ntype" field.

func (*NotificationMutation) SetOp

func (m *NotificationMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*NotificationMutation) SetPostID

func (m *NotificationMutation) SetPostID(u uuid.UUID)

SetPostID sets the "post_id" field.

func (*NotificationMutation) SetReplyID

func (m *NotificationMutation) SetReplyID(u uuid.UUID)

SetReplyID sets the "reply_id" field.

func (*NotificationMutation) SetSenderID

func (m *NotificationMutation) SetSenderID(u uuid.UUID)

SetSenderID sets the "sender_id" field.

func (*NotificationMutation) SetText

func (m *NotificationMutation) SetText(s string)

SetText sets the "text" field.

func (*NotificationMutation) SetUpdatedAt

func (m *NotificationMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*NotificationMutation) Text

func (m *NotificationMutation) Text() (r string, exists bool)

Text returns the value of the "text" field in the mutation.

func (*NotificationMutation) TextCleared

func (m *NotificationMutation) TextCleared() bool

TextCleared returns if the "text" field was cleared in this mutation.

func (NotificationMutation) Tx

func (m NotificationMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*NotificationMutation) Type

func (m *NotificationMutation) Type() string

Type returns the node type of this mutation (Notification).

func (*NotificationMutation) UpdatedAt

func (m *NotificationMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*NotificationMutation) Where

Where appends a list predicates to the NotificationMutation builder.

func (*NotificationMutation) WhereP

func (m *NotificationMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the NotificationMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type NotificationQuery

type NotificationQuery struct {
	// contains filtered or unexported fields
}

NotificationQuery is the builder for querying Notification entities.

func (*NotificationQuery) Aggregate

func (nq *NotificationQuery) Aggregate(fns ...AggregateFunc) *NotificationSelect

Aggregate returns a NotificationSelect configured with the given aggregations.

func (*NotificationQuery) All

func (nq *NotificationQuery) All(ctx context.Context) ([]*Notification, error)

All executes the query and returns a list of Notifications.

func (*NotificationQuery) AllX

func (nq *NotificationQuery) AllX(ctx context.Context) []*Notification

AllX is like All, but panics if an error occurs.

func (*NotificationQuery) Clone

func (nq *NotificationQuery) Clone() *NotificationQuery

Clone returns a duplicate of the NotificationQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*NotificationQuery) Count

func (nq *NotificationQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*NotificationQuery) CountX

func (nq *NotificationQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*NotificationQuery) Exist

func (nq *NotificationQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*NotificationQuery) ExistX

func (nq *NotificationQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*NotificationQuery) First

func (nq *NotificationQuery) First(ctx context.Context) (*Notification, error)

First returns the first Notification entity from the query. Returns a *NotFoundError when no Notification was found.

func (*NotificationQuery) FirstID

func (nq *NotificationQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Notification ID from the query. Returns a *NotFoundError when no Notification ID was found.

func (*NotificationQuery) FirstIDX

func (nq *NotificationQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*NotificationQuery) FirstX

func (nq *NotificationQuery) FirstX(ctx context.Context) *Notification

FirstX is like First, but panics if an error occurs.

func (*NotificationQuery) GroupBy

func (nq *NotificationQuery) GroupBy(field string, fields ...string) *NotificationGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Notification.Query().
	GroupBy(notification.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*NotificationQuery) IDs

func (nq *NotificationQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Notification IDs.

func (*NotificationQuery) IDsX

func (nq *NotificationQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*NotificationQuery) Limit

func (nq *NotificationQuery) Limit(limit int) *NotificationQuery

Limit the number of records to be returned by this query.

func (*NotificationQuery) Offset

func (nq *NotificationQuery) Offset(offset int) *NotificationQuery

Offset to start from.

func (*NotificationQuery) Only

Only returns a single Notification entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Notification entity is found. Returns a *NotFoundError when no Notification entities are found.

func (*NotificationQuery) OnlyID

func (nq *NotificationQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Notification ID in the query. Returns a *NotSingularError when more than one Notification ID is found. Returns a *NotFoundError when no entities are found.

func (*NotificationQuery) OnlyIDX

func (nq *NotificationQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*NotificationQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*NotificationQuery) Order

Order specifies how the records should be ordered.

func (*NotificationQuery) QueryComment

func (nq *NotificationQuery) QueryComment() *CommentQuery

QueryComment chains the current query on the "comment" edge.

func (*NotificationQuery) QueryPost

func (nq *NotificationQuery) QueryPost() *PostQuery

QueryPost chains the current query on the "post" edge.

func (*NotificationQuery) QueryReadBy

func (nq *NotificationQuery) QueryReadBy() *UserQuery

QueryReadBy chains the current query on the "read_by" edge.

func (*NotificationQuery) QueryReceivers

func (nq *NotificationQuery) QueryReceivers() *UserQuery

QueryReceivers chains the current query on the "receivers" edge.

func (*NotificationQuery) QueryReply

func (nq *NotificationQuery) QueryReply() *ReplyQuery

QueryReply chains the current query on the "reply" edge.

func (*NotificationQuery) QuerySender

func (nq *NotificationQuery) QuerySender() *UserQuery

QuerySender chains the current query on the "sender" edge.

func (*NotificationQuery) Select

func (nq *NotificationQuery) Select(fields ...string) *NotificationSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Notification.Query().
	Select(notification.FieldCreatedAt).
	Scan(ctx, &v)

func (*NotificationQuery) Unique

func (nq *NotificationQuery) Unique(unique bool) *NotificationQuery

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 (*NotificationQuery) Where

Where adds a new predicate for the NotificationQuery builder.

func (*NotificationQuery) WithComment

func (nq *NotificationQuery) WithComment(opts ...func(*CommentQuery)) *NotificationQuery

WithComment tells the query-builder to eager-load the nodes that are connected to the "comment" edge. The optional arguments are used to configure the query builder of the edge.

func (*NotificationQuery) WithPost

func (nq *NotificationQuery) WithPost(opts ...func(*PostQuery)) *NotificationQuery

WithPost tells the query-builder to eager-load the nodes that are connected to the "post" edge. The optional arguments are used to configure the query builder of the edge.

func (*NotificationQuery) WithReadBy

func (nq *NotificationQuery) WithReadBy(opts ...func(*UserQuery)) *NotificationQuery

WithReadBy tells the query-builder to eager-load the nodes that are connected to the "read_by" edge. The optional arguments are used to configure the query builder of the edge.

func (*NotificationQuery) WithReceivers

func (nq *NotificationQuery) WithReceivers(opts ...func(*UserQuery)) *NotificationQuery

WithReceivers tells the query-builder to eager-load the nodes that are connected to the "receivers" edge. The optional arguments are used to configure the query builder of the edge.

func (*NotificationQuery) WithReply

func (nq *NotificationQuery) WithReply(opts ...func(*ReplyQuery)) *NotificationQuery

WithReply tells the query-builder to eager-load the nodes that are connected to the "reply" edge. The optional arguments are used to configure the query builder of the edge.

func (*NotificationQuery) WithSender

func (nq *NotificationQuery) WithSender(opts ...func(*UserQuery)) *NotificationQuery

WithSender tells the query-builder to eager-load the nodes that are connected to the "sender" edge. The optional arguments are used to configure the query builder of the edge.

type NotificationSelect

type NotificationSelect struct {
	*NotificationQuery
	// contains filtered or unexported fields
}

NotificationSelect is the builder for selecting fields of Notification entities.

func (*NotificationSelect) Aggregate

func (ns *NotificationSelect) Aggregate(fns ...AggregateFunc) *NotificationSelect

Aggregate adds the given aggregation functions to the selector query.

func (*NotificationSelect) Bool

func (s *NotificationSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*NotificationSelect) BoolX

func (s *NotificationSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NotificationSelect) Bools

func (s *NotificationSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*NotificationSelect) BoolsX

func (s *NotificationSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NotificationSelect) Float64

func (s *NotificationSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*NotificationSelect) Float64X

func (s *NotificationSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NotificationSelect) Float64s

func (s *NotificationSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*NotificationSelect) Float64sX

func (s *NotificationSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NotificationSelect) Int

func (s *NotificationSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*NotificationSelect) IntX

func (s *NotificationSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NotificationSelect) Ints

func (s *NotificationSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*NotificationSelect) IntsX

func (s *NotificationSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NotificationSelect) Scan

func (ns *NotificationSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*NotificationSelect) ScanX

func (s *NotificationSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*NotificationSelect) String

func (s *NotificationSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*NotificationSelect) StringX

func (s *NotificationSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NotificationSelect) Strings

func (s *NotificationSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*NotificationSelect) StringsX

func (s *NotificationSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NotificationUpdate

type NotificationUpdate struct {
	// contains filtered or unexported fields
}

NotificationUpdate is the builder for updating Notification entities.

func (*NotificationUpdate) AddReadBy

func (nu *NotificationUpdate) AddReadBy(u ...*User) *NotificationUpdate

AddReadBy adds the "read_by" edges to the User entity.

func (*NotificationUpdate) AddReadByIDs

func (nu *NotificationUpdate) AddReadByIDs(ids ...uuid.UUID) *NotificationUpdate

AddReadByIDs adds the "read_by" edge to the User entity by IDs.

func (*NotificationUpdate) AddReceiverIDs

func (nu *NotificationUpdate) AddReceiverIDs(ids ...uuid.UUID) *NotificationUpdate

AddReceiverIDs adds the "receivers" edge to the User entity by IDs.

func (*NotificationUpdate) AddReceivers

func (nu *NotificationUpdate) AddReceivers(u ...*User) *NotificationUpdate

AddReceivers adds the "receivers" edges to the User entity.

func (*NotificationUpdate) ClearComment

func (nu *NotificationUpdate) ClearComment() *NotificationUpdate

ClearComment clears the "comment" edge to the Comment entity.

func (*NotificationUpdate) ClearCommentID

func (nu *NotificationUpdate) ClearCommentID() *NotificationUpdate

ClearCommentID clears the value of the "comment_id" field.

func (*NotificationUpdate) ClearPost

func (nu *NotificationUpdate) ClearPost() *NotificationUpdate

ClearPost clears the "post" edge to the Post entity.

func (*NotificationUpdate) ClearPostID

func (nu *NotificationUpdate) ClearPostID() *NotificationUpdate

ClearPostID clears the value of the "post_id" field.

func (*NotificationUpdate) ClearReadBy

func (nu *NotificationUpdate) ClearReadBy() *NotificationUpdate

ClearReadBy clears all "read_by" edges to the User entity.

func (*NotificationUpdate) ClearReceivers

func (nu *NotificationUpdate) ClearReceivers() *NotificationUpdate

ClearReceivers clears all "receivers" edges to the User entity.

func (*NotificationUpdate) ClearReply

func (nu *NotificationUpdate) ClearReply() *NotificationUpdate

ClearReply clears the "reply" edge to the Reply entity.

func (*NotificationUpdate) ClearReplyID

func (nu *NotificationUpdate) ClearReplyID() *NotificationUpdate

ClearReplyID clears the value of the "reply_id" field.

func (*NotificationUpdate) ClearSender

func (nu *NotificationUpdate) ClearSender() *NotificationUpdate

ClearSender clears the "sender" edge to the User entity.

func (*NotificationUpdate) ClearSenderID

func (nu *NotificationUpdate) ClearSenderID() *NotificationUpdate

ClearSenderID clears the value of the "sender_id" field.

func (*NotificationUpdate) ClearText

func (nu *NotificationUpdate) ClearText() *NotificationUpdate

ClearText clears the value of the "text" field.

func (*NotificationUpdate) Exec

func (nu *NotificationUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*NotificationUpdate) ExecX

func (nu *NotificationUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NotificationUpdate) Mutation

func (nu *NotificationUpdate) Mutation() *NotificationMutation

Mutation returns the NotificationMutation object of the builder.

func (*NotificationUpdate) RemoveReadBy

func (nu *NotificationUpdate) RemoveReadBy(u ...*User) *NotificationUpdate

RemoveReadBy removes "read_by" edges to User entities.

func (*NotificationUpdate) RemoveReadByIDs

func (nu *NotificationUpdate) RemoveReadByIDs(ids ...uuid.UUID) *NotificationUpdate

RemoveReadByIDs removes the "read_by" edge to User entities by IDs.

func (*NotificationUpdate) RemoveReceiverIDs

func (nu *NotificationUpdate) RemoveReceiverIDs(ids ...uuid.UUID) *NotificationUpdate

RemoveReceiverIDs removes the "receivers" edge to User entities by IDs.

func (*NotificationUpdate) RemoveReceivers

func (nu *NotificationUpdate) RemoveReceivers(u ...*User) *NotificationUpdate

RemoveReceivers removes "receivers" edges to User entities.

func (*NotificationUpdate) Save

func (nu *NotificationUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*NotificationUpdate) SaveX

func (nu *NotificationUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*NotificationUpdate) SetComment

func (nu *NotificationUpdate) SetComment(c *Comment) *NotificationUpdate

SetComment sets the "comment" edge to the Comment entity.

func (*NotificationUpdate) SetCommentID

func (nu *NotificationUpdate) SetCommentID(u uuid.UUID) *NotificationUpdate

SetCommentID sets the "comment_id" field.

func (*NotificationUpdate) SetCreatedAt

func (nu *NotificationUpdate) SetCreatedAt(t time.Time) *NotificationUpdate

SetCreatedAt sets the "created_at" field.

func (*NotificationUpdate) SetNillableCommentID

func (nu *NotificationUpdate) SetNillableCommentID(u *uuid.UUID) *NotificationUpdate

SetNillableCommentID sets the "comment_id" field if the given value is not nil.

func (*NotificationUpdate) SetNillableCreatedAt

func (nu *NotificationUpdate) SetNillableCreatedAt(t *time.Time) *NotificationUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*NotificationUpdate) SetNillableNtype

func (nu *NotificationUpdate) SetNillableNtype(n *notification.Ntype) *NotificationUpdate

SetNillableNtype sets the "ntype" field if the given value is not nil.

func (*NotificationUpdate) SetNillablePostID

func (nu *NotificationUpdate) SetNillablePostID(u *uuid.UUID) *NotificationUpdate

SetNillablePostID sets the "post_id" field if the given value is not nil.

func (*NotificationUpdate) SetNillableReplyID

func (nu *NotificationUpdate) SetNillableReplyID(u *uuid.UUID) *NotificationUpdate

SetNillableReplyID sets the "reply_id" field if the given value is not nil.

func (*NotificationUpdate) SetNillableSenderID

func (nu *NotificationUpdate) SetNillableSenderID(u *uuid.UUID) *NotificationUpdate

SetNillableSenderID sets the "sender_id" field if the given value is not nil.

func (*NotificationUpdate) SetNillableText

func (nu *NotificationUpdate) SetNillableText(s *string) *NotificationUpdate

SetNillableText sets the "text" field if the given value is not nil.

func (*NotificationUpdate) SetNtype

SetNtype sets the "ntype" field.

func (*NotificationUpdate) SetPost

func (nu *NotificationUpdate) SetPost(p *Post) *NotificationUpdate

SetPost sets the "post" edge to the Post entity.

func (*NotificationUpdate) SetPostID

func (nu *NotificationUpdate) SetPostID(u uuid.UUID) *NotificationUpdate

SetPostID sets the "post_id" field.

func (*NotificationUpdate) SetReply

func (nu *NotificationUpdate) SetReply(r *Reply) *NotificationUpdate

SetReply sets the "reply" edge to the Reply entity.

func (*NotificationUpdate) SetReplyID

func (nu *NotificationUpdate) SetReplyID(u uuid.UUID) *NotificationUpdate

SetReplyID sets the "reply_id" field.

func (*NotificationUpdate) SetSender

func (nu *NotificationUpdate) SetSender(u *User) *NotificationUpdate

SetSender sets the "sender" edge to the User entity.

func (*NotificationUpdate) SetSenderID

func (nu *NotificationUpdate) SetSenderID(u uuid.UUID) *NotificationUpdate

SetSenderID sets the "sender_id" field.

func (*NotificationUpdate) SetText

SetText sets the "text" field.

func (*NotificationUpdate) SetUpdatedAt

func (nu *NotificationUpdate) SetUpdatedAt(t time.Time) *NotificationUpdate

SetUpdatedAt sets the "updated_at" field.

func (*NotificationUpdate) Where

Where appends a list predicates to the NotificationUpdate builder.

type NotificationUpdateOne

type NotificationUpdateOne struct {
	// contains filtered or unexported fields
}

NotificationUpdateOne is the builder for updating a single Notification entity.

func (*NotificationUpdateOne) AddReadBy

func (nuo *NotificationUpdateOne) AddReadBy(u ...*User) *NotificationUpdateOne

AddReadBy adds the "read_by" edges to the User entity.

func (*NotificationUpdateOne) AddReadByIDs

func (nuo *NotificationUpdateOne) AddReadByIDs(ids ...uuid.UUID) *NotificationUpdateOne

AddReadByIDs adds the "read_by" edge to the User entity by IDs.

func (*NotificationUpdateOne) AddReceiverIDs

func (nuo *NotificationUpdateOne) AddReceiverIDs(ids ...uuid.UUID) *NotificationUpdateOne

AddReceiverIDs adds the "receivers" edge to the User entity by IDs.

func (*NotificationUpdateOne) AddReceivers

func (nuo *NotificationUpdateOne) AddReceivers(u ...*User) *NotificationUpdateOne

AddReceivers adds the "receivers" edges to the User entity.

func (*NotificationUpdateOne) ClearComment

func (nuo *NotificationUpdateOne) ClearComment() *NotificationUpdateOne

ClearComment clears the "comment" edge to the Comment entity.

func (*NotificationUpdateOne) ClearCommentID

func (nuo *NotificationUpdateOne) ClearCommentID() *NotificationUpdateOne

ClearCommentID clears the value of the "comment_id" field.

func (*NotificationUpdateOne) ClearPost

func (nuo *NotificationUpdateOne) ClearPost() *NotificationUpdateOne

ClearPost clears the "post" edge to the Post entity.

func (*NotificationUpdateOne) ClearPostID

func (nuo *NotificationUpdateOne) ClearPostID() *NotificationUpdateOne

ClearPostID clears the value of the "post_id" field.

func (*NotificationUpdateOne) ClearReadBy

func (nuo *NotificationUpdateOne) ClearReadBy() *NotificationUpdateOne

ClearReadBy clears all "read_by" edges to the User entity.

func (*NotificationUpdateOne) ClearReceivers

func (nuo *NotificationUpdateOne) ClearReceivers() *NotificationUpdateOne

ClearReceivers clears all "receivers" edges to the User entity.

func (*NotificationUpdateOne) ClearReply

func (nuo *NotificationUpdateOne) ClearReply() *NotificationUpdateOne

ClearReply clears the "reply" edge to the Reply entity.

func (*NotificationUpdateOne) ClearReplyID

func (nuo *NotificationUpdateOne) ClearReplyID() *NotificationUpdateOne

ClearReplyID clears the value of the "reply_id" field.

func (*NotificationUpdateOne) ClearSender

func (nuo *NotificationUpdateOne) ClearSender() *NotificationUpdateOne

ClearSender clears the "sender" edge to the User entity.

func (*NotificationUpdateOne) ClearSenderID

func (nuo *NotificationUpdateOne) ClearSenderID() *NotificationUpdateOne

ClearSenderID clears the value of the "sender_id" field.

func (*NotificationUpdateOne) ClearText

func (nuo *NotificationUpdateOne) ClearText() *NotificationUpdateOne

ClearText clears the value of the "text" field.

func (*NotificationUpdateOne) Exec

func (nuo *NotificationUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*NotificationUpdateOne) ExecX

func (nuo *NotificationUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NotificationUpdateOne) Mutation

Mutation returns the NotificationMutation object of the builder.

func (*NotificationUpdateOne) RemoveReadBy

func (nuo *NotificationUpdateOne) RemoveReadBy(u ...*User) *NotificationUpdateOne

RemoveReadBy removes "read_by" edges to User entities.

func (*NotificationUpdateOne) RemoveReadByIDs

func (nuo *NotificationUpdateOne) RemoveReadByIDs(ids ...uuid.UUID) *NotificationUpdateOne

RemoveReadByIDs removes the "read_by" edge to User entities by IDs.

func (*NotificationUpdateOne) RemoveReceiverIDs

func (nuo *NotificationUpdateOne) RemoveReceiverIDs(ids ...uuid.UUID) *NotificationUpdateOne

RemoveReceiverIDs removes the "receivers" edge to User entities by IDs.

func (*NotificationUpdateOne) RemoveReceivers

func (nuo *NotificationUpdateOne) RemoveReceivers(u ...*User) *NotificationUpdateOne

RemoveReceivers removes "receivers" edges to User entities.

func (*NotificationUpdateOne) Save

Save executes the query and returns the updated Notification entity.

func (*NotificationUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*NotificationUpdateOne) Select

func (nuo *NotificationUpdateOne) Select(field string, fields ...string) *NotificationUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*NotificationUpdateOne) SetComment

SetComment sets the "comment" edge to the Comment entity.

func (*NotificationUpdateOne) SetCommentID

func (nuo *NotificationUpdateOne) SetCommentID(u uuid.UUID) *NotificationUpdateOne

SetCommentID sets the "comment_id" field.

func (*NotificationUpdateOne) SetCreatedAt

func (nuo *NotificationUpdateOne) SetCreatedAt(t time.Time) *NotificationUpdateOne

SetCreatedAt sets the "created_at" field.

func (*NotificationUpdateOne) SetNillableCommentID

func (nuo *NotificationUpdateOne) SetNillableCommentID(u *uuid.UUID) *NotificationUpdateOne

SetNillableCommentID sets the "comment_id" field if the given value is not nil.

func (*NotificationUpdateOne) SetNillableCreatedAt

func (nuo *NotificationUpdateOne) SetNillableCreatedAt(t *time.Time) *NotificationUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*NotificationUpdateOne) SetNillableNtype

SetNillableNtype sets the "ntype" field if the given value is not nil.

func (*NotificationUpdateOne) SetNillablePostID

func (nuo *NotificationUpdateOne) SetNillablePostID(u *uuid.UUID) *NotificationUpdateOne

SetNillablePostID sets the "post_id" field if the given value is not nil.

func (*NotificationUpdateOne) SetNillableReplyID

func (nuo *NotificationUpdateOne) SetNillableReplyID(u *uuid.UUID) *NotificationUpdateOne

SetNillableReplyID sets the "reply_id" field if the given value is not nil.

func (*NotificationUpdateOne) SetNillableSenderID

func (nuo *NotificationUpdateOne) SetNillableSenderID(u *uuid.UUID) *NotificationUpdateOne

SetNillableSenderID sets the "sender_id" field if the given value is not nil.

func (*NotificationUpdateOne) SetNillableText

func (nuo *NotificationUpdateOne) SetNillableText(s *string) *NotificationUpdateOne

SetNillableText sets the "text" field if the given value is not nil.

func (*NotificationUpdateOne) SetNtype

SetNtype sets the "ntype" field.

func (*NotificationUpdateOne) SetPost

SetPost sets the "post" edge to the Post entity.

func (*NotificationUpdateOne) SetPostID

SetPostID sets the "post_id" field.

func (*NotificationUpdateOne) SetReply

SetReply sets the "reply" edge to the Reply entity.

func (*NotificationUpdateOne) SetReplyID

SetReplyID sets the "reply_id" field.

func (*NotificationUpdateOne) SetSender

func (nuo *NotificationUpdateOne) SetSender(u *User) *NotificationUpdateOne

SetSender sets the "sender" edge to the User entity.

func (*NotificationUpdateOne) SetSenderID

SetSenderID sets the "sender_id" field.

func (*NotificationUpdateOne) SetText

SetText sets the "text" field.

func (*NotificationUpdateOne) SetUpdatedAt

func (nuo *NotificationUpdateOne) SetUpdatedAt(t time.Time) *NotificationUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*NotificationUpdateOne) Where

Where appends a list predicates to the NotificationUpdate builder.

type Notifications

type Notifications []*Notification

Notifications is a parsable slice of Notification.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type Otp

type Otp struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Code holds the value of the "code" field.
	Code uint32 `json:"code,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID uuid.UUID `json:"user_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the OtpQuery when eager-loading is set.
	Edges OtpEdges `json:"edges"`
	// contains filtered or unexported fields
}

Otp is the model entity for the Otp schema.

func (*Otp) QueryUser

func (o *Otp) QueryUser() *UserQuery

QueryUser queries the "user" edge of the Otp entity.

func (*Otp) String

func (o *Otp) String() string

String implements the fmt.Stringer.

func (*Otp) Unwrap

func (o *Otp) Unwrap() *Otp

Unwrap unwraps the Otp 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 (*Otp) Update

func (o *Otp) Update() *OtpUpdateOne

Update returns a builder for updating this Otp. Note that you need to call Otp.Unwrap() before calling this method if this Otp was returned from a transaction, and the transaction was committed or rolled back.

func (*Otp) Value

func (o *Otp) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Otp. This includes values selected through modifiers, order, etc.

type OtpClient

type OtpClient struct {
	// contains filtered or unexported fields
}

OtpClient is a client for the Otp schema.

func NewOtpClient

func NewOtpClient(c config) *OtpClient

NewOtpClient returns a client for the Otp from the given config.

func (*OtpClient) Create

func (c *OtpClient) Create() *OtpCreate

Create returns a builder for creating a Otp entity.

func (*OtpClient) CreateBulk

func (c *OtpClient) CreateBulk(builders ...*OtpCreate) *OtpCreateBulk

CreateBulk returns a builder for creating a bulk of Otp entities.

func (*OtpClient) Delete

func (c *OtpClient) Delete() *OtpDelete

Delete returns a delete builder for Otp.

func (*OtpClient) DeleteOne

func (c *OtpClient) DeleteOne(o *Otp) *OtpDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*OtpClient) DeleteOneID

func (c *OtpClient) DeleteOneID(id uuid.UUID) *OtpDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*OtpClient) Get

func (c *OtpClient) Get(ctx context.Context, id uuid.UUID) (*Otp, error)

Get returns a Otp entity by its id.

func (*OtpClient) GetX

func (c *OtpClient) GetX(ctx context.Context, id uuid.UUID) *Otp

GetX is like Get, but panics if an error occurs.

func (*OtpClient) Hooks

func (c *OtpClient) Hooks() []Hook

Hooks returns the client hooks.

func (*OtpClient) Intercept

func (c *OtpClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `otp.Intercept(f(g(h())))`.

func (*OtpClient) Interceptors

func (c *OtpClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*OtpClient) MapCreateBulk

func (c *OtpClient) MapCreateBulk(slice any, setFunc func(*OtpCreate, int)) *OtpCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*OtpClient) Query

func (c *OtpClient) Query() *OtpQuery

Query returns a query builder for Otp.

func (*OtpClient) QueryUser

func (c *OtpClient) QueryUser(o *Otp) *UserQuery

QueryUser queries the user edge of a Otp.

func (*OtpClient) Update

func (c *OtpClient) Update() *OtpUpdate

Update returns an update builder for Otp.

func (*OtpClient) UpdateOne

func (c *OtpClient) UpdateOne(o *Otp) *OtpUpdateOne

UpdateOne returns an update builder for the given entity.

func (*OtpClient) UpdateOneID

func (c *OtpClient) UpdateOneID(id uuid.UUID) *OtpUpdateOne

UpdateOneID returns an update builder for the given id.

func (*OtpClient) Use

func (c *OtpClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `otp.Hooks(f(g(h())))`.

type OtpCreate

type OtpCreate struct {
	// contains filtered or unexported fields
}

OtpCreate is the builder for creating a Otp entity.

func (*OtpCreate) Exec

func (oc *OtpCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*OtpCreate) ExecX

func (oc *OtpCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OtpCreate) Mutation

func (oc *OtpCreate) Mutation() *OtpMutation

Mutation returns the OtpMutation object of the builder.

func (*OtpCreate) Save

func (oc *OtpCreate) Save(ctx context.Context) (*Otp, error)

Save creates the Otp in the database.

func (*OtpCreate) SaveX

func (oc *OtpCreate) SaveX(ctx context.Context) *Otp

SaveX calls Save and panics if Save returns an error.

func (*OtpCreate) SetCode

func (oc *OtpCreate) SetCode(u uint32) *OtpCreate

SetCode sets the "code" field.

func (*OtpCreate) SetCreatedAt

func (oc *OtpCreate) SetCreatedAt(t time.Time) *OtpCreate

SetCreatedAt sets the "created_at" field.

func (*OtpCreate) SetID

func (oc *OtpCreate) SetID(u uuid.UUID) *OtpCreate

SetID sets the "id" field.

func (*OtpCreate) SetNillableCreatedAt

func (oc *OtpCreate) SetNillableCreatedAt(t *time.Time) *OtpCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*OtpCreate) SetNillableID

func (oc *OtpCreate) SetNillableID(u *uuid.UUID) *OtpCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*OtpCreate) SetNillableUpdatedAt

func (oc *OtpCreate) SetNillableUpdatedAt(t *time.Time) *OtpCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*OtpCreate) SetUpdatedAt

func (oc *OtpCreate) SetUpdatedAt(t time.Time) *OtpCreate

SetUpdatedAt sets the "updated_at" field.

func (*OtpCreate) SetUser

func (oc *OtpCreate) SetUser(u *User) *OtpCreate

SetUser sets the "user" edge to the User entity.

func (*OtpCreate) SetUserID

func (oc *OtpCreate) SetUserID(u uuid.UUID) *OtpCreate

SetUserID sets the "user_id" field.

type OtpCreateBulk

type OtpCreateBulk struct {
	// contains filtered or unexported fields
}

OtpCreateBulk is the builder for creating many Otp entities in bulk.

func (*OtpCreateBulk) Exec

func (ocb *OtpCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*OtpCreateBulk) ExecX

func (ocb *OtpCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OtpCreateBulk) Save

func (ocb *OtpCreateBulk) Save(ctx context.Context) ([]*Otp, error)

Save creates the Otp entities in the database.

func (*OtpCreateBulk) SaveX

func (ocb *OtpCreateBulk) SaveX(ctx context.Context) []*Otp

SaveX is like Save, but panics if an error occurs.

type OtpDelete

type OtpDelete struct {
	// contains filtered or unexported fields
}

OtpDelete is the builder for deleting a Otp entity.

func (*OtpDelete) Exec

func (od *OtpDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*OtpDelete) ExecX

func (od *OtpDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*OtpDelete) Where

func (od *OtpDelete) Where(ps ...predicate.Otp) *OtpDelete

Where appends a list predicates to the OtpDelete builder.

type OtpDeleteOne

type OtpDeleteOne struct {
	// contains filtered or unexported fields
}

OtpDeleteOne is the builder for deleting a single Otp entity.

func (*OtpDeleteOne) Exec

func (odo *OtpDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*OtpDeleteOne) ExecX

func (odo *OtpDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OtpDeleteOne) Where

func (odo *OtpDeleteOne) Where(ps ...predicate.Otp) *OtpDeleteOne

Where appends a list predicates to the OtpDelete builder.

type OtpEdges

type OtpEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// contains filtered or unexported fields
}

OtpEdges holds the relations/edges for other nodes in the graph.

func (OtpEdges) UserOrErr

func (e OtpEdges) 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 OtpGroupBy

type OtpGroupBy struct {
	// contains filtered or unexported fields
}

OtpGroupBy is the group-by builder for Otp entities.

func (*OtpGroupBy) Aggregate

func (ogb *OtpGroupBy) Aggregate(fns ...AggregateFunc) *OtpGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*OtpGroupBy) Bool

func (s *OtpGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*OtpGroupBy) BoolX

func (s *OtpGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OtpGroupBy) Bools

func (s *OtpGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*OtpGroupBy) BoolsX

func (s *OtpGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OtpGroupBy) Float64

func (s *OtpGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*OtpGroupBy) Float64X

func (s *OtpGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OtpGroupBy) Float64s

func (s *OtpGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*OtpGroupBy) Float64sX

func (s *OtpGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OtpGroupBy) Int

func (s *OtpGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*OtpGroupBy) IntX

func (s *OtpGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OtpGroupBy) Ints

func (s *OtpGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*OtpGroupBy) IntsX

func (s *OtpGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*OtpGroupBy) Scan

func (ogb *OtpGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*OtpGroupBy) ScanX

func (s *OtpGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*OtpGroupBy) String

func (s *OtpGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*OtpGroupBy) StringX

func (s *OtpGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OtpGroupBy) Strings

func (s *OtpGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*OtpGroupBy) StringsX

func (s *OtpGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type OtpMutation

type OtpMutation struct {
	// contains filtered or unexported fields
}

OtpMutation represents an operation that mutates the Otp nodes in the graph.

func (*OtpMutation) AddCode

func (m *OtpMutation) AddCode(u int32)

AddCode adds u to the "code" field.

func (*OtpMutation) AddField

func (m *OtpMutation) 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 (*OtpMutation) AddedCode

func (m *OtpMutation) AddedCode() (r int32, exists bool)

AddedCode returns the value that was added to the "code" field in this mutation.

func (*OtpMutation) AddedEdges

func (m *OtpMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*OtpMutation) AddedField

func (m *OtpMutation) 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 (*OtpMutation) AddedFields

func (m *OtpMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*OtpMutation) AddedIDs

func (m *OtpMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*OtpMutation) ClearEdge

func (m *OtpMutation) 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 (*OtpMutation) ClearField

func (m *OtpMutation) 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 (*OtpMutation) ClearUser

func (m *OtpMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*OtpMutation) ClearedEdges

func (m *OtpMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*OtpMutation) ClearedFields

func (m *OtpMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (OtpMutation) Client

func (m OtpMutation) 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 (*OtpMutation) Code

func (m *OtpMutation) Code() (r uint32, exists bool)

Code returns the value of the "code" field in the mutation.

func (*OtpMutation) CreatedAt

func (m *OtpMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*OtpMutation) EdgeCleared

func (m *OtpMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*OtpMutation) Field

func (m *OtpMutation) 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 (*OtpMutation) FieldCleared

func (m *OtpMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*OtpMutation) Fields

func (m *OtpMutation) 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 (*OtpMutation) ID

func (m *OtpMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*OtpMutation) IDs

func (m *OtpMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*OtpMutation) OldCode

func (m *OtpMutation) OldCode(ctx context.Context) (v uint32, err error)

OldCode returns the old "code" field's value of the Otp entity. If the Otp 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 (*OtpMutation) OldCreatedAt

func (m *OtpMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Otp entity. If the Otp 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 (*OtpMutation) OldField

func (m *OtpMutation) 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 (*OtpMutation) OldUpdatedAt

func (m *OtpMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Otp entity. If the Otp 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 (*OtpMutation) OldUserID

func (m *OtpMutation) OldUserID(ctx context.Context) (v uuid.UUID, err error)

OldUserID returns the old "user_id" field's value of the Otp entity. If the Otp 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 (*OtpMutation) Op

func (m *OtpMutation) Op() Op

Op returns the operation name.

func (*OtpMutation) RemovedEdges

func (m *OtpMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*OtpMutation) RemovedIDs

func (m *OtpMutation) 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 (*OtpMutation) ResetCode

func (m *OtpMutation) ResetCode()

ResetCode resets all changes to the "code" field.

func (*OtpMutation) ResetCreatedAt

func (m *OtpMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*OtpMutation) ResetEdge

func (m *OtpMutation) 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 (*OtpMutation) ResetField

func (m *OtpMutation) 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 (*OtpMutation) ResetUpdatedAt

func (m *OtpMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*OtpMutation) ResetUser

func (m *OtpMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*OtpMutation) ResetUserID

func (m *OtpMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*OtpMutation) SetCode

func (m *OtpMutation) SetCode(u uint32)

SetCode sets the "code" field.

func (*OtpMutation) SetCreatedAt

func (m *OtpMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*OtpMutation) SetField

func (m *OtpMutation) 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 (*OtpMutation) SetID

func (m *OtpMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Otp entities.

func (*OtpMutation) SetOp

func (m *OtpMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*OtpMutation) SetUpdatedAt

func (m *OtpMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*OtpMutation) SetUserID

func (m *OtpMutation) SetUserID(u uuid.UUID)

SetUserID sets the "user_id" field.

func (OtpMutation) Tx

func (m OtpMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*OtpMutation) Type

func (m *OtpMutation) Type() string

Type returns the node type of this mutation (Otp).

func (*OtpMutation) UpdatedAt

func (m *OtpMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*OtpMutation) UserCleared

func (m *OtpMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*OtpMutation) UserID

func (m *OtpMutation) UserID() (r uuid.UUID, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*OtpMutation) UserIDs

func (m *OtpMutation) UserIDs() (ids []uuid.UUID)

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 (*OtpMutation) Where

func (m *OtpMutation) Where(ps ...predicate.Otp)

Where appends a list predicates to the OtpMutation builder.

func (*OtpMutation) WhereP

func (m *OtpMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the OtpMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type OtpQuery

type OtpQuery struct {
	// contains filtered or unexported fields
}

OtpQuery is the builder for querying Otp entities.

func (*OtpQuery) Aggregate

func (oq *OtpQuery) Aggregate(fns ...AggregateFunc) *OtpSelect

Aggregate returns a OtpSelect configured with the given aggregations.

func (*OtpQuery) All

func (oq *OtpQuery) All(ctx context.Context) ([]*Otp, error)

All executes the query and returns a list of Otps.

func (*OtpQuery) AllX

func (oq *OtpQuery) AllX(ctx context.Context) []*Otp

AllX is like All, but panics if an error occurs.

func (*OtpQuery) Clone

func (oq *OtpQuery) Clone() *OtpQuery

Clone returns a duplicate of the OtpQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*OtpQuery) Count

func (oq *OtpQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*OtpQuery) CountX

func (oq *OtpQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*OtpQuery) Exist

func (oq *OtpQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*OtpQuery) ExistX

func (oq *OtpQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*OtpQuery) First

func (oq *OtpQuery) First(ctx context.Context) (*Otp, error)

First returns the first Otp entity from the query. Returns a *NotFoundError when no Otp was found.

func (*OtpQuery) FirstID

func (oq *OtpQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Otp ID from the query. Returns a *NotFoundError when no Otp ID was found.

func (*OtpQuery) FirstIDX

func (oq *OtpQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*OtpQuery) FirstX

func (oq *OtpQuery) FirstX(ctx context.Context) *Otp

FirstX is like First, but panics if an error occurs.

func (*OtpQuery) GroupBy

func (oq *OtpQuery) GroupBy(field string, fields ...string) *OtpGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Otp.Query().
	GroupBy(otp.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*OtpQuery) IDs

func (oq *OtpQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Otp IDs.

func (*OtpQuery) IDsX

func (oq *OtpQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*OtpQuery) Limit

func (oq *OtpQuery) Limit(limit int) *OtpQuery

Limit the number of records to be returned by this query.

func (*OtpQuery) Offset

func (oq *OtpQuery) Offset(offset int) *OtpQuery

Offset to start from.

func (*OtpQuery) Only

func (oq *OtpQuery) Only(ctx context.Context) (*Otp, error)

Only returns a single Otp entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Otp entity is found. Returns a *NotFoundError when no Otp entities are found.

func (*OtpQuery) OnlyID

func (oq *OtpQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Otp ID in the query. Returns a *NotSingularError when more than one Otp ID is found. Returns a *NotFoundError when no entities are found.

func (*OtpQuery) OnlyIDX

func (oq *OtpQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*OtpQuery) OnlyX

func (oq *OtpQuery) OnlyX(ctx context.Context) *Otp

OnlyX is like Only, but panics if an error occurs.

func (*OtpQuery) Order

func (oq *OtpQuery) Order(o ...otp.OrderOption) *OtpQuery

Order specifies how the records should be ordered.

func (*OtpQuery) QueryUser

func (oq *OtpQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*OtpQuery) Select

func (oq *OtpQuery) Select(fields ...string) *OtpSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Otp.Query().
	Select(otp.FieldCreatedAt).
	Scan(ctx, &v)

func (*OtpQuery) Unique

func (oq *OtpQuery) Unique(unique bool) *OtpQuery

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 (*OtpQuery) Where

func (oq *OtpQuery) Where(ps ...predicate.Otp) *OtpQuery

Where adds a new predicate for the OtpQuery builder.

func (*OtpQuery) WithUser

func (oq *OtpQuery) WithUser(opts ...func(*UserQuery)) *OtpQuery

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 OtpSelect

type OtpSelect struct {
	*OtpQuery
	// contains filtered or unexported fields
}

OtpSelect is the builder for selecting fields of Otp entities.

func (*OtpSelect) Aggregate

func (os *OtpSelect) Aggregate(fns ...AggregateFunc) *OtpSelect

Aggregate adds the given aggregation functions to the selector query.

func (*OtpSelect) Bool

func (s *OtpSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*OtpSelect) BoolX

func (s *OtpSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OtpSelect) Bools

func (s *OtpSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*OtpSelect) BoolsX

func (s *OtpSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OtpSelect) Float64

func (s *OtpSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*OtpSelect) Float64X

func (s *OtpSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OtpSelect) Float64s

func (s *OtpSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*OtpSelect) Float64sX

func (s *OtpSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OtpSelect) Int

func (s *OtpSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*OtpSelect) IntX

func (s *OtpSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OtpSelect) Ints

func (s *OtpSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*OtpSelect) IntsX

func (s *OtpSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*OtpSelect) Scan

func (os *OtpSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*OtpSelect) ScanX

func (s *OtpSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*OtpSelect) String

func (s *OtpSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*OtpSelect) StringX

func (s *OtpSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OtpSelect) Strings

func (s *OtpSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*OtpSelect) StringsX

func (s *OtpSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type OtpUpdate

type OtpUpdate struct {
	// contains filtered or unexported fields
}

OtpUpdate is the builder for updating Otp entities.

func (*OtpUpdate) AddCode

func (ou *OtpUpdate) AddCode(u int32) *OtpUpdate

AddCode adds u to the "code" field.

func (*OtpUpdate) ClearUser

func (ou *OtpUpdate) ClearUser() *OtpUpdate

ClearUser clears the "user" edge to the User entity.

func (*OtpUpdate) Exec

func (ou *OtpUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*OtpUpdate) ExecX

func (ou *OtpUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OtpUpdate) Mutation

func (ou *OtpUpdate) Mutation() *OtpMutation

Mutation returns the OtpMutation object of the builder.

func (*OtpUpdate) Save

func (ou *OtpUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*OtpUpdate) SaveX

func (ou *OtpUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*OtpUpdate) SetCode

func (ou *OtpUpdate) SetCode(u uint32) *OtpUpdate

SetCode sets the "code" field.

func (*OtpUpdate) SetCreatedAt

func (ou *OtpUpdate) SetCreatedAt(t time.Time) *OtpUpdate

SetCreatedAt sets the "created_at" field.

func (*OtpUpdate) SetNillableCode

func (ou *OtpUpdate) SetNillableCode(u *uint32) *OtpUpdate

SetNillableCode sets the "code" field if the given value is not nil.

func (*OtpUpdate) SetNillableCreatedAt

func (ou *OtpUpdate) SetNillableCreatedAt(t *time.Time) *OtpUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*OtpUpdate) SetNillableUserID

func (ou *OtpUpdate) SetNillableUserID(u *uuid.UUID) *OtpUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*OtpUpdate) SetUpdatedAt

func (ou *OtpUpdate) SetUpdatedAt(t time.Time) *OtpUpdate

SetUpdatedAt sets the "updated_at" field.

func (*OtpUpdate) SetUser

func (ou *OtpUpdate) SetUser(u *User) *OtpUpdate

SetUser sets the "user" edge to the User entity.

func (*OtpUpdate) SetUserID

func (ou *OtpUpdate) SetUserID(u uuid.UUID) *OtpUpdate

SetUserID sets the "user_id" field.

func (*OtpUpdate) Where

func (ou *OtpUpdate) Where(ps ...predicate.Otp) *OtpUpdate

Where appends a list predicates to the OtpUpdate builder.

type OtpUpdateOne

type OtpUpdateOne struct {
	// contains filtered or unexported fields
}

OtpUpdateOne is the builder for updating a single Otp entity.

func (*OtpUpdateOne) AddCode

func (ouo *OtpUpdateOne) AddCode(u int32) *OtpUpdateOne

AddCode adds u to the "code" field.

func (*OtpUpdateOne) ClearUser

func (ouo *OtpUpdateOne) ClearUser() *OtpUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*OtpUpdateOne) Exec

func (ouo *OtpUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*OtpUpdateOne) ExecX

func (ouo *OtpUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OtpUpdateOne) Mutation

func (ouo *OtpUpdateOne) Mutation() *OtpMutation

Mutation returns the OtpMutation object of the builder.

func (*OtpUpdateOne) Save

func (ouo *OtpUpdateOne) Save(ctx context.Context) (*Otp, error)

Save executes the query and returns the updated Otp entity.

func (*OtpUpdateOne) SaveX

func (ouo *OtpUpdateOne) SaveX(ctx context.Context) *Otp

SaveX is like Save, but panics if an error occurs.

func (*OtpUpdateOne) Select

func (ouo *OtpUpdateOne) Select(field string, fields ...string) *OtpUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*OtpUpdateOne) SetCode

func (ouo *OtpUpdateOne) SetCode(u uint32) *OtpUpdateOne

SetCode sets the "code" field.

func (*OtpUpdateOne) SetCreatedAt

func (ouo *OtpUpdateOne) SetCreatedAt(t time.Time) *OtpUpdateOne

SetCreatedAt sets the "created_at" field.

func (*OtpUpdateOne) SetNillableCode

func (ouo *OtpUpdateOne) SetNillableCode(u *uint32) *OtpUpdateOne

SetNillableCode sets the "code" field if the given value is not nil.

func (*OtpUpdateOne) SetNillableCreatedAt

func (ouo *OtpUpdateOne) SetNillableCreatedAt(t *time.Time) *OtpUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*OtpUpdateOne) SetNillableUserID

func (ouo *OtpUpdateOne) SetNillableUserID(u *uuid.UUID) *OtpUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*OtpUpdateOne) SetUpdatedAt

func (ouo *OtpUpdateOne) SetUpdatedAt(t time.Time) *OtpUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*OtpUpdateOne) SetUser

func (ouo *OtpUpdateOne) SetUser(u *User) *OtpUpdateOne

SetUser sets the "user" edge to the User entity.

func (*OtpUpdateOne) SetUserID

func (ouo *OtpUpdateOne) SetUserID(u uuid.UUID) *OtpUpdateOne

SetUserID sets the "user_id" field.

func (*OtpUpdateOne) Where

func (ouo *OtpUpdateOne) Where(ps ...predicate.Otp) *OtpUpdateOne

Where appends a list predicates to the OtpUpdate builder.

type Otps

type Otps []*Otp

Otps is a parsable slice of Otp.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Post

type Post struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Text holds the value of the "text" field.
	Text string `json:"text,omitempty"`
	// Slug holds the value of the "slug" field.
	Slug string `json:"slug,omitempty"`
	// AuthorID holds the value of the "author_id" field.
	AuthorID uuid.UUID `json:"author_id,omitempty"`
	// ImageID holds the value of the "image_id" field.
	ImageID *uuid.UUID `json:"image_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PostQuery when eager-loading is set.
	Edges PostEdges `json:"edges"`
	// contains filtered or unexported fields
}

Post is the model entity for the Post schema.

func (*Post) QueryAuthor

func (po *Post) QueryAuthor() *UserQuery

QueryAuthor queries the "author" edge of the Post entity.

func (*Post) QueryComments

func (po *Post) QueryComments() *CommentQuery

QueryComments queries the "comments" edge of the Post entity.

func (*Post) QueryImage

func (po *Post) QueryImage() *FileQuery

QueryImage queries the "image" edge of the Post entity.

func (*Post) QueryNotifications

func (po *Post) QueryNotifications() *NotificationQuery

QueryNotifications queries the "notifications" edge of the Post entity.

func (*Post) QueryReactions

func (po *Post) QueryReactions() *ReactionQuery

QueryReactions queries the "reactions" edge of the Post entity.

func (*Post) String

func (po *Post) String() string

String implements the fmt.Stringer.

func (*Post) Unwrap

func (po *Post) Unwrap() *Post

Unwrap unwraps the Post 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 (*Post) Update

func (po *Post) Update() *PostUpdateOne

Update returns a builder for updating this Post. Note that you need to call Post.Unwrap() before calling this method if this Post was returned from a transaction, and the transaction was committed or rolled back.

func (*Post) Value

func (po *Post) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Post. This includes values selected through modifiers, order, etc.

type PostClient

type PostClient struct {
	// contains filtered or unexported fields
}

PostClient is a client for the Post schema.

func NewPostClient

func NewPostClient(c config) *PostClient

NewPostClient returns a client for the Post from the given config.

func (*PostClient) Create

func (c *PostClient) Create() *PostCreate

Create returns a builder for creating a Post entity.

func (*PostClient) CreateBulk

func (c *PostClient) CreateBulk(builders ...*PostCreate) *PostCreateBulk

CreateBulk returns a builder for creating a bulk of Post entities.

func (*PostClient) Delete

func (c *PostClient) Delete() *PostDelete

Delete returns a delete builder for Post.

func (*PostClient) DeleteOne

func (c *PostClient) DeleteOne(po *Post) *PostDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PostClient) DeleteOneID

func (c *PostClient) DeleteOneID(id uuid.UUID) *PostDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*PostClient) Get

func (c *PostClient) Get(ctx context.Context, id uuid.UUID) (*Post, error)

Get returns a Post entity by its id.

func (*PostClient) GetX

func (c *PostClient) GetX(ctx context.Context, id uuid.UUID) *Post

GetX is like Get, but panics if an error occurs.

func (*PostClient) Hooks

func (c *PostClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PostClient) Intercept

func (c *PostClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `post.Intercept(f(g(h())))`.

func (*PostClient) Interceptors

func (c *PostClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PostClient) MapCreateBulk

func (c *PostClient) MapCreateBulk(slice any, setFunc func(*PostCreate, int)) *PostCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*PostClient) Query

func (c *PostClient) Query() *PostQuery

Query returns a query builder for Post.

func (*PostClient) QueryAuthor

func (c *PostClient) QueryAuthor(po *Post) *UserQuery

QueryAuthor queries the author edge of a Post.

func (*PostClient) QueryComments

func (c *PostClient) QueryComments(po *Post) *CommentQuery

QueryComments queries the comments edge of a Post.

func (*PostClient) QueryImage

func (c *PostClient) QueryImage(po *Post) *FileQuery

QueryImage queries the image edge of a Post.

func (*PostClient) QueryNotifications

func (c *PostClient) QueryNotifications(po *Post) *NotificationQuery

QueryNotifications queries the notifications edge of a Post.

func (*PostClient) QueryReactions

func (c *PostClient) QueryReactions(po *Post) *ReactionQuery

QueryReactions queries the reactions edge of a Post.

func (*PostClient) Update

func (c *PostClient) Update() *PostUpdate

Update returns an update builder for Post.

func (*PostClient) UpdateOne

func (c *PostClient) UpdateOne(po *Post) *PostUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PostClient) UpdateOneID

func (c *PostClient) UpdateOneID(id uuid.UUID) *PostUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PostClient) Use

func (c *PostClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `post.Hooks(f(g(h())))`.

type PostCreate

type PostCreate struct {
	// contains filtered or unexported fields
}

PostCreate is the builder for creating a Post entity.

func (*PostCreate) AddCommentIDs

func (pc *PostCreate) AddCommentIDs(ids ...uuid.UUID) *PostCreate

AddCommentIDs adds the "comments" edge to the Comment entity by IDs.

func (*PostCreate) AddComments

func (pc *PostCreate) AddComments(c ...*Comment) *PostCreate

AddComments adds the "comments" edges to the Comment entity.

func (*PostCreate) AddNotificationIDs

func (pc *PostCreate) AddNotificationIDs(ids ...uuid.UUID) *PostCreate

AddNotificationIDs adds the "notifications" edge to the Notification entity by IDs.

func (*PostCreate) AddNotifications

func (pc *PostCreate) AddNotifications(n ...*Notification) *PostCreate

AddNotifications adds the "notifications" edges to the Notification entity.

func (*PostCreate) AddReactionIDs

func (pc *PostCreate) AddReactionIDs(ids ...uuid.UUID) *PostCreate

AddReactionIDs adds the "reactions" edge to the Reaction entity by IDs.

func (*PostCreate) AddReactions

func (pc *PostCreate) AddReactions(r ...*Reaction) *PostCreate

AddReactions adds the "reactions" edges to the Reaction entity.

func (*PostCreate) Exec

func (pc *PostCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PostCreate) ExecX

func (pc *PostCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PostCreate) Mutation

func (pc *PostCreate) Mutation() *PostMutation

Mutation returns the PostMutation object of the builder.

func (*PostCreate) Save

func (pc *PostCreate) Save(ctx context.Context) (*Post, error)

Save creates the Post in the database.

func (*PostCreate) SaveX

func (pc *PostCreate) SaveX(ctx context.Context) *Post

SaveX calls Save and panics if Save returns an error.

func (*PostCreate) SetAuthor

func (pc *PostCreate) SetAuthor(u *User) *PostCreate

SetAuthor sets the "author" edge to the User entity.

func (*PostCreate) SetAuthorID

func (pc *PostCreate) SetAuthorID(u uuid.UUID) *PostCreate

SetAuthorID sets the "author_id" field.

func (*PostCreate) SetCreatedAt

func (pc *PostCreate) SetCreatedAt(t time.Time) *PostCreate

SetCreatedAt sets the "created_at" field.

func (*PostCreate) SetID

func (pc *PostCreate) SetID(u uuid.UUID) *PostCreate

SetID sets the "id" field.

func (*PostCreate) SetImage

func (pc *PostCreate) SetImage(f *File) *PostCreate

SetImage sets the "image" edge to the File entity.

func (*PostCreate) SetImageID

func (pc *PostCreate) SetImageID(u uuid.UUID) *PostCreate

SetImageID sets the "image_id" field.

func (*PostCreate) SetNillableCreatedAt

func (pc *PostCreate) SetNillableCreatedAt(t *time.Time) *PostCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*PostCreate) SetNillableID

func (pc *PostCreate) SetNillableID(u *uuid.UUID) *PostCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*PostCreate) SetNillableImageID

func (pc *PostCreate) SetNillableImageID(u *uuid.UUID) *PostCreate

SetNillableImageID sets the "image_id" field if the given value is not nil.

func (*PostCreate) SetNillableUpdatedAt

func (pc *PostCreate) SetNillableUpdatedAt(t *time.Time) *PostCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*PostCreate) SetSlug

func (pc *PostCreate) SetSlug(s string) *PostCreate

SetSlug sets the "slug" field.

func (*PostCreate) SetText

func (pc *PostCreate) SetText(s string) *PostCreate

SetText sets the "text" field.

func (*PostCreate) SetUpdatedAt

func (pc *PostCreate) SetUpdatedAt(t time.Time) *PostCreate

SetUpdatedAt sets the "updated_at" field.

type PostCreateBulk

type PostCreateBulk struct {
	// contains filtered or unexported fields
}

PostCreateBulk is the builder for creating many Post entities in bulk.

func (*PostCreateBulk) Exec

func (pcb *PostCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PostCreateBulk) ExecX

func (pcb *PostCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PostCreateBulk) Save

func (pcb *PostCreateBulk) Save(ctx context.Context) ([]*Post, error)

Save creates the Post entities in the database.

func (*PostCreateBulk) SaveX

func (pcb *PostCreateBulk) SaveX(ctx context.Context) []*Post

SaveX is like Save, but panics if an error occurs.

type PostDelete

type PostDelete struct {
	// contains filtered or unexported fields
}

PostDelete is the builder for deleting a Post entity.

func (*PostDelete) Exec

func (pd *PostDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*PostDelete) ExecX

func (pd *PostDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PostDelete) Where

func (pd *PostDelete) Where(ps ...predicate.Post) *PostDelete

Where appends a list predicates to the PostDelete builder.

type PostDeleteOne

type PostDeleteOne struct {
	// contains filtered or unexported fields
}

PostDeleteOne is the builder for deleting a single Post entity.

func (*PostDeleteOne) Exec

func (pdo *PostDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PostDeleteOne) ExecX

func (pdo *PostDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PostDeleteOne) Where

func (pdo *PostDeleteOne) Where(ps ...predicate.Post) *PostDeleteOne

Where appends a list predicates to the PostDelete builder.

type PostEdges

type PostEdges struct {
	// Reactions holds the value of the reactions edge.
	Reactions []*Reaction `json:"reactions,omitempty"`
	// Author holds the value of the author edge.
	Author *User `json:"author,omitempty"`
	// Image holds the value of the image edge.
	Image *File `json:"image,omitempty"`
	// Comments holds the value of the comments edge.
	Comments []*Comment `json:"comments,omitempty"`
	// Notifications holds the value of the notifications edge.
	Notifications []*Notification `json:"notifications,omitempty"`
	// contains filtered or unexported fields
}

PostEdges holds the relations/edges for other nodes in the graph.

func (PostEdges) AuthorOrErr

func (e PostEdges) AuthorOrErr() (*User, error)

AuthorOrErr returns the Author value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (PostEdges) CommentsOrErr

func (e PostEdges) CommentsOrErr() ([]*Comment, error)

CommentsOrErr returns the Comments value or an error if the edge was not loaded in eager-loading.

func (PostEdges) ImageOrErr

func (e PostEdges) ImageOrErr() (*File, error)

ImageOrErr returns the Image value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (PostEdges) NotificationsOrErr

func (e PostEdges) NotificationsOrErr() ([]*Notification, error)

NotificationsOrErr returns the Notifications value or an error if the edge was not loaded in eager-loading.

func (PostEdges) ReactionsOrErr

func (e PostEdges) ReactionsOrErr() ([]*Reaction, error)

ReactionsOrErr returns the Reactions value or an error if the edge was not loaded in eager-loading.

type PostGroupBy

type PostGroupBy struct {
	// contains filtered or unexported fields
}

PostGroupBy is the group-by builder for Post entities.

func (*PostGroupBy) Aggregate

func (pgb *PostGroupBy) Aggregate(fns ...AggregateFunc) *PostGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*PostGroupBy) Bool

func (s *PostGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PostGroupBy) BoolX

func (s *PostGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PostGroupBy) Bools

func (s *PostGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PostGroupBy) BoolsX

func (s *PostGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PostGroupBy) Float64

func (s *PostGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PostGroupBy) Float64X

func (s *PostGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PostGroupBy) Float64s

func (s *PostGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PostGroupBy) Float64sX

func (s *PostGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PostGroupBy) Int

func (s *PostGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PostGroupBy) IntX

func (s *PostGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PostGroupBy) Ints

func (s *PostGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PostGroupBy) IntsX

func (s *PostGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PostGroupBy) Scan

func (pgb *PostGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PostGroupBy) ScanX

func (s *PostGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PostGroupBy) String

func (s *PostGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PostGroupBy) StringX

func (s *PostGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PostGroupBy) Strings

func (s *PostGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PostGroupBy) StringsX

func (s *PostGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PostMutation

type PostMutation struct {
	// contains filtered or unexported fields
}

PostMutation represents an operation that mutates the Post nodes in the graph.

func (*PostMutation) AddCommentIDs

func (m *PostMutation) AddCommentIDs(ids ...uuid.UUID)

AddCommentIDs adds the "comments" edge to the Comment entity by ids.

func (*PostMutation) AddField

func (m *PostMutation) 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 (*PostMutation) AddNotificationIDs

func (m *PostMutation) AddNotificationIDs(ids ...uuid.UUID)

AddNotificationIDs adds the "notifications" edge to the Notification entity by ids.

func (*PostMutation) AddReactionIDs

func (m *PostMutation) AddReactionIDs(ids ...uuid.UUID)

AddReactionIDs adds the "reactions" edge to the Reaction entity by ids.

func (*PostMutation) AddedEdges

func (m *PostMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PostMutation) AddedField

func (m *PostMutation) 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 (*PostMutation) AddedFields

func (m *PostMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PostMutation) AddedIDs

func (m *PostMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PostMutation) AuthorCleared

func (m *PostMutation) AuthorCleared() bool

AuthorCleared reports if the "author" edge to the User entity was cleared.

func (*PostMutation) AuthorID

func (m *PostMutation) AuthorID() (r uuid.UUID, exists bool)

AuthorID returns the value of the "author_id" field in the mutation.

func (*PostMutation) AuthorIDs

func (m *PostMutation) AuthorIDs() (ids []uuid.UUID)

AuthorIDs returns the "author" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use AuthorID instead. It exists only for internal usage by the builders.

func (*PostMutation) ClearAuthor

func (m *PostMutation) ClearAuthor()

ClearAuthor clears the "author" edge to the User entity.

func (*PostMutation) ClearComments

func (m *PostMutation) ClearComments()

ClearComments clears the "comments" edge to the Comment entity.

func (*PostMutation) ClearEdge

func (m *PostMutation) 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 (*PostMutation) ClearField

func (m *PostMutation) 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 (*PostMutation) ClearImage

func (m *PostMutation) ClearImage()

ClearImage clears the "image" edge to the File entity.

func (*PostMutation) ClearImageID

func (m *PostMutation) ClearImageID()

ClearImageID clears the value of the "image_id" field.

func (*PostMutation) ClearNotifications

func (m *PostMutation) ClearNotifications()

ClearNotifications clears the "notifications" edge to the Notification entity.

func (*PostMutation) ClearReactions

func (m *PostMutation) ClearReactions()

ClearReactions clears the "reactions" edge to the Reaction entity.

func (*PostMutation) ClearedEdges

func (m *PostMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PostMutation) ClearedFields

func (m *PostMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PostMutation) Client

func (m PostMutation) 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 (*PostMutation) CommentsCleared

func (m *PostMutation) CommentsCleared() bool

CommentsCleared reports if the "comments" edge to the Comment entity was cleared.

func (*PostMutation) CommentsIDs

func (m *PostMutation) CommentsIDs() (ids []uuid.UUID)

CommentsIDs returns the "comments" edge IDs in the mutation.

func (*PostMutation) CreatedAt

func (m *PostMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*PostMutation) EdgeCleared

func (m *PostMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PostMutation) Field

func (m *PostMutation) 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 (*PostMutation) FieldCleared

func (m *PostMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PostMutation) Fields

func (m *PostMutation) 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 (*PostMutation) ID

func (m *PostMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*PostMutation) IDs

func (m *PostMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*PostMutation) ImageCleared

func (m *PostMutation) ImageCleared() bool

ImageCleared reports if the "image" edge to the File entity was cleared.

func (*PostMutation) ImageID

func (m *PostMutation) ImageID() (r uuid.UUID, exists bool)

ImageID returns the value of the "image_id" field in the mutation.

func (*PostMutation) ImageIDCleared

func (m *PostMutation) ImageIDCleared() bool

ImageIDCleared returns if the "image_id" field was cleared in this mutation.

func (*PostMutation) ImageIDs

func (m *PostMutation) ImageIDs() (ids []uuid.UUID)

ImageIDs returns the "image" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ImageID instead. It exists only for internal usage by the builders.

func (*PostMutation) NotificationsCleared

func (m *PostMutation) NotificationsCleared() bool

NotificationsCleared reports if the "notifications" edge to the Notification entity was cleared.

func (*PostMutation) NotificationsIDs

func (m *PostMutation) NotificationsIDs() (ids []uuid.UUID)

NotificationsIDs returns the "notifications" edge IDs in the mutation.

func (*PostMutation) OldAuthorID

func (m *PostMutation) OldAuthorID(ctx context.Context) (v uuid.UUID, err error)

OldAuthorID returns the old "author_id" field's value of the Post entity. If the Post 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 (*PostMutation) OldCreatedAt

func (m *PostMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Post entity. If the Post 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 (*PostMutation) OldField

func (m *PostMutation) 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 (*PostMutation) OldImageID

func (m *PostMutation) OldImageID(ctx context.Context) (v *uuid.UUID, err error)

OldImageID returns the old "image_id" field's value of the Post entity. If the Post 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 (*PostMutation) OldSlug

func (m *PostMutation) OldSlug(ctx context.Context) (v string, err error)

OldSlug returns the old "slug" field's value of the Post entity. If the Post 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 (*PostMutation) OldText

func (m *PostMutation) OldText(ctx context.Context) (v string, err error)

OldText returns the old "text" field's value of the Post entity. If the Post 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 (*PostMutation) OldUpdatedAt

func (m *PostMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Post entity. If the Post 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 (*PostMutation) Op

func (m *PostMutation) Op() Op

Op returns the operation name.

func (*PostMutation) ReactionsCleared

func (m *PostMutation) ReactionsCleared() bool

ReactionsCleared reports if the "reactions" edge to the Reaction entity was cleared.

func (*PostMutation) ReactionsIDs

func (m *PostMutation) ReactionsIDs() (ids []uuid.UUID)

ReactionsIDs returns the "reactions" edge IDs in the mutation.

func (*PostMutation) RemoveCommentIDs

func (m *PostMutation) RemoveCommentIDs(ids ...uuid.UUID)

RemoveCommentIDs removes the "comments" edge to the Comment entity by IDs.

func (*PostMutation) RemoveNotificationIDs

func (m *PostMutation) RemoveNotificationIDs(ids ...uuid.UUID)

RemoveNotificationIDs removes the "notifications" edge to the Notification entity by IDs.

func (*PostMutation) RemoveReactionIDs

func (m *PostMutation) RemoveReactionIDs(ids ...uuid.UUID)

RemoveReactionIDs removes the "reactions" edge to the Reaction entity by IDs.

func (*PostMutation) RemovedCommentsIDs

func (m *PostMutation) RemovedCommentsIDs() (ids []uuid.UUID)

RemovedComments returns the removed IDs of the "comments" edge to the Comment entity.

func (*PostMutation) RemovedEdges

func (m *PostMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PostMutation) RemovedIDs

func (m *PostMutation) 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 (*PostMutation) RemovedNotificationsIDs

func (m *PostMutation) RemovedNotificationsIDs() (ids []uuid.UUID)

RemovedNotifications returns the removed IDs of the "notifications" edge to the Notification entity.

func (*PostMutation) RemovedReactionsIDs

func (m *PostMutation) RemovedReactionsIDs() (ids []uuid.UUID)

RemovedReactions returns the removed IDs of the "reactions" edge to the Reaction entity.

func (*PostMutation) ResetAuthor

func (m *PostMutation) ResetAuthor()

ResetAuthor resets all changes to the "author" edge.

func (*PostMutation) ResetAuthorID

func (m *PostMutation) ResetAuthorID()

ResetAuthorID resets all changes to the "author_id" field.

func (*PostMutation) ResetComments

func (m *PostMutation) ResetComments()

ResetComments resets all changes to the "comments" edge.

func (*PostMutation) ResetCreatedAt

func (m *PostMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*PostMutation) ResetEdge

func (m *PostMutation) 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 (*PostMutation) ResetField

func (m *PostMutation) 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 (*PostMutation) ResetImage

func (m *PostMutation) ResetImage()

ResetImage resets all changes to the "image" edge.

func (*PostMutation) ResetImageID

func (m *PostMutation) ResetImageID()

ResetImageID resets all changes to the "image_id" field.

func (*PostMutation) ResetNotifications

func (m *PostMutation) ResetNotifications()

ResetNotifications resets all changes to the "notifications" edge.

func (*PostMutation) ResetReactions

func (m *PostMutation) ResetReactions()

ResetReactions resets all changes to the "reactions" edge.

func (*PostMutation) ResetSlug

func (m *PostMutation) ResetSlug()

ResetSlug resets all changes to the "slug" field.

func (*PostMutation) ResetText

func (m *PostMutation) ResetText()

ResetText resets all changes to the "text" field.

func (*PostMutation) ResetUpdatedAt

func (m *PostMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*PostMutation) SetAuthorID

func (m *PostMutation) SetAuthorID(u uuid.UUID)

SetAuthorID sets the "author_id" field.

func (*PostMutation) SetCreatedAt

func (m *PostMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*PostMutation) SetField

func (m *PostMutation) 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 (*PostMutation) SetID

func (m *PostMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Post entities.

func (*PostMutation) SetImageID

func (m *PostMutation) SetImageID(u uuid.UUID)

SetImageID sets the "image_id" field.

func (*PostMutation) SetOp

func (m *PostMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PostMutation) SetSlug

func (m *PostMutation) SetSlug(s string)

SetSlug sets the "slug" field.

func (*PostMutation) SetText

func (m *PostMutation) SetText(s string)

SetText sets the "text" field.

func (*PostMutation) SetUpdatedAt

func (m *PostMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*PostMutation) Slug

func (m *PostMutation) Slug() (r string, exists bool)

Slug returns the value of the "slug" field in the mutation.

func (*PostMutation) Text

func (m *PostMutation) Text() (r string, exists bool)

Text returns the value of the "text" field in the mutation.

func (PostMutation) Tx

func (m PostMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PostMutation) Type

func (m *PostMutation) Type() string

Type returns the node type of this mutation (Post).

func (*PostMutation) UpdatedAt

func (m *PostMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*PostMutation) Where

func (m *PostMutation) Where(ps ...predicate.Post)

Where appends a list predicates to the PostMutation builder.

func (*PostMutation) WhereP

func (m *PostMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PostMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type PostQuery

type PostQuery struct {
	// contains filtered or unexported fields
}

PostQuery is the builder for querying Post entities.

func (*PostQuery) Aggregate

func (pq *PostQuery) Aggregate(fns ...AggregateFunc) *PostSelect

Aggregate returns a PostSelect configured with the given aggregations.

func (*PostQuery) All

func (pq *PostQuery) All(ctx context.Context) ([]*Post, error)

All executes the query and returns a list of Posts.

func (*PostQuery) AllX

func (pq *PostQuery) AllX(ctx context.Context) []*Post

AllX is like All, but panics if an error occurs.

func (*PostQuery) Clone

func (pq *PostQuery) Clone() *PostQuery

Clone returns a duplicate of the PostQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PostQuery) Count

func (pq *PostQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PostQuery) CountX

func (pq *PostQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PostQuery) Exist

func (pq *PostQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PostQuery) ExistX

func (pq *PostQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PostQuery) First

func (pq *PostQuery) First(ctx context.Context) (*Post, error)

First returns the first Post entity from the query. Returns a *NotFoundError when no Post was found.

func (*PostQuery) FirstID

func (pq *PostQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Post ID from the query. Returns a *NotFoundError when no Post ID was found.

func (*PostQuery) FirstIDX

func (pq *PostQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*PostQuery) FirstX

func (pq *PostQuery) FirstX(ctx context.Context) *Post

FirstX is like First, but panics if an error occurs.

func (*PostQuery) GroupBy

func (pq *PostQuery) GroupBy(field string, fields ...string) *PostGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Post.Query().
	GroupBy(post.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PostQuery) IDs

func (pq *PostQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Post IDs.

func (*PostQuery) IDsX

func (pq *PostQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*PostQuery) Limit

func (pq *PostQuery) Limit(limit int) *PostQuery

Limit the number of records to be returned by this query.

func (*PostQuery) Offset

func (pq *PostQuery) Offset(offset int) *PostQuery

Offset to start from.

func (*PostQuery) Only

func (pq *PostQuery) Only(ctx context.Context) (*Post, error)

Only returns a single Post entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Post entity is found. Returns a *NotFoundError when no Post entities are found.

func (*PostQuery) OnlyID

func (pq *PostQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Post ID in the query. Returns a *NotSingularError when more than one Post ID is found. Returns a *NotFoundError when no entities are found.

func (*PostQuery) OnlyIDX

func (pq *PostQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PostQuery) OnlyX

func (pq *PostQuery) OnlyX(ctx context.Context) *Post

OnlyX is like Only, but panics if an error occurs.

func (*PostQuery) Order

func (pq *PostQuery) Order(o ...post.OrderOption) *PostQuery

Order specifies how the records should be ordered.

func (*PostQuery) QueryAuthor

func (pq *PostQuery) QueryAuthor() *UserQuery

QueryAuthor chains the current query on the "author" edge.

func (*PostQuery) QueryComments

func (pq *PostQuery) QueryComments() *CommentQuery

QueryComments chains the current query on the "comments" edge.

func (*PostQuery) QueryImage

func (pq *PostQuery) QueryImage() *FileQuery

QueryImage chains the current query on the "image" edge.

func (*PostQuery) QueryNotifications

func (pq *PostQuery) QueryNotifications() *NotificationQuery

QueryNotifications chains the current query on the "notifications" edge.

func (*PostQuery) QueryReactions

func (pq *PostQuery) QueryReactions() *ReactionQuery

QueryReactions chains the current query on the "reactions" edge.

func (*PostQuery) Select

func (pq *PostQuery) Select(fields ...string) *PostSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Post.Query().
	Select(post.FieldCreatedAt).
	Scan(ctx, &v)

func (*PostQuery) Unique

func (pq *PostQuery) Unique(unique bool) *PostQuery

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 (*PostQuery) Where

func (pq *PostQuery) Where(ps ...predicate.Post) *PostQuery

Where adds a new predicate for the PostQuery builder.

func (*PostQuery) WithAuthor

func (pq *PostQuery) WithAuthor(opts ...func(*UserQuery)) *PostQuery

WithAuthor tells the query-builder to eager-load the nodes that are connected to the "author" edge. The optional arguments are used to configure the query builder of the edge.

func (*PostQuery) WithComments

func (pq *PostQuery) WithComments(opts ...func(*CommentQuery)) *PostQuery

WithComments tells the query-builder to eager-load the nodes that are connected to the "comments" edge. The optional arguments are used to configure the query builder of the edge.

func (*PostQuery) WithImage

func (pq *PostQuery) WithImage(opts ...func(*FileQuery)) *PostQuery

WithImage tells the query-builder to eager-load the nodes that are connected to the "image" edge. The optional arguments are used to configure the query builder of the edge.

func (*PostQuery) WithNotifications

func (pq *PostQuery) WithNotifications(opts ...func(*NotificationQuery)) *PostQuery

WithNotifications tells the query-builder to eager-load the nodes that are connected to the "notifications" edge. The optional arguments are used to configure the query builder of the edge.

func (*PostQuery) WithReactions

func (pq *PostQuery) WithReactions(opts ...func(*ReactionQuery)) *PostQuery

WithReactions tells the query-builder to eager-load the nodes that are connected to the "reactions" edge. The optional arguments are used to configure the query builder of the edge.

type PostSelect

type PostSelect struct {
	*PostQuery
	// contains filtered or unexported fields
}

PostSelect is the builder for selecting fields of Post entities.

func (*PostSelect) Aggregate

func (ps *PostSelect) Aggregate(fns ...AggregateFunc) *PostSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PostSelect) Bool

func (s *PostSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PostSelect) BoolX

func (s *PostSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PostSelect) Bools

func (s *PostSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PostSelect) BoolsX

func (s *PostSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PostSelect) Float64

func (s *PostSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PostSelect) Float64X

func (s *PostSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PostSelect) Float64s

func (s *PostSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PostSelect) Float64sX

func (s *PostSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PostSelect) Int

func (s *PostSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PostSelect) IntX

func (s *PostSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PostSelect) Ints

func (s *PostSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PostSelect) IntsX

func (s *PostSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PostSelect) Scan

func (ps *PostSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PostSelect) ScanX

func (s *PostSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PostSelect) String

func (s *PostSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PostSelect) StringX

func (s *PostSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PostSelect) Strings

func (s *PostSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PostSelect) StringsX

func (s *PostSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PostUpdate

type PostUpdate struct {
	// contains filtered or unexported fields
}

PostUpdate is the builder for updating Post entities.

func (*PostUpdate) AddCommentIDs

func (pu *PostUpdate) AddCommentIDs(ids ...uuid.UUID) *PostUpdate

AddCommentIDs adds the "comments" edge to the Comment entity by IDs.

func (*PostUpdate) AddComments

func (pu *PostUpdate) AddComments(c ...*Comment) *PostUpdate

AddComments adds the "comments" edges to the Comment entity.

func (*PostUpdate) AddNotificationIDs

func (pu *PostUpdate) AddNotificationIDs(ids ...uuid.UUID) *PostUpdate

AddNotificationIDs adds the "notifications" edge to the Notification entity by IDs.

func (*PostUpdate) AddNotifications

func (pu *PostUpdate) AddNotifications(n ...*Notification) *PostUpdate

AddNotifications adds the "notifications" edges to the Notification entity.

func (*PostUpdate) AddReactionIDs

func (pu *PostUpdate) AddReactionIDs(ids ...uuid.UUID) *PostUpdate

AddReactionIDs adds the "reactions" edge to the Reaction entity by IDs.

func (*PostUpdate) AddReactions

func (pu *PostUpdate) AddReactions(r ...*Reaction) *PostUpdate

AddReactions adds the "reactions" edges to the Reaction entity.

func (*PostUpdate) ClearAuthor

func (pu *PostUpdate) ClearAuthor() *PostUpdate

ClearAuthor clears the "author" edge to the User entity.

func (*PostUpdate) ClearComments

func (pu *PostUpdate) ClearComments() *PostUpdate

ClearComments clears all "comments" edges to the Comment entity.

func (*PostUpdate) ClearImage

func (pu *PostUpdate) ClearImage() *PostUpdate

ClearImage clears the "image" edge to the File entity.

func (*PostUpdate) ClearImageID

func (pu *PostUpdate) ClearImageID() *PostUpdate

ClearImageID clears the value of the "image_id" field.

func (*PostUpdate) ClearNotifications

func (pu *PostUpdate) ClearNotifications() *PostUpdate

ClearNotifications clears all "notifications" edges to the Notification entity.

func (*PostUpdate) ClearReactions

func (pu *PostUpdate) ClearReactions() *PostUpdate

ClearReactions clears all "reactions" edges to the Reaction entity.

func (*PostUpdate) Exec

func (pu *PostUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PostUpdate) ExecX

func (pu *PostUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PostUpdate) Mutation

func (pu *PostUpdate) Mutation() *PostMutation

Mutation returns the PostMutation object of the builder.

func (*PostUpdate) RemoveCommentIDs

func (pu *PostUpdate) RemoveCommentIDs(ids ...uuid.UUID) *PostUpdate

RemoveCommentIDs removes the "comments" edge to Comment entities by IDs.

func (*PostUpdate) RemoveComments

func (pu *PostUpdate) RemoveComments(c ...*Comment) *PostUpdate

RemoveComments removes "comments" edges to Comment entities.

func (*PostUpdate) RemoveNotificationIDs

func (pu *PostUpdate) RemoveNotificationIDs(ids ...uuid.UUID) *PostUpdate

RemoveNotificationIDs removes the "notifications" edge to Notification entities by IDs.

func (*PostUpdate) RemoveNotifications

func (pu *PostUpdate) RemoveNotifications(n ...*Notification) *PostUpdate

RemoveNotifications removes "notifications" edges to Notification entities.

func (*PostUpdate) RemoveReactionIDs

func (pu *PostUpdate) RemoveReactionIDs(ids ...uuid.UUID) *PostUpdate

RemoveReactionIDs removes the "reactions" edge to Reaction entities by IDs.

func (*PostUpdate) RemoveReactions

func (pu *PostUpdate) RemoveReactions(r ...*Reaction) *PostUpdate

RemoveReactions removes "reactions" edges to Reaction entities.

func (*PostUpdate) Save

func (pu *PostUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*PostUpdate) SaveX

func (pu *PostUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PostUpdate) SetAuthor

func (pu *PostUpdate) SetAuthor(u *User) *PostUpdate

SetAuthor sets the "author" edge to the User entity.

func (*PostUpdate) SetAuthorID

func (pu *PostUpdate) SetAuthorID(u uuid.UUID) *PostUpdate

SetAuthorID sets the "author_id" field.

func (*PostUpdate) SetCreatedAt

func (pu *PostUpdate) SetCreatedAt(t time.Time) *PostUpdate

SetCreatedAt sets the "created_at" field.

func (*PostUpdate) SetImage

func (pu *PostUpdate) SetImage(f *File) *PostUpdate

SetImage sets the "image" edge to the File entity.

func (*PostUpdate) SetImageID

func (pu *PostUpdate) SetImageID(u uuid.UUID) *PostUpdate

SetImageID sets the "image_id" field.

func (*PostUpdate) SetNillableAuthorID

func (pu *PostUpdate) SetNillableAuthorID(u *uuid.UUID) *PostUpdate

SetNillableAuthorID sets the "author_id" field if the given value is not nil.

func (*PostUpdate) SetNillableCreatedAt

func (pu *PostUpdate) SetNillableCreatedAt(t *time.Time) *PostUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*PostUpdate) SetNillableImageID

func (pu *PostUpdate) SetNillableImageID(u *uuid.UUID) *PostUpdate

SetNillableImageID sets the "image_id" field if the given value is not nil.

func (*PostUpdate) SetNillableSlug

func (pu *PostUpdate) SetNillableSlug(s *string) *PostUpdate

SetNillableSlug sets the "slug" field if the given value is not nil.

func (*PostUpdate) SetNillableText

func (pu *PostUpdate) SetNillableText(s *string) *PostUpdate

SetNillableText sets the "text" field if the given value is not nil.

func (*PostUpdate) SetSlug

func (pu *PostUpdate) SetSlug(s string) *PostUpdate

SetSlug sets the "slug" field.

func (*PostUpdate) SetText

func (pu *PostUpdate) SetText(s string) *PostUpdate

SetText sets the "text" field.

func (*PostUpdate) SetUpdatedAt

func (pu *PostUpdate) SetUpdatedAt(t time.Time) *PostUpdate

SetUpdatedAt sets the "updated_at" field.

func (*PostUpdate) Where

func (pu *PostUpdate) Where(ps ...predicate.Post) *PostUpdate

Where appends a list predicates to the PostUpdate builder.

type PostUpdateOne

type PostUpdateOne struct {
	// contains filtered or unexported fields
}

PostUpdateOne is the builder for updating a single Post entity.

func (*PostUpdateOne) AddCommentIDs

func (puo *PostUpdateOne) AddCommentIDs(ids ...uuid.UUID) *PostUpdateOne

AddCommentIDs adds the "comments" edge to the Comment entity by IDs.

func (*PostUpdateOne) AddComments

func (puo *PostUpdateOne) AddComments(c ...*Comment) *PostUpdateOne

AddComments adds the "comments" edges to the Comment entity.

func (*PostUpdateOne) AddNotificationIDs

func (puo *PostUpdateOne) AddNotificationIDs(ids ...uuid.UUID) *PostUpdateOne

AddNotificationIDs adds the "notifications" edge to the Notification entity by IDs.

func (*PostUpdateOne) AddNotifications

func (puo *PostUpdateOne) AddNotifications(n ...*Notification) *PostUpdateOne

AddNotifications adds the "notifications" edges to the Notification entity.

func (*PostUpdateOne) AddReactionIDs

func (puo *PostUpdateOne) AddReactionIDs(ids ...uuid.UUID) *PostUpdateOne

AddReactionIDs adds the "reactions" edge to the Reaction entity by IDs.

func (*PostUpdateOne) AddReactions

func (puo *PostUpdateOne) AddReactions(r ...*Reaction) *PostUpdateOne

AddReactions adds the "reactions" edges to the Reaction entity.

func (*PostUpdateOne) ClearAuthor

func (puo *PostUpdateOne) ClearAuthor() *PostUpdateOne

ClearAuthor clears the "author" edge to the User entity.

func (*PostUpdateOne) ClearComments

func (puo *PostUpdateOne) ClearComments() *PostUpdateOne

ClearComments clears all "comments" edges to the Comment entity.

func (*PostUpdateOne) ClearImage

func (puo *PostUpdateOne) ClearImage() *PostUpdateOne

ClearImage clears the "image" edge to the File entity.

func (*PostUpdateOne) ClearImageID

func (puo *PostUpdateOne) ClearImageID() *PostUpdateOne

ClearImageID clears the value of the "image_id" field.

func (*PostUpdateOne) ClearNotifications

func (puo *PostUpdateOne) ClearNotifications() *PostUpdateOne

ClearNotifications clears all "notifications" edges to the Notification entity.

func (*PostUpdateOne) ClearReactions

func (puo *PostUpdateOne) ClearReactions() *PostUpdateOne

ClearReactions clears all "reactions" edges to the Reaction entity.

func (*PostUpdateOne) Exec

func (puo *PostUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PostUpdateOne) ExecX

func (puo *PostUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PostUpdateOne) Mutation

func (puo *PostUpdateOne) Mutation() *PostMutation

Mutation returns the PostMutation object of the builder.

func (*PostUpdateOne) RemoveCommentIDs

func (puo *PostUpdateOne) RemoveCommentIDs(ids ...uuid.UUID) *PostUpdateOne

RemoveCommentIDs removes the "comments" edge to Comment entities by IDs.

func (*PostUpdateOne) RemoveComments

func (puo *PostUpdateOne) RemoveComments(c ...*Comment) *PostUpdateOne

RemoveComments removes "comments" edges to Comment entities.

func (*PostUpdateOne) RemoveNotificationIDs

func (puo *PostUpdateOne) RemoveNotificationIDs(ids ...uuid.UUID) *PostUpdateOne

RemoveNotificationIDs removes the "notifications" edge to Notification entities by IDs.

func (*PostUpdateOne) RemoveNotifications

func (puo *PostUpdateOne) RemoveNotifications(n ...*Notification) *PostUpdateOne

RemoveNotifications removes "notifications" edges to Notification entities.

func (*PostUpdateOne) RemoveReactionIDs

func (puo *PostUpdateOne) RemoveReactionIDs(ids ...uuid.UUID) *PostUpdateOne

RemoveReactionIDs removes the "reactions" edge to Reaction entities by IDs.

func (*PostUpdateOne) RemoveReactions

func (puo *PostUpdateOne) RemoveReactions(r ...*Reaction) *PostUpdateOne

RemoveReactions removes "reactions" edges to Reaction entities.

func (*PostUpdateOne) Save

func (puo *PostUpdateOne) Save(ctx context.Context) (*Post, error)

Save executes the query and returns the updated Post entity.

func (*PostUpdateOne) SaveX

func (puo *PostUpdateOne) SaveX(ctx context.Context) *Post

SaveX is like Save, but panics if an error occurs.

func (*PostUpdateOne) Select

func (puo *PostUpdateOne) Select(field string, fields ...string) *PostUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PostUpdateOne) SetAuthor

func (puo *PostUpdateOne) SetAuthor(u *User) *PostUpdateOne

SetAuthor sets the "author" edge to the User entity.

func (*PostUpdateOne) SetAuthorID

func (puo *PostUpdateOne) SetAuthorID(u uuid.UUID) *PostUpdateOne

SetAuthorID sets the "author_id" field.

func (*PostUpdateOne) SetCreatedAt

func (puo *PostUpdateOne) SetCreatedAt(t time.Time) *PostUpdateOne

SetCreatedAt sets the "created_at" field.

func (*PostUpdateOne) SetImage

func (puo *PostUpdateOne) SetImage(f *File) *PostUpdateOne

SetImage sets the "image" edge to the File entity.

func (*PostUpdateOne) SetImageID

func (puo *PostUpdateOne) SetImageID(u uuid.UUID) *PostUpdateOne

SetImageID sets the "image_id" field.

func (*PostUpdateOne) SetNillableAuthorID

func (puo *PostUpdateOne) SetNillableAuthorID(u *uuid.UUID) *PostUpdateOne

SetNillableAuthorID sets the "author_id" field if the given value is not nil.

func (*PostUpdateOne) SetNillableCreatedAt

func (puo *PostUpdateOne) SetNillableCreatedAt(t *time.Time) *PostUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*PostUpdateOne) SetNillableImageID

func (puo *PostUpdateOne) SetNillableImageID(u *uuid.UUID) *PostUpdateOne

SetNillableImageID sets the "image_id" field if the given value is not nil.

func (*PostUpdateOne) SetNillableSlug

func (puo *PostUpdateOne) SetNillableSlug(s *string) *PostUpdateOne

SetNillableSlug sets the "slug" field if the given value is not nil.

func (*PostUpdateOne) SetNillableText

func (puo *PostUpdateOne) SetNillableText(s *string) *PostUpdateOne

SetNillableText sets the "text" field if the given value is not nil.

func (*PostUpdateOne) SetSlug

func (puo *PostUpdateOne) SetSlug(s string) *PostUpdateOne

SetSlug sets the "slug" field.

func (*PostUpdateOne) SetText

func (puo *PostUpdateOne) SetText(s string) *PostUpdateOne

SetText sets the "text" field.

func (*PostUpdateOne) SetUpdatedAt

func (puo *PostUpdateOne) SetUpdatedAt(t time.Time) *PostUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*PostUpdateOne) Where

func (puo *PostUpdateOne) Where(ps ...predicate.Post) *PostUpdateOne

Where appends a list predicates to the PostUpdate builder.

type Posts

type Posts []*Post

Posts is a parsable slice of Post.

type Querier

type Querier = ent.Querier

ent aliases to avoid import conflicts in user's code.

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflicts in user's code.

type QueryContext

type QueryContext = ent.QueryContext

ent aliases to avoid import conflicts in user's code.

type Reaction

type Reaction struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID uuid.UUID `json:"user_id,omitempty"`
	// Rtype holds the value of the "rtype" field.
	Rtype reaction.Rtype `json:"rtype,omitempty"`
	// PostID holds the value of the "post_id" field.
	PostID *uuid.UUID `json:"post_id,omitempty"`
	// CommentID holds the value of the "comment_id" field.
	CommentID *uuid.UUID `json:"comment_id,omitempty"`
	// ReplyID holds the value of the "reply_id" field.
	ReplyID *uuid.UUID `json:"reply_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ReactionQuery when eager-loading is set.
	Edges ReactionEdges `json:"edges"`
	// contains filtered or unexported fields
}

Reaction is the model entity for the Reaction schema.

func (*Reaction) QueryComment

func (r *Reaction) QueryComment() *CommentQuery

QueryComment queries the "comment" edge of the Reaction entity.

func (*Reaction) QueryPost

func (r *Reaction) QueryPost() *PostQuery

QueryPost queries the "post" edge of the Reaction entity.

func (*Reaction) QueryReply

func (r *Reaction) QueryReply() *ReplyQuery

QueryReply queries the "reply" edge of the Reaction entity.

func (*Reaction) QueryUser

func (r *Reaction) QueryUser() *UserQuery

QueryUser queries the "user" edge of the Reaction entity.

func (*Reaction) String

func (r *Reaction) String() string

String implements the fmt.Stringer.

func (*Reaction) Unwrap

func (r *Reaction) Unwrap() *Reaction

Unwrap unwraps the Reaction entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Reaction) Update

func (r *Reaction) Update() *ReactionUpdateOne

Update returns a builder for updating this Reaction. Note that you need to call Reaction.Unwrap() before calling this method if this Reaction was returned from a transaction, and the transaction was committed or rolled back.

func (*Reaction) Value

func (r *Reaction) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Reaction. This includes values selected through modifiers, order, etc.

type ReactionClient

type ReactionClient struct {
	// contains filtered or unexported fields
}

ReactionClient is a client for the Reaction schema.

func NewReactionClient

func NewReactionClient(c config) *ReactionClient

NewReactionClient returns a client for the Reaction from the given config.

func (*ReactionClient) Create

func (c *ReactionClient) Create() *ReactionCreate

Create returns a builder for creating a Reaction entity.

func (*ReactionClient) CreateBulk

func (c *ReactionClient) CreateBulk(builders ...*ReactionCreate) *ReactionCreateBulk

CreateBulk returns a builder for creating a bulk of Reaction entities.

func (*ReactionClient) Delete

func (c *ReactionClient) Delete() *ReactionDelete

Delete returns a delete builder for Reaction.

func (*ReactionClient) DeleteOne

func (c *ReactionClient) DeleteOne(r *Reaction) *ReactionDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ReactionClient) DeleteOneID

func (c *ReactionClient) DeleteOneID(id uuid.UUID) *ReactionDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ReactionClient) Get

func (c *ReactionClient) Get(ctx context.Context, id uuid.UUID) (*Reaction, error)

Get returns a Reaction entity by its id.

func (*ReactionClient) GetX

func (c *ReactionClient) GetX(ctx context.Context, id uuid.UUID) *Reaction

GetX is like Get, but panics if an error occurs.

func (*ReactionClient) Hooks

func (c *ReactionClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ReactionClient) Intercept

func (c *ReactionClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `reaction.Intercept(f(g(h())))`.

func (*ReactionClient) Interceptors

func (c *ReactionClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ReactionClient) MapCreateBulk

func (c *ReactionClient) MapCreateBulk(slice any, setFunc func(*ReactionCreate, int)) *ReactionCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*ReactionClient) Query

func (c *ReactionClient) Query() *ReactionQuery

Query returns a query builder for Reaction.

func (*ReactionClient) QueryComment

func (c *ReactionClient) QueryComment(r *Reaction) *CommentQuery

QueryComment queries the comment edge of a Reaction.

func (*ReactionClient) QueryPost

func (c *ReactionClient) QueryPost(r *Reaction) *PostQuery

QueryPost queries the post edge of a Reaction.

func (*ReactionClient) QueryReply

func (c *ReactionClient) QueryReply(r *Reaction) *ReplyQuery

QueryReply queries the reply edge of a Reaction.

func (*ReactionClient) QueryUser

func (c *ReactionClient) QueryUser(r *Reaction) *UserQuery

QueryUser queries the user edge of a Reaction.

func (*ReactionClient) Update

func (c *ReactionClient) Update() *ReactionUpdate

Update returns an update builder for Reaction.

func (*ReactionClient) UpdateOne

func (c *ReactionClient) UpdateOne(r *Reaction) *ReactionUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ReactionClient) UpdateOneID

func (c *ReactionClient) UpdateOneID(id uuid.UUID) *ReactionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ReactionClient) Use

func (c *ReactionClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `reaction.Hooks(f(g(h())))`.

type ReactionCreate

type ReactionCreate struct {
	// contains filtered or unexported fields
}

ReactionCreate is the builder for creating a Reaction entity.

func (*ReactionCreate) Exec

func (rc *ReactionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ReactionCreate) ExecX

func (rc *ReactionCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReactionCreate) Mutation

func (rc *ReactionCreate) Mutation() *ReactionMutation

Mutation returns the ReactionMutation object of the builder.

func (*ReactionCreate) Save

func (rc *ReactionCreate) Save(ctx context.Context) (*Reaction, error)

Save creates the Reaction in the database.

func (*ReactionCreate) SaveX

func (rc *ReactionCreate) SaveX(ctx context.Context) *Reaction

SaveX calls Save and panics if Save returns an error.

func (*ReactionCreate) SetComment

func (rc *ReactionCreate) SetComment(c *Comment) *ReactionCreate

SetComment sets the "comment" edge to the Comment entity.

func (*ReactionCreate) SetCommentID

func (rc *ReactionCreate) SetCommentID(u uuid.UUID) *ReactionCreate

SetCommentID sets the "comment_id" field.

func (*ReactionCreate) SetCreatedAt

func (rc *ReactionCreate) SetCreatedAt(t time.Time) *ReactionCreate

SetCreatedAt sets the "created_at" field.

func (*ReactionCreate) SetID

func (rc *ReactionCreate) SetID(u uuid.UUID) *ReactionCreate

SetID sets the "id" field.

func (*ReactionCreate) SetNillableCommentID

func (rc *ReactionCreate) SetNillableCommentID(u *uuid.UUID) *ReactionCreate

SetNillableCommentID sets the "comment_id" field if the given value is not nil.

func (*ReactionCreate) SetNillableCreatedAt

func (rc *ReactionCreate) SetNillableCreatedAt(t *time.Time) *ReactionCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ReactionCreate) SetNillableID

func (rc *ReactionCreate) SetNillableID(u *uuid.UUID) *ReactionCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ReactionCreate) SetNillablePostID

func (rc *ReactionCreate) SetNillablePostID(u *uuid.UUID) *ReactionCreate

SetNillablePostID sets the "post_id" field if the given value is not nil.

func (*ReactionCreate) SetNillableReplyID

func (rc *ReactionCreate) SetNillableReplyID(u *uuid.UUID) *ReactionCreate

SetNillableReplyID sets the "reply_id" field if the given value is not nil.

func (*ReactionCreate) SetNillableRtype

func (rc *ReactionCreate) SetNillableRtype(r *reaction.Rtype) *ReactionCreate

SetNillableRtype sets the "rtype" field if the given value is not nil.

func (*ReactionCreate) SetNillableUpdatedAt

func (rc *ReactionCreate) SetNillableUpdatedAt(t *time.Time) *ReactionCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*ReactionCreate) SetPost

func (rc *ReactionCreate) SetPost(p *Post) *ReactionCreate

SetPost sets the "post" edge to the Post entity.

func (*ReactionCreate) SetPostID

func (rc *ReactionCreate) SetPostID(u uuid.UUID) *ReactionCreate

SetPostID sets the "post_id" field.

func (*ReactionCreate) SetReply

func (rc *ReactionCreate) SetReply(r *Reply) *ReactionCreate

SetReply sets the "reply" edge to the Reply entity.

func (*ReactionCreate) SetReplyID

func (rc *ReactionCreate) SetReplyID(u uuid.UUID) *ReactionCreate

SetReplyID sets the "reply_id" field.

func (*ReactionCreate) SetRtype

func (rc *ReactionCreate) SetRtype(r reaction.Rtype) *ReactionCreate

SetRtype sets the "rtype" field.

func (*ReactionCreate) SetUpdatedAt

func (rc *ReactionCreate) SetUpdatedAt(t time.Time) *ReactionCreate

SetUpdatedAt sets the "updated_at" field.

func (*ReactionCreate) SetUser

func (rc *ReactionCreate) SetUser(u *User) *ReactionCreate

SetUser sets the "user" edge to the User entity.

func (*ReactionCreate) SetUserID

func (rc *ReactionCreate) SetUserID(u uuid.UUID) *ReactionCreate

SetUserID sets the "user_id" field.

type ReactionCreateBulk

type ReactionCreateBulk struct {
	// contains filtered or unexported fields
}

ReactionCreateBulk is the builder for creating many Reaction entities in bulk.

func (*ReactionCreateBulk) Exec

func (rcb *ReactionCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ReactionCreateBulk) ExecX

func (rcb *ReactionCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReactionCreateBulk) Save

func (rcb *ReactionCreateBulk) Save(ctx context.Context) ([]*Reaction, error)

Save creates the Reaction entities in the database.

func (*ReactionCreateBulk) SaveX

func (rcb *ReactionCreateBulk) SaveX(ctx context.Context) []*Reaction

SaveX is like Save, but panics if an error occurs.

type ReactionDelete

type ReactionDelete struct {
	// contains filtered or unexported fields
}

ReactionDelete is the builder for deleting a Reaction entity.

func (*ReactionDelete) Exec

func (rd *ReactionDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ReactionDelete) ExecX

func (rd *ReactionDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ReactionDelete) Where

func (rd *ReactionDelete) Where(ps ...predicate.Reaction) *ReactionDelete

Where appends a list predicates to the ReactionDelete builder.

type ReactionDeleteOne

type ReactionDeleteOne struct {
	// contains filtered or unexported fields
}

ReactionDeleteOne is the builder for deleting a single Reaction entity.

func (*ReactionDeleteOne) Exec

func (rdo *ReactionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ReactionDeleteOne) ExecX

func (rdo *ReactionDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReactionDeleteOne) Where

Where appends a list predicates to the ReactionDelete builder.

type ReactionEdges

type ReactionEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// Post holds the value of the post edge.
	Post *Post `json:"post,omitempty"`
	// Comment holds the value of the comment edge.
	Comment *Comment `json:"comment,omitempty"`
	// Reply holds the value of the reply edge.
	Reply *Reply `json:"reply,omitempty"`
	// contains filtered or unexported fields
}

ReactionEdges holds the relations/edges for other nodes in the graph.

func (ReactionEdges) CommentOrErr

func (e ReactionEdges) CommentOrErr() (*Comment, error)

CommentOrErr returns the Comment value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (ReactionEdges) PostOrErr

func (e ReactionEdges) PostOrErr() (*Post, error)

PostOrErr returns the Post value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (ReactionEdges) ReplyOrErr

func (e ReactionEdges) ReplyOrErr() (*Reply, error)

ReplyOrErr returns the Reply value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (ReactionEdges) UserOrErr

func (e ReactionEdges) UserOrErr() (*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type ReactionGroupBy

type ReactionGroupBy struct {
	// contains filtered or unexported fields
}

ReactionGroupBy is the group-by builder for Reaction entities.

func (*ReactionGroupBy) Aggregate

func (rgb *ReactionGroupBy) Aggregate(fns ...AggregateFunc) *ReactionGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ReactionGroupBy) Bool

func (s *ReactionGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ReactionGroupBy) BoolX

func (s *ReactionGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ReactionGroupBy) Bools

func (s *ReactionGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ReactionGroupBy) BoolsX

func (s *ReactionGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ReactionGroupBy) Float64

func (s *ReactionGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ReactionGroupBy) Float64X

func (s *ReactionGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ReactionGroupBy) Float64s

func (s *ReactionGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ReactionGroupBy) Float64sX

func (s *ReactionGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ReactionGroupBy) Int

func (s *ReactionGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ReactionGroupBy) IntX

func (s *ReactionGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ReactionGroupBy) Ints

func (s *ReactionGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ReactionGroupBy) IntsX

func (s *ReactionGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ReactionGroupBy) Scan

func (rgb *ReactionGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ReactionGroupBy) ScanX

func (s *ReactionGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ReactionGroupBy) String

func (s *ReactionGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ReactionGroupBy) StringX

func (s *ReactionGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ReactionGroupBy) Strings

func (s *ReactionGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ReactionGroupBy) StringsX

func (s *ReactionGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ReactionMutation

type ReactionMutation struct {
	// contains filtered or unexported fields
}

ReactionMutation represents an operation that mutates the Reaction nodes in the graph.

func (*ReactionMutation) AddField

func (m *ReactionMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ReactionMutation) AddedEdges

func (m *ReactionMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ReactionMutation) AddedField

func (m *ReactionMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ReactionMutation) AddedFields

func (m *ReactionMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ReactionMutation) AddedIDs

func (m *ReactionMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ReactionMutation) ClearComment

func (m *ReactionMutation) ClearComment()

ClearComment clears the "comment" edge to the Comment entity.

func (*ReactionMutation) ClearCommentID

func (m *ReactionMutation) ClearCommentID()

ClearCommentID clears the value of the "comment_id" field.

func (*ReactionMutation) ClearEdge

func (m *ReactionMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*ReactionMutation) ClearField

func (m *ReactionMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*ReactionMutation) ClearPost

func (m *ReactionMutation) ClearPost()

ClearPost clears the "post" edge to the Post entity.

func (*ReactionMutation) ClearPostID

func (m *ReactionMutation) ClearPostID()

ClearPostID clears the value of the "post_id" field.

func (*ReactionMutation) ClearReply

func (m *ReactionMutation) ClearReply()

ClearReply clears the "reply" edge to the Reply entity.

func (*ReactionMutation) ClearReplyID

func (m *ReactionMutation) ClearReplyID()

ClearReplyID clears the value of the "reply_id" field.

func (*ReactionMutation) ClearUser

func (m *ReactionMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*ReactionMutation) ClearedEdges

func (m *ReactionMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ReactionMutation) ClearedFields

func (m *ReactionMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ReactionMutation) Client

func (m ReactionMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*ReactionMutation) CommentCleared

func (m *ReactionMutation) CommentCleared() bool

CommentCleared reports if the "comment" edge to the Comment entity was cleared.

func (*ReactionMutation) CommentID

func (m *ReactionMutation) CommentID() (r uuid.UUID, exists bool)

CommentID returns the value of the "comment_id" field in the mutation.

func (*ReactionMutation) CommentIDCleared

func (m *ReactionMutation) CommentIDCleared() bool

CommentIDCleared returns if the "comment_id" field was cleared in this mutation.

func (*ReactionMutation) CommentIDs

func (m *ReactionMutation) CommentIDs() (ids []uuid.UUID)

CommentIDs returns the "comment" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CommentID instead. It exists only for internal usage by the builders.

func (*ReactionMutation) CreatedAt

func (m *ReactionMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ReactionMutation) EdgeCleared

func (m *ReactionMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ReactionMutation) Field

func (m *ReactionMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ReactionMutation) FieldCleared

func (m *ReactionMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ReactionMutation) Fields

func (m *ReactionMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*ReactionMutation) ID

func (m *ReactionMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*ReactionMutation) IDs

func (m *ReactionMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*ReactionMutation) OldCommentID

func (m *ReactionMutation) OldCommentID(ctx context.Context) (v *uuid.UUID, err error)

OldCommentID returns the old "comment_id" field's value of the Reaction entity. If the Reaction 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 (*ReactionMutation) OldCreatedAt

func (m *ReactionMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Reaction entity. If the Reaction 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 (*ReactionMutation) OldField

func (m *ReactionMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*ReactionMutation) OldPostID

func (m *ReactionMutation) OldPostID(ctx context.Context) (v *uuid.UUID, err error)

OldPostID returns the old "post_id" field's value of the Reaction entity. If the Reaction 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 (*ReactionMutation) OldReplyID

func (m *ReactionMutation) OldReplyID(ctx context.Context) (v *uuid.UUID, err error)

OldReplyID returns the old "reply_id" field's value of the Reaction entity. If the Reaction 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 (*ReactionMutation) OldRtype

func (m *ReactionMutation) OldRtype(ctx context.Context) (v reaction.Rtype, err error)

OldRtype returns the old "rtype" field's value of the Reaction entity. If the Reaction 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 (*ReactionMutation) OldUpdatedAt

func (m *ReactionMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Reaction entity. If the Reaction 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 (*ReactionMutation) OldUserID

func (m *ReactionMutation) OldUserID(ctx context.Context) (v uuid.UUID, err error)

OldUserID returns the old "user_id" field's value of the Reaction entity. If the Reaction 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 (*ReactionMutation) Op

func (m *ReactionMutation) Op() Op

Op returns the operation name.

func (*ReactionMutation) PostCleared

func (m *ReactionMutation) PostCleared() bool

PostCleared reports if the "post" edge to the Post entity was cleared.

func (*ReactionMutation) PostID

func (m *ReactionMutation) PostID() (r uuid.UUID, exists bool)

PostID returns the value of the "post_id" field in the mutation.

func (*ReactionMutation) PostIDCleared

func (m *ReactionMutation) PostIDCleared() bool

PostIDCleared returns if the "post_id" field was cleared in this mutation.

func (*ReactionMutation) PostIDs

func (m *ReactionMutation) PostIDs() (ids []uuid.UUID)

PostIDs returns the "post" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use PostID instead. It exists only for internal usage by the builders.

func (*ReactionMutation) RemovedEdges

func (m *ReactionMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ReactionMutation) RemovedIDs

func (m *ReactionMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*ReactionMutation) ReplyCleared

func (m *ReactionMutation) ReplyCleared() bool

ReplyCleared reports if the "reply" edge to the Reply entity was cleared.

func (*ReactionMutation) ReplyID

func (m *ReactionMutation) ReplyID() (r uuid.UUID, exists bool)

ReplyID returns the value of the "reply_id" field in the mutation.

func (*ReactionMutation) ReplyIDCleared

func (m *ReactionMutation) ReplyIDCleared() bool

ReplyIDCleared returns if the "reply_id" field was cleared in this mutation.

func (*ReactionMutation) ReplyIDs

func (m *ReactionMutation) ReplyIDs() (ids []uuid.UUID)

ReplyIDs returns the "reply" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ReplyID instead. It exists only for internal usage by the builders.

func (*ReactionMutation) ResetComment

func (m *ReactionMutation) ResetComment()

ResetComment resets all changes to the "comment" edge.

func (*ReactionMutation) ResetCommentID

func (m *ReactionMutation) ResetCommentID()

ResetCommentID resets all changes to the "comment_id" field.

func (*ReactionMutation) ResetCreatedAt

func (m *ReactionMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ReactionMutation) ResetEdge

func (m *ReactionMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*ReactionMutation) ResetField

func (m *ReactionMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*ReactionMutation) ResetPost

func (m *ReactionMutation) ResetPost()

ResetPost resets all changes to the "post" edge.

func (*ReactionMutation) ResetPostID

func (m *ReactionMutation) ResetPostID()

ResetPostID resets all changes to the "post_id" field.

func (*ReactionMutation) ResetReply

func (m *ReactionMutation) ResetReply()

ResetReply resets all changes to the "reply" edge.

func (*ReactionMutation) ResetReplyID

func (m *ReactionMutation) ResetReplyID()

ResetReplyID resets all changes to the "reply_id" field.

func (*ReactionMutation) ResetRtype

func (m *ReactionMutation) ResetRtype()

ResetRtype resets all changes to the "rtype" field.

func (*ReactionMutation) ResetUpdatedAt

func (m *ReactionMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ReactionMutation) ResetUser

func (m *ReactionMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*ReactionMutation) ResetUserID

func (m *ReactionMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*ReactionMutation) Rtype

func (m *ReactionMutation) Rtype() (r reaction.Rtype, exists bool)

Rtype returns the value of the "rtype" field in the mutation.

func (*ReactionMutation) SetCommentID

func (m *ReactionMutation) SetCommentID(u uuid.UUID)

SetCommentID sets the "comment_id" field.

func (*ReactionMutation) SetCreatedAt

func (m *ReactionMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ReactionMutation) SetField

func (m *ReactionMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ReactionMutation) SetID

func (m *ReactionMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Reaction entities.

func (*ReactionMutation) SetOp

func (m *ReactionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ReactionMutation) SetPostID

func (m *ReactionMutation) SetPostID(u uuid.UUID)

SetPostID sets the "post_id" field.

func (*ReactionMutation) SetReplyID

func (m *ReactionMutation) SetReplyID(u uuid.UUID)

SetReplyID sets the "reply_id" field.

func (*ReactionMutation) SetRtype

func (m *ReactionMutation) SetRtype(r reaction.Rtype)

SetRtype sets the "rtype" field.

func (*ReactionMutation) SetUpdatedAt

func (m *ReactionMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*ReactionMutation) SetUserID

func (m *ReactionMutation) SetUserID(u uuid.UUID)

SetUserID sets the "user_id" field.

func (ReactionMutation) Tx

func (m ReactionMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ReactionMutation) Type

func (m *ReactionMutation) Type() string

Type returns the node type of this mutation (Reaction).

func (*ReactionMutation) UpdatedAt

func (m *ReactionMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*ReactionMutation) UserCleared

func (m *ReactionMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*ReactionMutation) UserID

func (m *ReactionMutation) UserID() (r uuid.UUID, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*ReactionMutation) UserIDs

func (m *ReactionMutation) UserIDs() (ids []uuid.UUID)

UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

func (*ReactionMutation) Where

func (m *ReactionMutation) Where(ps ...predicate.Reaction)

Where appends a list predicates to the ReactionMutation builder.

func (*ReactionMutation) WhereP

func (m *ReactionMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ReactionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ReactionQuery

type ReactionQuery struct {
	// contains filtered or unexported fields
}

ReactionQuery is the builder for querying Reaction entities.

func (*ReactionQuery) Aggregate

func (rq *ReactionQuery) Aggregate(fns ...AggregateFunc) *ReactionSelect

Aggregate returns a ReactionSelect configured with the given aggregations.

func (*ReactionQuery) All

func (rq *ReactionQuery) All(ctx context.Context) ([]*Reaction, error)

All executes the query and returns a list of Reactions.

func (*ReactionQuery) AllX

func (rq *ReactionQuery) AllX(ctx context.Context) []*Reaction

AllX is like All, but panics if an error occurs.

func (*ReactionQuery) Clone

func (rq *ReactionQuery) Clone() *ReactionQuery

Clone returns a duplicate of the ReactionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ReactionQuery) Count

func (rq *ReactionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ReactionQuery) CountX

func (rq *ReactionQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ReactionQuery) Exist

func (rq *ReactionQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ReactionQuery) ExistX

func (rq *ReactionQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ReactionQuery) First

func (rq *ReactionQuery) First(ctx context.Context) (*Reaction, error)

First returns the first Reaction entity from the query. Returns a *NotFoundError when no Reaction was found.

func (*ReactionQuery) FirstID

func (rq *ReactionQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Reaction ID from the query. Returns a *NotFoundError when no Reaction ID was found.

func (*ReactionQuery) FirstIDX

func (rq *ReactionQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*ReactionQuery) FirstX

func (rq *ReactionQuery) FirstX(ctx context.Context) *Reaction

FirstX is like First, but panics if an error occurs.

func (*ReactionQuery) GroupBy

func (rq *ReactionQuery) GroupBy(field string, fields ...string) *ReactionGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Reaction.Query().
	GroupBy(reaction.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ReactionQuery) IDs

func (rq *ReactionQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Reaction IDs.

func (*ReactionQuery) IDsX

func (rq *ReactionQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*ReactionQuery) Limit

func (rq *ReactionQuery) Limit(limit int) *ReactionQuery

Limit the number of records to be returned by this query.

func (*ReactionQuery) Offset

func (rq *ReactionQuery) Offset(offset int) *ReactionQuery

Offset to start from.

func (*ReactionQuery) Only

func (rq *ReactionQuery) Only(ctx context.Context) (*Reaction, error)

Only returns a single Reaction entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Reaction entity is found. Returns a *NotFoundError when no Reaction entities are found.

func (*ReactionQuery) OnlyID

func (rq *ReactionQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Reaction ID in the query. Returns a *NotSingularError when more than one Reaction ID is found. Returns a *NotFoundError when no entities are found.

func (*ReactionQuery) OnlyIDX

func (rq *ReactionQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ReactionQuery) OnlyX

func (rq *ReactionQuery) OnlyX(ctx context.Context) *Reaction

OnlyX is like Only, but panics if an error occurs.

func (*ReactionQuery) Order

Order specifies how the records should be ordered.

func (*ReactionQuery) QueryComment

func (rq *ReactionQuery) QueryComment() *CommentQuery

QueryComment chains the current query on the "comment" edge.

func (*ReactionQuery) QueryPost

func (rq *ReactionQuery) QueryPost() *PostQuery

QueryPost chains the current query on the "post" edge.

func (*ReactionQuery) QueryReply

func (rq *ReactionQuery) QueryReply() *ReplyQuery

QueryReply chains the current query on the "reply" edge.

func (*ReactionQuery) QueryUser

func (rq *ReactionQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*ReactionQuery) Select

func (rq *ReactionQuery) Select(fields ...string) *ReactionSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Reaction.Query().
	Select(reaction.FieldCreatedAt).
	Scan(ctx, &v)

func (*ReactionQuery) Unique

func (rq *ReactionQuery) Unique(unique bool) *ReactionQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*ReactionQuery) Where

func (rq *ReactionQuery) Where(ps ...predicate.Reaction) *ReactionQuery

Where adds a new predicate for the ReactionQuery builder.

func (*ReactionQuery) WithComment

func (rq *ReactionQuery) WithComment(opts ...func(*CommentQuery)) *ReactionQuery

WithComment tells the query-builder to eager-load the nodes that are connected to the "comment" edge. The optional arguments are used to configure the query builder of the edge.

func (*ReactionQuery) WithPost

func (rq *ReactionQuery) WithPost(opts ...func(*PostQuery)) *ReactionQuery

WithPost tells the query-builder to eager-load the nodes that are connected to the "post" edge. The optional arguments are used to configure the query builder of the edge.

func (*ReactionQuery) WithReply

func (rq *ReactionQuery) WithReply(opts ...func(*ReplyQuery)) *ReactionQuery

WithReply tells the query-builder to eager-load the nodes that are connected to the "reply" edge. The optional arguments are used to configure the query builder of the edge.

func (*ReactionQuery) WithUser

func (rq *ReactionQuery) WithUser(opts ...func(*UserQuery)) *ReactionQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type ReactionSelect

type ReactionSelect struct {
	*ReactionQuery
	// contains filtered or unexported fields
}

ReactionSelect is the builder for selecting fields of Reaction entities.

func (*ReactionSelect) Aggregate

func (rs *ReactionSelect) Aggregate(fns ...AggregateFunc) *ReactionSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ReactionSelect) Bool

func (s *ReactionSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ReactionSelect) BoolX

func (s *ReactionSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ReactionSelect) Bools

func (s *ReactionSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ReactionSelect) BoolsX

func (s *ReactionSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ReactionSelect) Float64

func (s *ReactionSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ReactionSelect) Float64X

func (s *ReactionSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ReactionSelect) Float64s

func (s *ReactionSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ReactionSelect) Float64sX

func (s *ReactionSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ReactionSelect) Int

func (s *ReactionSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ReactionSelect) IntX

func (s *ReactionSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ReactionSelect) Ints

func (s *ReactionSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ReactionSelect) IntsX

func (s *ReactionSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ReactionSelect) Scan

func (rs *ReactionSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ReactionSelect) ScanX

func (s *ReactionSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ReactionSelect) String

func (s *ReactionSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ReactionSelect) StringX

func (s *ReactionSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ReactionSelect) Strings

func (s *ReactionSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ReactionSelect) StringsX

func (s *ReactionSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ReactionUpdate

type ReactionUpdate struct {
	// contains filtered or unexported fields
}

ReactionUpdate is the builder for updating Reaction entities.

func (*ReactionUpdate) ClearComment

func (ru *ReactionUpdate) ClearComment() *ReactionUpdate

ClearComment clears the "comment" edge to the Comment entity.

func (*ReactionUpdate) ClearCommentID

func (ru *ReactionUpdate) ClearCommentID() *ReactionUpdate

ClearCommentID clears the value of the "comment_id" field.

func (*ReactionUpdate) ClearPost

func (ru *ReactionUpdate) ClearPost() *ReactionUpdate

ClearPost clears the "post" edge to the Post entity.

func (*ReactionUpdate) ClearPostID

func (ru *ReactionUpdate) ClearPostID() *ReactionUpdate

ClearPostID clears the value of the "post_id" field.

func (*ReactionUpdate) ClearReply

func (ru *ReactionUpdate) ClearReply() *ReactionUpdate

ClearReply clears the "reply" edge to the Reply entity.

func (*ReactionUpdate) ClearReplyID

func (ru *ReactionUpdate) ClearReplyID() *ReactionUpdate

ClearReplyID clears the value of the "reply_id" field.

func (*ReactionUpdate) ClearUser

func (ru *ReactionUpdate) ClearUser() *ReactionUpdate

ClearUser clears the "user" edge to the User entity.

func (*ReactionUpdate) Exec

func (ru *ReactionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ReactionUpdate) ExecX

func (ru *ReactionUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReactionUpdate) Mutation

func (ru *ReactionUpdate) Mutation() *ReactionMutation

Mutation returns the ReactionMutation object of the builder.

func (*ReactionUpdate) Save

func (ru *ReactionUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ReactionUpdate) SaveX

func (ru *ReactionUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ReactionUpdate) SetComment

func (ru *ReactionUpdate) SetComment(c *Comment) *ReactionUpdate

SetComment sets the "comment" edge to the Comment entity.

func (*ReactionUpdate) SetCommentID

func (ru *ReactionUpdate) SetCommentID(u uuid.UUID) *ReactionUpdate

SetCommentID sets the "comment_id" field.

func (*ReactionUpdate) SetCreatedAt

func (ru *ReactionUpdate) SetCreatedAt(t time.Time) *ReactionUpdate

SetCreatedAt sets the "created_at" field.

func (*ReactionUpdate) SetNillableCommentID

func (ru *ReactionUpdate) SetNillableCommentID(u *uuid.UUID) *ReactionUpdate

SetNillableCommentID sets the "comment_id" field if the given value is not nil.

func (*ReactionUpdate) SetNillableCreatedAt

func (ru *ReactionUpdate) SetNillableCreatedAt(t *time.Time) *ReactionUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ReactionUpdate) SetNillablePostID

func (ru *ReactionUpdate) SetNillablePostID(u *uuid.UUID) *ReactionUpdate

SetNillablePostID sets the "post_id" field if the given value is not nil.

func (*ReactionUpdate) SetNillableReplyID

func (ru *ReactionUpdate) SetNillableReplyID(u *uuid.UUID) *ReactionUpdate

SetNillableReplyID sets the "reply_id" field if the given value is not nil.

func (*ReactionUpdate) SetNillableRtype

func (ru *ReactionUpdate) SetNillableRtype(r *reaction.Rtype) *ReactionUpdate

SetNillableRtype sets the "rtype" field if the given value is not nil.

func (*ReactionUpdate) SetNillableUserID

func (ru *ReactionUpdate) SetNillableUserID(u *uuid.UUID) *ReactionUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*ReactionUpdate) SetPost

func (ru *ReactionUpdate) SetPost(p *Post) *ReactionUpdate

SetPost sets the "post" edge to the Post entity.

func (*ReactionUpdate) SetPostID

func (ru *ReactionUpdate) SetPostID(u uuid.UUID) *ReactionUpdate

SetPostID sets the "post_id" field.

func (*ReactionUpdate) SetReply

func (ru *ReactionUpdate) SetReply(r *Reply) *ReactionUpdate

SetReply sets the "reply" edge to the Reply entity.

func (*ReactionUpdate) SetReplyID

func (ru *ReactionUpdate) SetReplyID(u uuid.UUID) *ReactionUpdate

SetReplyID sets the "reply_id" field.

func (*ReactionUpdate) SetRtype

func (ru *ReactionUpdate) SetRtype(r reaction.Rtype) *ReactionUpdate

SetRtype sets the "rtype" field.

func (*ReactionUpdate) SetUpdatedAt

func (ru *ReactionUpdate) SetUpdatedAt(t time.Time) *ReactionUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ReactionUpdate) SetUser

func (ru *ReactionUpdate) SetUser(u *User) *ReactionUpdate

SetUser sets the "user" edge to the User entity.

func (*ReactionUpdate) SetUserID

func (ru *ReactionUpdate) SetUserID(u uuid.UUID) *ReactionUpdate

SetUserID sets the "user_id" field.

func (*ReactionUpdate) Where

func (ru *ReactionUpdate) Where(ps ...predicate.Reaction) *ReactionUpdate

Where appends a list predicates to the ReactionUpdate builder.

type ReactionUpdateOne

type ReactionUpdateOne struct {
	// contains filtered or unexported fields
}

ReactionUpdateOne is the builder for updating a single Reaction entity.

func (*ReactionUpdateOne) ClearComment

func (ruo *ReactionUpdateOne) ClearComment() *ReactionUpdateOne

ClearComment clears the "comment" edge to the Comment entity.

func (*ReactionUpdateOne) ClearCommentID

func (ruo *ReactionUpdateOne) ClearCommentID() *ReactionUpdateOne

ClearCommentID clears the value of the "comment_id" field.

func (*ReactionUpdateOne) ClearPost

func (ruo *ReactionUpdateOne) ClearPost() *ReactionUpdateOne

ClearPost clears the "post" edge to the Post entity.

func (*ReactionUpdateOne) ClearPostID

func (ruo *ReactionUpdateOne) ClearPostID() *ReactionUpdateOne

ClearPostID clears the value of the "post_id" field.

func (*ReactionUpdateOne) ClearReply

func (ruo *ReactionUpdateOne) ClearReply() *ReactionUpdateOne

ClearReply clears the "reply" edge to the Reply entity.

func (*ReactionUpdateOne) ClearReplyID

func (ruo *ReactionUpdateOne) ClearReplyID() *ReactionUpdateOne

ClearReplyID clears the value of the "reply_id" field.

func (*ReactionUpdateOne) ClearUser

func (ruo *ReactionUpdateOne) ClearUser() *ReactionUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*ReactionUpdateOne) Exec

func (ruo *ReactionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ReactionUpdateOne) ExecX

func (ruo *ReactionUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReactionUpdateOne) Mutation

func (ruo *ReactionUpdateOne) Mutation() *ReactionMutation

Mutation returns the ReactionMutation object of the builder.

func (*ReactionUpdateOne) Save

func (ruo *ReactionUpdateOne) Save(ctx context.Context) (*Reaction, error)

Save executes the query and returns the updated Reaction entity.

func (*ReactionUpdateOne) SaveX

func (ruo *ReactionUpdateOne) SaveX(ctx context.Context) *Reaction

SaveX is like Save, but panics if an error occurs.

func (*ReactionUpdateOne) Select

func (ruo *ReactionUpdateOne) Select(field string, fields ...string) *ReactionUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ReactionUpdateOne) SetComment

func (ruo *ReactionUpdateOne) SetComment(c *Comment) *ReactionUpdateOne

SetComment sets the "comment" edge to the Comment entity.

func (*ReactionUpdateOne) SetCommentID

func (ruo *ReactionUpdateOne) SetCommentID(u uuid.UUID) *ReactionUpdateOne

SetCommentID sets the "comment_id" field.

func (*ReactionUpdateOne) SetCreatedAt

func (ruo *ReactionUpdateOne) SetCreatedAt(t time.Time) *ReactionUpdateOne

SetCreatedAt sets the "created_at" field.

func (*ReactionUpdateOne) SetNillableCommentID

func (ruo *ReactionUpdateOne) SetNillableCommentID(u *uuid.UUID) *ReactionUpdateOne

SetNillableCommentID sets the "comment_id" field if the given value is not nil.

func (*ReactionUpdateOne) SetNillableCreatedAt

func (ruo *ReactionUpdateOne) SetNillableCreatedAt(t *time.Time) *ReactionUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ReactionUpdateOne) SetNillablePostID

func (ruo *ReactionUpdateOne) SetNillablePostID(u *uuid.UUID) *ReactionUpdateOne

SetNillablePostID sets the "post_id" field if the given value is not nil.

func (*ReactionUpdateOne) SetNillableReplyID

func (ruo *ReactionUpdateOne) SetNillableReplyID(u *uuid.UUID) *ReactionUpdateOne

SetNillableReplyID sets the "reply_id" field if the given value is not nil.

func (*ReactionUpdateOne) SetNillableRtype

func (ruo *ReactionUpdateOne) SetNillableRtype(r *reaction.Rtype) *ReactionUpdateOne

SetNillableRtype sets the "rtype" field if the given value is not nil.

func (*ReactionUpdateOne) SetNillableUserID

func (ruo *ReactionUpdateOne) SetNillableUserID(u *uuid.UUID) *ReactionUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*ReactionUpdateOne) SetPost

func (ruo *ReactionUpdateOne) SetPost(p *Post) *ReactionUpdateOne

SetPost sets the "post" edge to the Post entity.

func (*ReactionUpdateOne) SetPostID

func (ruo *ReactionUpdateOne) SetPostID(u uuid.UUID) *ReactionUpdateOne

SetPostID sets the "post_id" field.

func (*ReactionUpdateOne) SetReply

func (ruo *ReactionUpdateOne) SetReply(r *Reply) *ReactionUpdateOne

SetReply sets the "reply" edge to the Reply entity.

func (*ReactionUpdateOne) SetReplyID

func (ruo *ReactionUpdateOne) SetReplyID(u uuid.UUID) *ReactionUpdateOne

SetReplyID sets the "reply_id" field.

func (*ReactionUpdateOne) SetRtype

SetRtype sets the "rtype" field.

func (*ReactionUpdateOne) SetUpdatedAt

func (ruo *ReactionUpdateOne) SetUpdatedAt(t time.Time) *ReactionUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ReactionUpdateOne) SetUser

func (ruo *ReactionUpdateOne) SetUser(u *User) *ReactionUpdateOne

SetUser sets the "user" edge to the User entity.

func (*ReactionUpdateOne) SetUserID

func (ruo *ReactionUpdateOne) SetUserID(u uuid.UUID) *ReactionUpdateOne

SetUserID sets the "user_id" field.

func (*ReactionUpdateOne) Where

Where appends a list predicates to the ReactionUpdate builder.

type Reactions

type Reactions []*Reaction

Reactions is a parsable slice of Reaction.

type Region

type Region struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// CountryID holds the value of the "country_id" field.
	CountryID uuid.UUID `json:"country_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the RegionQuery when eager-loading is set.
	Edges RegionEdges `json:"edges"`
	// contains filtered or unexported fields
}

Region is the model entity for the Region schema.

func (*Region) QueryCities

func (r *Region) QueryCities() *CityQuery

QueryCities queries the "cities" edge of the Region entity.

func (*Region) QueryCountry

func (r *Region) QueryCountry() *CountryQuery

QueryCountry queries the "country" edge of the Region entity.

func (*Region) String

func (r *Region) String() string

String implements the fmt.Stringer.

func (*Region) Unwrap

func (r *Region) Unwrap() *Region

Unwrap unwraps the Region 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 (*Region) Update

func (r *Region) Update() *RegionUpdateOne

Update returns a builder for updating this Region. Note that you need to call Region.Unwrap() before calling this method if this Region was returned from a transaction, and the transaction was committed or rolled back.

func (*Region) Value

func (r *Region) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Region. This includes values selected through modifiers, order, etc.

type RegionClient

type RegionClient struct {
	// contains filtered or unexported fields
}

RegionClient is a client for the Region schema.

func NewRegionClient

func NewRegionClient(c config) *RegionClient

NewRegionClient returns a client for the Region from the given config.

func (*RegionClient) Create

func (c *RegionClient) Create() *RegionCreate

Create returns a builder for creating a Region entity.

func (*RegionClient) CreateBulk

func (c *RegionClient) CreateBulk(builders ...*RegionCreate) *RegionCreateBulk

CreateBulk returns a builder for creating a bulk of Region entities.

func (*RegionClient) Delete

func (c *RegionClient) Delete() *RegionDelete

Delete returns a delete builder for Region.

func (*RegionClient) DeleteOne

func (c *RegionClient) DeleteOne(r *Region) *RegionDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*RegionClient) DeleteOneID

func (c *RegionClient) DeleteOneID(id uuid.UUID) *RegionDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*RegionClient) Get

func (c *RegionClient) Get(ctx context.Context, id uuid.UUID) (*Region, error)

Get returns a Region entity by its id.

func (*RegionClient) GetX

func (c *RegionClient) GetX(ctx context.Context, id uuid.UUID) *Region

GetX is like Get, but panics if an error occurs.

func (*RegionClient) Hooks

func (c *RegionClient) Hooks() []Hook

Hooks returns the client hooks.

func (*RegionClient) Intercept

func (c *RegionClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `region.Intercept(f(g(h())))`.

func (*RegionClient) Interceptors

func (c *RegionClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*RegionClient) MapCreateBulk

func (c *RegionClient) MapCreateBulk(slice any, setFunc func(*RegionCreate, int)) *RegionCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*RegionClient) Query

func (c *RegionClient) Query() *RegionQuery

Query returns a query builder for Region.

func (*RegionClient) QueryCities

func (c *RegionClient) QueryCities(r *Region) *CityQuery

QueryCities queries the cities edge of a Region.

func (*RegionClient) QueryCountry

func (c *RegionClient) QueryCountry(r *Region) *CountryQuery

QueryCountry queries the country edge of a Region.

func (*RegionClient) Update

func (c *RegionClient) Update() *RegionUpdate

Update returns an update builder for Region.

func (*RegionClient) UpdateOne

func (c *RegionClient) UpdateOne(r *Region) *RegionUpdateOne

UpdateOne returns an update builder for the given entity.

func (*RegionClient) UpdateOneID

func (c *RegionClient) UpdateOneID(id uuid.UUID) *RegionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*RegionClient) Use

func (c *RegionClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `region.Hooks(f(g(h())))`.

type RegionCreate

type RegionCreate struct {
	// contains filtered or unexported fields
}

RegionCreate is the builder for creating a Region entity.

func (*RegionCreate) AddCities

func (rc *RegionCreate) AddCities(c ...*City) *RegionCreate

AddCities adds the "cities" edges to the City entity.

func (*RegionCreate) AddCityIDs

func (rc *RegionCreate) AddCityIDs(ids ...uuid.UUID) *RegionCreate

AddCityIDs adds the "cities" edge to the City entity by IDs.

func (*RegionCreate) Exec

func (rc *RegionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*RegionCreate) ExecX

func (rc *RegionCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RegionCreate) Mutation

func (rc *RegionCreate) Mutation() *RegionMutation

Mutation returns the RegionMutation object of the builder.

func (*RegionCreate) Save

func (rc *RegionCreate) Save(ctx context.Context) (*Region, error)

Save creates the Region in the database.

func (*RegionCreate) SaveX

func (rc *RegionCreate) SaveX(ctx context.Context) *Region

SaveX calls Save and panics if Save returns an error.

func (*RegionCreate) SetCountry

func (rc *RegionCreate) SetCountry(c *Country) *RegionCreate

SetCountry sets the "country" edge to the Country entity.

func (*RegionCreate) SetCountryID

func (rc *RegionCreate) SetCountryID(u uuid.UUID) *RegionCreate

SetCountryID sets the "country_id" field.

func (*RegionCreate) SetCreatedAt

func (rc *RegionCreate) SetCreatedAt(t time.Time) *RegionCreate

SetCreatedAt sets the "created_at" field.

func (*RegionCreate) SetID

func (rc *RegionCreate) SetID(u uuid.UUID) *RegionCreate

SetID sets the "id" field.

func (*RegionCreate) SetName

func (rc *RegionCreate) SetName(s string) *RegionCreate

SetName sets the "name" field.

func (*RegionCreate) SetNillableCreatedAt

func (rc *RegionCreate) SetNillableCreatedAt(t *time.Time) *RegionCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*RegionCreate) SetNillableID

func (rc *RegionCreate) SetNillableID(u *uuid.UUID) *RegionCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*RegionCreate) SetNillableUpdatedAt

func (rc *RegionCreate) SetNillableUpdatedAt(t *time.Time) *RegionCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*RegionCreate) SetUpdatedAt

func (rc *RegionCreate) SetUpdatedAt(t time.Time) *RegionCreate

SetUpdatedAt sets the "updated_at" field.

type RegionCreateBulk

type RegionCreateBulk struct {
	// contains filtered or unexported fields
}

RegionCreateBulk is the builder for creating many Region entities in bulk.

func (*RegionCreateBulk) Exec

func (rcb *RegionCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*RegionCreateBulk) ExecX

func (rcb *RegionCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RegionCreateBulk) Save

func (rcb *RegionCreateBulk) Save(ctx context.Context) ([]*Region, error)

Save creates the Region entities in the database.

func (*RegionCreateBulk) SaveX

func (rcb *RegionCreateBulk) SaveX(ctx context.Context) []*Region

SaveX is like Save, but panics if an error occurs.

type RegionDelete

type RegionDelete struct {
	// contains filtered or unexported fields
}

RegionDelete is the builder for deleting a Region entity.

func (*RegionDelete) Exec

func (rd *RegionDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*RegionDelete) ExecX

func (rd *RegionDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*RegionDelete) Where

func (rd *RegionDelete) Where(ps ...predicate.Region) *RegionDelete

Where appends a list predicates to the RegionDelete builder.

type RegionDeleteOne

type RegionDeleteOne struct {
	// contains filtered or unexported fields
}

RegionDeleteOne is the builder for deleting a single Region entity.

func (*RegionDeleteOne) Exec

func (rdo *RegionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*RegionDeleteOne) ExecX

func (rdo *RegionDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RegionDeleteOne) Where

func (rdo *RegionDeleteOne) Where(ps ...predicate.Region) *RegionDeleteOne

Where appends a list predicates to the RegionDelete builder.

type RegionEdges

type RegionEdges struct {
	// Country holds the value of the country edge.
	Country *Country `json:"country,omitempty"`
	// Cities holds the value of the cities edge.
	Cities []*City `json:"cities,omitempty"`
	// contains filtered or unexported fields
}

RegionEdges holds the relations/edges for other nodes in the graph.

func (RegionEdges) CitiesOrErr

func (e RegionEdges) CitiesOrErr() ([]*City, error)

CitiesOrErr returns the Cities value or an error if the edge was not loaded in eager-loading.

func (RegionEdges) CountryOrErr

func (e RegionEdges) CountryOrErr() (*Country, error)

CountryOrErr returns the Country value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type RegionGroupBy

type RegionGroupBy struct {
	// contains filtered or unexported fields
}

RegionGroupBy is the group-by builder for Region entities.

func (*RegionGroupBy) Aggregate

func (rgb *RegionGroupBy) Aggregate(fns ...AggregateFunc) *RegionGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*RegionGroupBy) Bool

func (s *RegionGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RegionGroupBy) BoolX

func (s *RegionGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RegionGroupBy) Bools

func (s *RegionGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RegionGroupBy) BoolsX

func (s *RegionGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RegionGroupBy) Float64

func (s *RegionGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RegionGroupBy) Float64X

func (s *RegionGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RegionGroupBy) Float64s

func (s *RegionGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RegionGroupBy) Float64sX

func (s *RegionGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RegionGroupBy) Int

func (s *RegionGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RegionGroupBy) IntX

func (s *RegionGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RegionGroupBy) Ints

func (s *RegionGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RegionGroupBy) IntsX

func (s *RegionGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RegionGroupBy) Scan

func (rgb *RegionGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*RegionGroupBy) ScanX

func (s *RegionGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*RegionGroupBy) String

func (s *RegionGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RegionGroupBy) StringX

func (s *RegionGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RegionGroupBy) Strings

func (s *RegionGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RegionGroupBy) StringsX

func (s *RegionGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RegionMutation

type RegionMutation struct {
	// contains filtered or unexported fields
}

RegionMutation represents an operation that mutates the Region nodes in the graph.

func (*RegionMutation) AddCityIDs

func (m *RegionMutation) AddCityIDs(ids ...uuid.UUID)

AddCityIDs adds the "cities" edge to the City entity by ids.

func (*RegionMutation) AddField

func (m *RegionMutation) 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 (*RegionMutation) AddedEdges

func (m *RegionMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*RegionMutation) AddedField

func (m *RegionMutation) 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 (*RegionMutation) AddedFields

func (m *RegionMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*RegionMutation) AddedIDs

func (m *RegionMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*RegionMutation) CitiesCleared

func (m *RegionMutation) CitiesCleared() bool

CitiesCleared reports if the "cities" edge to the City entity was cleared.

func (*RegionMutation) CitiesIDs

func (m *RegionMutation) CitiesIDs() (ids []uuid.UUID)

CitiesIDs returns the "cities" edge IDs in the mutation.

func (*RegionMutation) ClearCities

func (m *RegionMutation) ClearCities()

ClearCities clears the "cities" edge to the City entity.

func (*RegionMutation) ClearCountry

func (m *RegionMutation) ClearCountry()

ClearCountry clears the "country" edge to the Country entity.

func (*RegionMutation) ClearEdge

func (m *RegionMutation) 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 (*RegionMutation) ClearField

func (m *RegionMutation) 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 (*RegionMutation) ClearedEdges

func (m *RegionMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*RegionMutation) ClearedFields

func (m *RegionMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (RegionMutation) Client

func (m RegionMutation) 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 (*RegionMutation) CountryCleared

func (m *RegionMutation) CountryCleared() bool

CountryCleared reports if the "country" edge to the Country entity was cleared.

func (*RegionMutation) CountryID

func (m *RegionMutation) CountryID() (r uuid.UUID, exists bool)

CountryID returns the value of the "country_id" field in the mutation.

func (*RegionMutation) CountryIDs

func (m *RegionMutation) CountryIDs() (ids []uuid.UUID)

CountryIDs returns the "country" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CountryID instead. It exists only for internal usage by the builders.

func (*RegionMutation) CreatedAt

func (m *RegionMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*RegionMutation) EdgeCleared

func (m *RegionMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*RegionMutation) Field

func (m *RegionMutation) 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 (*RegionMutation) FieldCleared

func (m *RegionMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*RegionMutation) Fields

func (m *RegionMutation) 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 (*RegionMutation) ID

func (m *RegionMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*RegionMutation) IDs

func (m *RegionMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*RegionMutation) Name

func (m *RegionMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*RegionMutation) OldCountryID

func (m *RegionMutation) OldCountryID(ctx context.Context) (v uuid.UUID, err error)

OldCountryID returns the old "country_id" field's value of the Region entity. If the Region 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 (*RegionMutation) OldCreatedAt

func (m *RegionMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Region entity. If the Region 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 (*RegionMutation) OldField

func (m *RegionMutation) 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 (*RegionMutation) OldName

func (m *RegionMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Region entity. If the Region 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 (*RegionMutation) OldUpdatedAt

func (m *RegionMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Region entity. If the Region 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 (*RegionMutation) Op

func (m *RegionMutation) Op() Op

Op returns the operation name.

func (*RegionMutation) RemoveCityIDs

func (m *RegionMutation) RemoveCityIDs(ids ...uuid.UUID)

RemoveCityIDs removes the "cities" edge to the City entity by IDs.

func (*RegionMutation) RemovedCitiesIDs

func (m *RegionMutation) RemovedCitiesIDs() (ids []uuid.UUID)

RemovedCities returns the removed IDs of the "cities" edge to the City entity.

func (*RegionMutation) RemovedEdges

func (m *RegionMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*RegionMutation) RemovedIDs

func (m *RegionMutation) 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 (*RegionMutation) ResetCities

func (m *RegionMutation) ResetCities()

ResetCities resets all changes to the "cities" edge.

func (*RegionMutation) ResetCountry

func (m *RegionMutation) ResetCountry()

ResetCountry resets all changes to the "country" edge.

func (*RegionMutation) ResetCountryID

func (m *RegionMutation) ResetCountryID()

ResetCountryID resets all changes to the "country_id" field.

func (*RegionMutation) ResetCreatedAt

func (m *RegionMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*RegionMutation) ResetEdge

func (m *RegionMutation) 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 (*RegionMutation) ResetField

func (m *RegionMutation) 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 (*RegionMutation) ResetName

func (m *RegionMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*RegionMutation) ResetUpdatedAt

func (m *RegionMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*RegionMutation) SetCountryID

func (m *RegionMutation) SetCountryID(u uuid.UUID)

SetCountryID sets the "country_id" field.

func (*RegionMutation) SetCreatedAt

func (m *RegionMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*RegionMutation) SetField

func (m *RegionMutation) 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 (*RegionMutation) SetID

func (m *RegionMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Region entities.

func (*RegionMutation) SetName

func (m *RegionMutation) SetName(s string)

SetName sets the "name" field.

func (*RegionMutation) SetOp

func (m *RegionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*RegionMutation) SetUpdatedAt

func (m *RegionMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (RegionMutation) Tx

func (m RegionMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*RegionMutation) Type

func (m *RegionMutation) Type() string

Type returns the node type of this mutation (Region).

func (*RegionMutation) UpdatedAt

func (m *RegionMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*RegionMutation) Where

func (m *RegionMutation) Where(ps ...predicate.Region)

Where appends a list predicates to the RegionMutation builder.

func (*RegionMutation) WhereP

func (m *RegionMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the RegionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type RegionQuery

type RegionQuery struct {
	// contains filtered or unexported fields
}

RegionQuery is the builder for querying Region entities.

func (*RegionQuery) Aggregate

func (rq *RegionQuery) Aggregate(fns ...AggregateFunc) *RegionSelect

Aggregate returns a RegionSelect configured with the given aggregations.

func (*RegionQuery) All

func (rq *RegionQuery) All(ctx context.Context) ([]*Region, error)

All executes the query and returns a list of Regions.

func (*RegionQuery) AllX

func (rq *RegionQuery) AllX(ctx context.Context) []*Region

AllX is like All, but panics if an error occurs.

func (*RegionQuery) Clone

func (rq *RegionQuery) Clone() *RegionQuery

Clone returns a duplicate of the RegionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*RegionQuery) Count

func (rq *RegionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RegionQuery) CountX

func (rq *RegionQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*RegionQuery) Exist

func (rq *RegionQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*RegionQuery) ExistX

func (rq *RegionQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*RegionQuery) First

func (rq *RegionQuery) First(ctx context.Context) (*Region, error)

First returns the first Region entity from the query. Returns a *NotFoundError when no Region was found.

func (*RegionQuery) FirstID

func (rq *RegionQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Region ID from the query. Returns a *NotFoundError when no Region ID was found.

func (*RegionQuery) FirstIDX

func (rq *RegionQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*RegionQuery) FirstX

func (rq *RegionQuery) FirstX(ctx context.Context) *Region

FirstX is like First, but panics if an error occurs.

func (*RegionQuery) GroupBy

func (rq *RegionQuery) GroupBy(field string, fields ...string) *RegionGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Region.Query().
	GroupBy(region.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*RegionQuery) IDs

func (rq *RegionQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Region IDs.

func (*RegionQuery) IDsX

func (rq *RegionQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*RegionQuery) Limit

func (rq *RegionQuery) Limit(limit int) *RegionQuery

Limit the number of records to be returned by this query.

func (*RegionQuery) Offset

func (rq *RegionQuery) Offset(offset int) *RegionQuery

Offset to start from.

func (*RegionQuery) Only

func (rq *RegionQuery) Only(ctx context.Context) (*Region, error)

Only returns a single Region entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Region entity is found. Returns a *NotFoundError when no Region entities are found.

func (*RegionQuery) OnlyID

func (rq *RegionQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Region ID in the query. Returns a *NotSingularError when more than one Region ID is found. Returns a *NotFoundError when no entities are found.

func (*RegionQuery) OnlyIDX

func (rq *RegionQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*RegionQuery) OnlyX

func (rq *RegionQuery) OnlyX(ctx context.Context) *Region

OnlyX is like Only, but panics if an error occurs.

func (*RegionQuery) Order

func (rq *RegionQuery) Order(o ...region.OrderOption) *RegionQuery

Order specifies how the records should be ordered.

func (*RegionQuery) QueryCities

func (rq *RegionQuery) QueryCities() *CityQuery

QueryCities chains the current query on the "cities" edge.

func (*RegionQuery) QueryCountry

func (rq *RegionQuery) QueryCountry() *CountryQuery

QueryCountry chains the current query on the "country" edge.

func (*RegionQuery) Select

func (rq *RegionQuery) Select(fields ...string) *RegionSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Region.Query().
	Select(region.FieldCreatedAt).
	Scan(ctx, &v)

func (*RegionQuery) Unique

func (rq *RegionQuery) Unique(unique bool) *RegionQuery

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 (*RegionQuery) Where

func (rq *RegionQuery) Where(ps ...predicate.Region) *RegionQuery

Where adds a new predicate for the RegionQuery builder.

func (*RegionQuery) WithCities

func (rq *RegionQuery) WithCities(opts ...func(*CityQuery)) *RegionQuery

WithCities tells the query-builder to eager-load the nodes that are connected to the "cities" edge. The optional arguments are used to configure the query builder of the edge.

func (*RegionQuery) WithCountry

func (rq *RegionQuery) WithCountry(opts ...func(*CountryQuery)) *RegionQuery

WithCountry tells the query-builder to eager-load the nodes that are connected to the "country" edge. The optional arguments are used to configure the query builder of the edge.

type RegionSelect

type RegionSelect struct {
	*RegionQuery
	// contains filtered or unexported fields
}

RegionSelect is the builder for selecting fields of Region entities.

func (*RegionSelect) Aggregate

func (rs *RegionSelect) Aggregate(fns ...AggregateFunc) *RegionSelect

Aggregate adds the given aggregation functions to the selector query.

func (*RegionSelect) Bool

func (s *RegionSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RegionSelect) BoolX

func (s *RegionSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RegionSelect) Bools

func (s *RegionSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RegionSelect) BoolsX

func (s *RegionSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RegionSelect) Float64

func (s *RegionSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RegionSelect) Float64X

func (s *RegionSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RegionSelect) Float64s

func (s *RegionSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RegionSelect) Float64sX

func (s *RegionSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RegionSelect) Int

func (s *RegionSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RegionSelect) IntX

func (s *RegionSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RegionSelect) Ints

func (s *RegionSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RegionSelect) IntsX

func (s *RegionSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RegionSelect) Scan

func (rs *RegionSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*RegionSelect) ScanX

func (s *RegionSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*RegionSelect) String

func (s *RegionSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RegionSelect) StringX

func (s *RegionSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RegionSelect) Strings

func (s *RegionSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RegionSelect) StringsX

func (s *RegionSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RegionUpdate

type RegionUpdate struct {
	// contains filtered or unexported fields
}

RegionUpdate is the builder for updating Region entities.

func (*RegionUpdate) AddCities

func (ru *RegionUpdate) AddCities(c ...*City) *RegionUpdate

AddCities adds the "cities" edges to the City entity.

func (*RegionUpdate) AddCityIDs

func (ru *RegionUpdate) AddCityIDs(ids ...uuid.UUID) *RegionUpdate

AddCityIDs adds the "cities" edge to the City entity by IDs.

func (*RegionUpdate) ClearCities

func (ru *RegionUpdate) ClearCities() *RegionUpdate

ClearCities clears all "cities" edges to the City entity.

func (*RegionUpdate) ClearCountry

func (ru *RegionUpdate) ClearCountry() *RegionUpdate

ClearCountry clears the "country" edge to the Country entity.

func (*RegionUpdate) Exec

func (ru *RegionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*RegionUpdate) ExecX

func (ru *RegionUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RegionUpdate) Mutation

func (ru *RegionUpdate) Mutation() *RegionMutation

Mutation returns the RegionMutation object of the builder.

func (*RegionUpdate) RemoveCities

func (ru *RegionUpdate) RemoveCities(c ...*City) *RegionUpdate

RemoveCities removes "cities" edges to City entities.

func (*RegionUpdate) RemoveCityIDs

func (ru *RegionUpdate) RemoveCityIDs(ids ...uuid.UUID) *RegionUpdate

RemoveCityIDs removes the "cities" edge to City entities by IDs.

func (*RegionUpdate) Save

func (ru *RegionUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*RegionUpdate) SaveX

func (ru *RegionUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*RegionUpdate) SetCountry

func (ru *RegionUpdate) SetCountry(c *Country) *RegionUpdate

SetCountry sets the "country" edge to the Country entity.

func (*RegionUpdate) SetCountryID

func (ru *RegionUpdate) SetCountryID(u uuid.UUID) *RegionUpdate

SetCountryID sets the "country_id" field.

func (*RegionUpdate) SetCreatedAt

func (ru *RegionUpdate) SetCreatedAt(t time.Time) *RegionUpdate

SetCreatedAt sets the "created_at" field.

func (*RegionUpdate) SetName

func (ru *RegionUpdate) SetName(s string) *RegionUpdate

SetName sets the "name" field.

func (*RegionUpdate) SetNillableCountryID

func (ru *RegionUpdate) SetNillableCountryID(u *uuid.UUID) *RegionUpdate

SetNillableCountryID sets the "country_id" field if the given value is not nil.

func (*RegionUpdate) SetNillableCreatedAt

func (ru *RegionUpdate) SetNillableCreatedAt(t *time.Time) *RegionUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*RegionUpdate) SetNillableName

func (ru *RegionUpdate) SetNillableName(s *string) *RegionUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*RegionUpdate) SetUpdatedAt

func (ru *RegionUpdate) SetUpdatedAt(t time.Time) *RegionUpdate

SetUpdatedAt sets the "updated_at" field.

func (*RegionUpdate) Where

func (ru *RegionUpdate) Where(ps ...predicate.Region) *RegionUpdate

Where appends a list predicates to the RegionUpdate builder.

type RegionUpdateOne

type RegionUpdateOne struct {
	// contains filtered or unexported fields
}

RegionUpdateOne is the builder for updating a single Region entity.

func (*RegionUpdateOne) AddCities

func (ruo *RegionUpdateOne) AddCities(c ...*City) *RegionUpdateOne

AddCities adds the "cities" edges to the City entity.

func (*RegionUpdateOne) AddCityIDs

func (ruo *RegionUpdateOne) AddCityIDs(ids ...uuid.UUID) *RegionUpdateOne

AddCityIDs adds the "cities" edge to the City entity by IDs.

func (*RegionUpdateOne) ClearCities

func (ruo *RegionUpdateOne) ClearCities() *RegionUpdateOne

ClearCities clears all "cities" edges to the City entity.

func (*RegionUpdateOne) ClearCountry

func (ruo *RegionUpdateOne) ClearCountry() *RegionUpdateOne

ClearCountry clears the "country" edge to the Country entity.

func (*RegionUpdateOne) Exec

func (ruo *RegionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*RegionUpdateOne) ExecX

func (ruo *RegionUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RegionUpdateOne) Mutation

func (ruo *RegionUpdateOne) Mutation() *RegionMutation

Mutation returns the RegionMutation object of the builder.

func (*RegionUpdateOne) RemoveCities

func (ruo *RegionUpdateOne) RemoveCities(c ...*City) *RegionUpdateOne

RemoveCities removes "cities" edges to City entities.

func (*RegionUpdateOne) RemoveCityIDs

func (ruo *RegionUpdateOne) RemoveCityIDs(ids ...uuid.UUID) *RegionUpdateOne

RemoveCityIDs removes the "cities" edge to City entities by IDs.

func (*RegionUpdateOne) Save

func (ruo *RegionUpdateOne) Save(ctx context.Context) (*Region, error)

Save executes the query and returns the updated Region entity.

func (*RegionUpdateOne) SaveX

func (ruo *RegionUpdateOne) SaveX(ctx context.Context) *Region

SaveX is like Save, but panics if an error occurs.

func (*RegionUpdateOne) Select

func (ruo *RegionUpdateOne) Select(field string, fields ...string) *RegionUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*RegionUpdateOne) SetCountry

func (ruo *RegionUpdateOne) SetCountry(c *Country) *RegionUpdateOne

SetCountry sets the "country" edge to the Country entity.

func (*RegionUpdateOne) SetCountryID

func (ruo *RegionUpdateOne) SetCountryID(u uuid.UUID) *RegionUpdateOne

SetCountryID sets the "country_id" field.

func (*RegionUpdateOne) SetCreatedAt

func (ruo *RegionUpdateOne) SetCreatedAt(t time.Time) *RegionUpdateOne

SetCreatedAt sets the "created_at" field.

func (*RegionUpdateOne) SetName

func (ruo *RegionUpdateOne) SetName(s string) *RegionUpdateOne

SetName sets the "name" field.

func (*RegionUpdateOne) SetNillableCountryID

func (ruo *RegionUpdateOne) SetNillableCountryID(u *uuid.UUID) *RegionUpdateOne

SetNillableCountryID sets the "country_id" field if the given value is not nil.

func (*RegionUpdateOne) SetNillableCreatedAt

func (ruo *RegionUpdateOne) SetNillableCreatedAt(t *time.Time) *RegionUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*RegionUpdateOne) SetNillableName

func (ruo *RegionUpdateOne) SetNillableName(s *string) *RegionUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*RegionUpdateOne) SetUpdatedAt

func (ruo *RegionUpdateOne) SetUpdatedAt(t time.Time) *RegionUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*RegionUpdateOne) Where

func (ruo *RegionUpdateOne) Where(ps ...predicate.Region) *RegionUpdateOne

Where appends a list predicates to the RegionUpdate builder.

type Regions

type Regions []*Region

Regions is a parsable slice of Region.

type Replies

type Replies []*Reply

Replies is a parsable slice of Reply.

type Reply

type Reply struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Text holds the value of the "text" field.
	Text string `json:"text,omitempty"`
	// Slug holds the value of the "slug" field.
	Slug string `json:"slug,omitempty"`
	// AuthorID holds the value of the "author_id" field.
	AuthorID uuid.UUID `json:"author_id,omitempty"`
	// CommentID holds the value of the "comment_id" field.
	CommentID uuid.UUID `json:"comment_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ReplyQuery when eager-loading is set.
	Edges ReplyEdges `json:"edges"`
	// contains filtered or unexported fields
}

Reply is the model entity for the Reply schema.

func (*Reply) QueryAuthor

func (r *Reply) QueryAuthor() *UserQuery

QueryAuthor queries the "author" edge of the Reply entity.

func (*Reply) QueryComment

func (r *Reply) QueryComment() *CommentQuery

QueryComment queries the "comment" edge of the Reply entity.

func (*Reply) QueryNotifications

func (r *Reply) QueryNotifications() *NotificationQuery

QueryNotifications queries the "notifications" edge of the Reply entity.

func (*Reply) QueryReactions

func (r *Reply) QueryReactions() *ReactionQuery

QueryReactions queries the "reactions" edge of the Reply entity.

func (*Reply) String

func (r *Reply) String() string

String implements the fmt.Stringer.

func (*Reply) Unwrap

func (r *Reply) Unwrap() *Reply

Unwrap unwraps the Reply 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 (*Reply) Update

func (r *Reply) Update() *ReplyUpdateOne

Update returns a builder for updating this Reply. Note that you need to call Reply.Unwrap() before calling this method if this Reply was returned from a transaction, and the transaction was committed or rolled back.

func (*Reply) Value

func (r *Reply) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Reply. This includes values selected through modifiers, order, etc.

type ReplyClient

type ReplyClient struct {
	// contains filtered or unexported fields
}

ReplyClient is a client for the Reply schema.

func NewReplyClient

func NewReplyClient(c config) *ReplyClient

NewReplyClient returns a client for the Reply from the given config.

func (*ReplyClient) Create

func (c *ReplyClient) Create() *ReplyCreate

Create returns a builder for creating a Reply entity.

func (*ReplyClient) CreateBulk

func (c *ReplyClient) CreateBulk(builders ...*ReplyCreate) *ReplyCreateBulk

CreateBulk returns a builder for creating a bulk of Reply entities.

func (*ReplyClient) Delete

func (c *ReplyClient) Delete() *ReplyDelete

Delete returns a delete builder for Reply.

func (*ReplyClient) DeleteOne

func (c *ReplyClient) DeleteOne(r *Reply) *ReplyDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ReplyClient) DeleteOneID

func (c *ReplyClient) DeleteOneID(id uuid.UUID) *ReplyDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ReplyClient) Get

func (c *ReplyClient) Get(ctx context.Context, id uuid.UUID) (*Reply, error)

Get returns a Reply entity by its id.

func (*ReplyClient) GetX

func (c *ReplyClient) GetX(ctx context.Context, id uuid.UUID) *Reply

GetX is like Get, but panics if an error occurs.

func (*ReplyClient) Hooks

func (c *ReplyClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ReplyClient) Intercept

func (c *ReplyClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `reply.Intercept(f(g(h())))`.

func (*ReplyClient) Interceptors

func (c *ReplyClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ReplyClient) MapCreateBulk

func (c *ReplyClient) MapCreateBulk(slice any, setFunc func(*ReplyCreate, int)) *ReplyCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*ReplyClient) Query

func (c *ReplyClient) Query() *ReplyQuery

Query returns a query builder for Reply.

func (*ReplyClient) QueryAuthor

func (c *ReplyClient) QueryAuthor(r *Reply) *UserQuery

QueryAuthor queries the author edge of a Reply.

func (*ReplyClient) QueryComment

func (c *ReplyClient) QueryComment(r *Reply) *CommentQuery

QueryComment queries the comment edge of a Reply.

func (*ReplyClient) QueryNotifications

func (c *ReplyClient) QueryNotifications(r *Reply) *NotificationQuery

QueryNotifications queries the notifications edge of a Reply.

func (*ReplyClient) QueryReactions

func (c *ReplyClient) QueryReactions(r *Reply) *ReactionQuery

QueryReactions queries the reactions edge of a Reply.

func (*ReplyClient) Update

func (c *ReplyClient) Update() *ReplyUpdate

Update returns an update builder for Reply.

func (*ReplyClient) UpdateOne

func (c *ReplyClient) UpdateOne(r *Reply) *ReplyUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ReplyClient) UpdateOneID

func (c *ReplyClient) UpdateOneID(id uuid.UUID) *ReplyUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ReplyClient) Use

func (c *ReplyClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `reply.Hooks(f(g(h())))`.

type ReplyCreate

type ReplyCreate struct {
	// contains filtered or unexported fields
}

ReplyCreate is the builder for creating a Reply entity.

func (*ReplyCreate) AddNotificationIDs

func (rc *ReplyCreate) AddNotificationIDs(ids ...uuid.UUID) *ReplyCreate

AddNotificationIDs adds the "notifications" edge to the Notification entity by IDs.

func (*ReplyCreate) AddNotifications

func (rc *ReplyCreate) AddNotifications(n ...*Notification) *ReplyCreate

AddNotifications adds the "notifications" edges to the Notification entity.

func (*ReplyCreate) AddReactionIDs

func (rc *ReplyCreate) AddReactionIDs(ids ...uuid.UUID) *ReplyCreate

AddReactionIDs adds the "reactions" edge to the Reaction entity by IDs.

func (*ReplyCreate) AddReactions

func (rc *ReplyCreate) AddReactions(r ...*Reaction) *ReplyCreate

AddReactions adds the "reactions" edges to the Reaction entity.

func (*ReplyCreate) Exec

func (rc *ReplyCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ReplyCreate) ExecX

func (rc *ReplyCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReplyCreate) Mutation

func (rc *ReplyCreate) Mutation() *ReplyMutation

Mutation returns the ReplyMutation object of the builder.

func (*ReplyCreate) Save

func (rc *ReplyCreate) Save(ctx context.Context) (*Reply, error)

Save creates the Reply in the database.

func (*ReplyCreate) SaveX

func (rc *ReplyCreate) SaveX(ctx context.Context) *Reply

SaveX calls Save and panics if Save returns an error.

func (*ReplyCreate) SetAuthor

func (rc *ReplyCreate) SetAuthor(u *User) *ReplyCreate

SetAuthor sets the "author" edge to the User entity.

func (*ReplyCreate) SetAuthorID

func (rc *ReplyCreate) SetAuthorID(u uuid.UUID) *ReplyCreate

SetAuthorID sets the "author_id" field.

func (*ReplyCreate) SetComment

func (rc *ReplyCreate) SetComment(c *Comment) *ReplyCreate

SetComment sets the "comment" edge to the Comment entity.

func (*ReplyCreate) SetCommentID

func (rc *ReplyCreate) SetCommentID(u uuid.UUID) *ReplyCreate

SetCommentID sets the "comment_id" field.

func (*ReplyCreate) SetCreatedAt

func (rc *ReplyCreate) SetCreatedAt(t time.Time) *ReplyCreate

SetCreatedAt sets the "created_at" field.

func (*ReplyCreate) SetID

func (rc *ReplyCreate) SetID(u uuid.UUID) *ReplyCreate

SetID sets the "id" field.

func (*ReplyCreate) SetNillableCreatedAt

func (rc *ReplyCreate) SetNillableCreatedAt(t *time.Time) *ReplyCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ReplyCreate) SetNillableID

func (rc *ReplyCreate) SetNillableID(u *uuid.UUID) *ReplyCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ReplyCreate) SetNillableUpdatedAt

func (rc *ReplyCreate) SetNillableUpdatedAt(t *time.Time) *ReplyCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*ReplyCreate) SetSlug

func (rc *ReplyCreate) SetSlug(s string) *ReplyCreate

SetSlug sets the "slug" field.

func (*ReplyCreate) SetText

func (rc *ReplyCreate) SetText(s string) *ReplyCreate

SetText sets the "text" field.

func (*ReplyCreate) SetUpdatedAt

func (rc *ReplyCreate) SetUpdatedAt(t time.Time) *ReplyCreate

SetUpdatedAt sets the "updated_at" field.

type ReplyCreateBulk

type ReplyCreateBulk struct {
	// contains filtered or unexported fields
}

ReplyCreateBulk is the builder for creating many Reply entities in bulk.

func (*ReplyCreateBulk) Exec

func (rcb *ReplyCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ReplyCreateBulk) ExecX

func (rcb *ReplyCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReplyCreateBulk) Save

func (rcb *ReplyCreateBulk) Save(ctx context.Context) ([]*Reply, error)

Save creates the Reply entities in the database.

func (*ReplyCreateBulk) SaveX

func (rcb *ReplyCreateBulk) SaveX(ctx context.Context) []*Reply

SaveX is like Save, but panics if an error occurs.

type ReplyDelete

type ReplyDelete struct {
	// contains filtered or unexported fields
}

ReplyDelete is the builder for deleting a Reply entity.

func (*ReplyDelete) Exec

func (rd *ReplyDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ReplyDelete) ExecX

func (rd *ReplyDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ReplyDelete) Where

func (rd *ReplyDelete) Where(ps ...predicate.Reply) *ReplyDelete

Where appends a list predicates to the ReplyDelete builder.

type ReplyDeleteOne

type ReplyDeleteOne struct {
	// contains filtered or unexported fields
}

ReplyDeleteOne is the builder for deleting a single Reply entity.

func (*ReplyDeleteOne) Exec

func (rdo *ReplyDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ReplyDeleteOne) ExecX

func (rdo *ReplyDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReplyDeleteOne) Where

func (rdo *ReplyDeleteOne) Where(ps ...predicate.Reply) *ReplyDeleteOne

Where appends a list predicates to the ReplyDelete builder.

type ReplyEdges

type ReplyEdges struct {
	// Reactions holds the value of the reactions edge.
	Reactions []*Reaction `json:"reactions,omitempty"`
	// Author holds the value of the author edge.
	Author *User `json:"author,omitempty"`
	// Comment holds the value of the comment edge.
	Comment *Comment `json:"comment,omitempty"`
	// Notifications holds the value of the notifications edge.
	Notifications []*Notification `json:"notifications,omitempty"`
	// contains filtered or unexported fields
}

ReplyEdges holds the relations/edges for other nodes in the graph.

func (ReplyEdges) AuthorOrErr

func (e ReplyEdges) AuthorOrErr() (*User, error)

AuthorOrErr returns the Author value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (ReplyEdges) CommentOrErr

func (e ReplyEdges) CommentOrErr() (*Comment, error)

CommentOrErr returns the Comment value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (ReplyEdges) NotificationsOrErr

func (e ReplyEdges) NotificationsOrErr() ([]*Notification, error)

NotificationsOrErr returns the Notifications value or an error if the edge was not loaded in eager-loading.

func (ReplyEdges) ReactionsOrErr

func (e ReplyEdges) ReactionsOrErr() ([]*Reaction, error)

ReactionsOrErr returns the Reactions value or an error if the edge was not loaded in eager-loading.

type ReplyGroupBy

type ReplyGroupBy struct {
	// contains filtered or unexported fields
}

ReplyGroupBy is the group-by builder for Reply entities.

func (*ReplyGroupBy) Aggregate

func (rgb *ReplyGroupBy) Aggregate(fns ...AggregateFunc) *ReplyGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ReplyGroupBy) Bool

func (s *ReplyGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ReplyGroupBy) BoolX

func (s *ReplyGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ReplyGroupBy) Bools

func (s *ReplyGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ReplyGroupBy) BoolsX

func (s *ReplyGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ReplyGroupBy) Float64

func (s *ReplyGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ReplyGroupBy) Float64X

func (s *ReplyGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ReplyGroupBy) Float64s

func (s *ReplyGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ReplyGroupBy) Float64sX

func (s *ReplyGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ReplyGroupBy) Int

func (s *ReplyGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ReplyGroupBy) IntX

func (s *ReplyGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ReplyGroupBy) Ints

func (s *ReplyGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ReplyGroupBy) IntsX

func (s *ReplyGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ReplyGroupBy) Scan

func (rgb *ReplyGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ReplyGroupBy) ScanX

func (s *ReplyGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ReplyGroupBy) String

func (s *ReplyGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ReplyGroupBy) StringX

func (s *ReplyGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ReplyGroupBy) Strings

func (s *ReplyGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ReplyGroupBy) StringsX

func (s *ReplyGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ReplyMutation

type ReplyMutation struct {
	// contains filtered or unexported fields
}

ReplyMutation represents an operation that mutates the Reply nodes in the graph.

func (*ReplyMutation) AddField

func (m *ReplyMutation) 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 (*ReplyMutation) AddNotificationIDs

func (m *ReplyMutation) AddNotificationIDs(ids ...uuid.UUID)

AddNotificationIDs adds the "notifications" edge to the Notification entity by ids.

func (*ReplyMutation) AddReactionIDs

func (m *ReplyMutation) AddReactionIDs(ids ...uuid.UUID)

AddReactionIDs adds the "reactions" edge to the Reaction entity by ids.

func (*ReplyMutation) AddedEdges

func (m *ReplyMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ReplyMutation) AddedField

func (m *ReplyMutation) 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 (*ReplyMutation) AddedFields

func (m *ReplyMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ReplyMutation) AddedIDs

func (m *ReplyMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ReplyMutation) AuthorCleared

func (m *ReplyMutation) AuthorCleared() bool

AuthorCleared reports if the "author" edge to the User entity was cleared.

func (*ReplyMutation) AuthorID

func (m *ReplyMutation) AuthorID() (r uuid.UUID, exists bool)

AuthorID returns the value of the "author_id" field in the mutation.

func (*ReplyMutation) AuthorIDs

func (m *ReplyMutation) AuthorIDs() (ids []uuid.UUID)

AuthorIDs returns the "author" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use AuthorID instead. It exists only for internal usage by the builders.

func (*ReplyMutation) ClearAuthor

func (m *ReplyMutation) ClearAuthor()

ClearAuthor clears the "author" edge to the User entity.

func (*ReplyMutation) ClearComment

func (m *ReplyMutation) ClearComment()

ClearComment clears the "comment" edge to the Comment entity.

func (*ReplyMutation) ClearEdge

func (m *ReplyMutation) 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 (*ReplyMutation) ClearField

func (m *ReplyMutation) 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 (*ReplyMutation) ClearNotifications

func (m *ReplyMutation) ClearNotifications()

ClearNotifications clears the "notifications" edge to the Notification entity.

func (*ReplyMutation) ClearReactions

func (m *ReplyMutation) ClearReactions()

ClearReactions clears the "reactions" edge to the Reaction entity.

func (*ReplyMutation) ClearedEdges

func (m *ReplyMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ReplyMutation) ClearedFields

func (m *ReplyMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ReplyMutation) Client

func (m ReplyMutation) 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 (*ReplyMutation) CommentCleared

func (m *ReplyMutation) CommentCleared() bool

CommentCleared reports if the "comment" edge to the Comment entity was cleared.

func (*ReplyMutation) CommentID

func (m *ReplyMutation) CommentID() (r uuid.UUID, exists bool)

CommentID returns the value of the "comment_id" field in the mutation.

func (*ReplyMutation) CommentIDs

func (m *ReplyMutation) CommentIDs() (ids []uuid.UUID)

CommentIDs returns the "comment" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CommentID instead. It exists only for internal usage by the builders.

func (*ReplyMutation) CreatedAt

func (m *ReplyMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ReplyMutation) EdgeCleared

func (m *ReplyMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ReplyMutation) Field

func (m *ReplyMutation) 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 (*ReplyMutation) FieldCleared

func (m *ReplyMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ReplyMutation) Fields

func (m *ReplyMutation) 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 (*ReplyMutation) ID

func (m *ReplyMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*ReplyMutation) IDs

func (m *ReplyMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*ReplyMutation) NotificationsCleared

func (m *ReplyMutation) NotificationsCleared() bool

NotificationsCleared reports if the "notifications" edge to the Notification entity was cleared.

func (*ReplyMutation) NotificationsIDs

func (m *ReplyMutation) NotificationsIDs() (ids []uuid.UUID)

NotificationsIDs returns the "notifications" edge IDs in the mutation.

func (*ReplyMutation) OldAuthorID

func (m *ReplyMutation) OldAuthorID(ctx context.Context) (v uuid.UUID, err error)

OldAuthorID returns the old "author_id" field's value of the Reply entity. If the Reply 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 (*ReplyMutation) OldCommentID

func (m *ReplyMutation) OldCommentID(ctx context.Context) (v uuid.UUID, err error)

OldCommentID returns the old "comment_id" field's value of the Reply entity. If the Reply 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 (*ReplyMutation) OldCreatedAt

func (m *ReplyMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Reply entity. If the Reply 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 (*ReplyMutation) OldField

func (m *ReplyMutation) 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 (*ReplyMutation) OldSlug

func (m *ReplyMutation) OldSlug(ctx context.Context) (v string, err error)

OldSlug returns the old "slug" field's value of the Reply entity. If the Reply 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 (*ReplyMutation) OldText

func (m *ReplyMutation) OldText(ctx context.Context) (v string, err error)

OldText returns the old "text" field's value of the Reply entity. If the Reply 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 (*ReplyMutation) OldUpdatedAt

func (m *ReplyMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Reply entity. If the Reply 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 (*ReplyMutation) Op

func (m *ReplyMutation) Op() Op

Op returns the operation name.

func (*ReplyMutation) ReactionsCleared

func (m *ReplyMutation) ReactionsCleared() bool

ReactionsCleared reports if the "reactions" edge to the Reaction entity was cleared.

func (*ReplyMutation) ReactionsIDs

func (m *ReplyMutation) ReactionsIDs() (ids []uuid.UUID)

ReactionsIDs returns the "reactions" edge IDs in the mutation.

func (*ReplyMutation) RemoveNotificationIDs

func (m *ReplyMutation) RemoveNotificationIDs(ids ...uuid.UUID)

RemoveNotificationIDs removes the "notifications" edge to the Notification entity by IDs.

func (*ReplyMutation) RemoveReactionIDs

func (m *ReplyMutation) RemoveReactionIDs(ids ...uuid.UUID)

RemoveReactionIDs removes the "reactions" edge to the Reaction entity by IDs.

func (*ReplyMutation) RemovedEdges

func (m *ReplyMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ReplyMutation) RemovedIDs

func (m *ReplyMutation) 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 (*ReplyMutation) RemovedNotificationsIDs

func (m *ReplyMutation) RemovedNotificationsIDs() (ids []uuid.UUID)

RemovedNotifications returns the removed IDs of the "notifications" edge to the Notification entity.

func (*ReplyMutation) RemovedReactionsIDs

func (m *ReplyMutation) RemovedReactionsIDs() (ids []uuid.UUID)

RemovedReactions returns the removed IDs of the "reactions" edge to the Reaction entity.

func (*ReplyMutation) ResetAuthor

func (m *ReplyMutation) ResetAuthor()

ResetAuthor resets all changes to the "author" edge.

func (*ReplyMutation) ResetAuthorID

func (m *ReplyMutation) ResetAuthorID()

ResetAuthorID resets all changes to the "author_id" field.

func (*ReplyMutation) ResetComment

func (m *ReplyMutation) ResetComment()

ResetComment resets all changes to the "comment" edge.

func (*ReplyMutation) ResetCommentID

func (m *ReplyMutation) ResetCommentID()

ResetCommentID resets all changes to the "comment_id" field.

func (*ReplyMutation) ResetCreatedAt

func (m *ReplyMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ReplyMutation) ResetEdge

func (m *ReplyMutation) 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 (*ReplyMutation) ResetField

func (m *ReplyMutation) 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 (*ReplyMutation) ResetNotifications

func (m *ReplyMutation) ResetNotifications()

ResetNotifications resets all changes to the "notifications" edge.

func (*ReplyMutation) ResetReactions

func (m *ReplyMutation) ResetReactions()

ResetReactions resets all changes to the "reactions" edge.

func (*ReplyMutation) ResetSlug

func (m *ReplyMutation) ResetSlug()

ResetSlug resets all changes to the "slug" field.

func (*ReplyMutation) ResetText

func (m *ReplyMutation) ResetText()

ResetText resets all changes to the "text" field.

func (*ReplyMutation) ResetUpdatedAt

func (m *ReplyMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ReplyMutation) SetAuthorID

func (m *ReplyMutation) SetAuthorID(u uuid.UUID)

SetAuthorID sets the "author_id" field.

func (*ReplyMutation) SetCommentID

func (m *ReplyMutation) SetCommentID(u uuid.UUID)

SetCommentID sets the "comment_id" field.

func (*ReplyMutation) SetCreatedAt

func (m *ReplyMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ReplyMutation) SetField

func (m *ReplyMutation) 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 (*ReplyMutation) SetID

func (m *ReplyMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Reply entities.

func (*ReplyMutation) SetOp

func (m *ReplyMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ReplyMutation) SetSlug

func (m *ReplyMutation) SetSlug(s string)

SetSlug sets the "slug" field.

func (*ReplyMutation) SetText

func (m *ReplyMutation) SetText(s string)

SetText sets the "text" field.

func (*ReplyMutation) SetUpdatedAt

func (m *ReplyMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*ReplyMutation) Slug

func (m *ReplyMutation) Slug() (r string, exists bool)

Slug returns the value of the "slug" field in the mutation.

func (*ReplyMutation) Text

func (m *ReplyMutation) Text() (r string, exists bool)

Text returns the value of the "text" field in the mutation.

func (ReplyMutation) Tx

func (m ReplyMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ReplyMutation) Type

func (m *ReplyMutation) Type() string

Type returns the node type of this mutation (Reply).

func (*ReplyMutation) UpdatedAt

func (m *ReplyMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*ReplyMutation) Where

func (m *ReplyMutation) Where(ps ...predicate.Reply)

Where appends a list predicates to the ReplyMutation builder.

func (*ReplyMutation) WhereP

func (m *ReplyMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ReplyMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ReplyQuery

type ReplyQuery struct {
	// contains filtered or unexported fields
}

ReplyQuery is the builder for querying Reply entities.

func (*ReplyQuery) Aggregate

func (rq *ReplyQuery) Aggregate(fns ...AggregateFunc) *ReplySelect

Aggregate returns a ReplySelect configured with the given aggregations.

func (*ReplyQuery) All

func (rq *ReplyQuery) All(ctx context.Context) ([]*Reply, error)

All executes the query and returns a list of Replies.

func (*ReplyQuery) AllX

func (rq *ReplyQuery) AllX(ctx context.Context) []*Reply

AllX is like All, but panics if an error occurs.

func (*ReplyQuery) Clone

func (rq *ReplyQuery) Clone() *ReplyQuery

Clone returns a duplicate of the ReplyQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ReplyQuery) Count

func (rq *ReplyQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ReplyQuery) CountX

func (rq *ReplyQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ReplyQuery) Exist

func (rq *ReplyQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ReplyQuery) ExistX

func (rq *ReplyQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ReplyQuery) First

func (rq *ReplyQuery) First(ctx context.Context) (*Reply, error)

First returns the first Reply entity from the query. Returns a *NotFoundError when no Reply was found.

func (*ReplyQuery) FirstID

func (rq *ReplyQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Reply ID from the query. Returns a *NotFoundError when no Reply ID was found.

func (*ReplyQuery) FirstIDX

func (rq *ReplyQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*ReplyQuery) FirstX

func (rq *ReplyQuery) FirstX(ctx context.Context) *Reply

FirstX is like First, but panics if an error occurs.

func (*ReplyQuery) GroupBy

func (rq *ReplyQuery) GroupBy(field string, fields ...string) *ReplyGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Reply.Query().
	GroupBy(reply.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ReplyQuery) IDs

func (rq *ReplyQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Reply IDs.

func (*ReplyQuery) IDsX

func (rq *ReplyQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*ReplyQuery) Limit

func (rq *ReplyQuery) Limit(limit int) *ReplyQuery

Limit the number of records to be returned by this query.

func (*ReplyQuery) Offset

func (rq *ReplyQuery) Offset(offset int) *ReplyQuery

Offset to start from.

func (*ReplyQuery) Only

func (rq *ReplyQuery) Only(ctx context.Context) (*Reply, error)

Only returns a single Reply entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Reply entity is found. Returns a *NotFoundError when no Reply entities are found.

func (*ReplyQuery) OnlyID

func (rq *ReplyQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Reply ID in the query. Returns a *NotSingularError when more than one Reply ID is found. Returns a *NotFoundError when no entities are found.

func (*ReplyQuery) OnlyIDX

func (rq *ReplyQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ReplyQuery) OnlyX

func (rq *ReplyQuery) OnlyX(ctx context.Context) *Reply

OnlyX is like Only, but panics if an error occurs.

func (*ReplyQuery) Order

func (rq *ReplyQuery) Order(o ...reply.OrderOption) *ReplyQuery

Order specifies how the records should be ordered.

func (*ReplyQuery) QueryAuthor

func (rq *ReplyQuery) QueryAuthor() *UserQuery

QueryAuthor chains the current query on the "author" edge.

func (*ReplyQuery) QueryComment

func (rq *ReplyQuery) QueryComment() *CommentQuery

QueryComment chains the current query on the "comment" edge.

func (*ReplyQuery) QueryNotifications

func (rq *ReplyQuery) QueryNotifications() *NotificationQuery

QueryNotifications chains the current query on the "notifications" edge.

func (*ReplyQuery) QueryReactions

func (rq *ReplyQuery) QueryReactions() *ReactionQuery

QueryReactions chains the current query on the "reactions" edge.

func (*ReplyQuery) Select

func (rq *ReplyQuery) Select(fields ...string) *ReplySelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Reply.Query().
	Select(reply.FieldCreatedAt).
	Scan(ctx, &v)

func (*ReplyQuery) Unique

func (rq *ReplyQuery) Unique(unique bool) *ReplyQuery

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 (*ReplyQuery) Where

func (rq *ReplyQuery) Where(ps ...predicate.Reply) *ReplyQuery

Where adds a new predicate for the ReplyQuery builder.

func (*ReplyQuery) WithAuthor

func (rq *ReplyQuery) WithAuthor(opts ...func(*UserQuery)) *ReplyQuery

WithAuthor tells the query-builder to eager-load the nodes that are connected to the "author" edge. The optional arguments are used to configure the query builder of the edge.

func (*ReplyQuery) WithComment

func (rq *ReplyQuery) WithComment(opts ...func(*CommentQuery)) *ReplyQuery

WithComment tells the query-builder to eager-load the nodes that are connected to the "comment" edge. The optional arguments are used to configure the query builder of the edge.

func (*ReplyQuery) WithNotifications

func (rq *ReplyQuery) WithNotifications(opts ...func(*NotificationQuery)) *ReplyQuery

WithNotifications tells the query-builder to eager-load the nodes that are connected to the "notifications" edge. The optional arguments are used to configure the query builder of the edge.

func (*ReplyQuery) WithReactions

func (rq *ReplyQuery) WithReactions(opts ...func(*ReactionQuery)) *ReplyQuery

WithReactions tells the query-builder to eager-load the nodes that are connected to the "reactions" edge. The optional arguments are used to configure the query builder of the edge.

type ReplySelect

type ReplySelect struct {
	*ReplyQuery
	// contains filtered or unexported fields
}

ReplySelect is the builder for selecting fields of Reply entities.

func (*ReplySelect) Aggregate

func (rs *ReplySelect) Aggregate(fns ...AggregateFunc) *ReplySelect

Aggregate adds the given aggregation functions to the selector query.

func (*ReplySelect) Bool

func (s *ReplySelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ReplySelect) BoolX

func (s *ReplySelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ReplySelect) Bools

func (s *ReplySelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ReplySelect) BoolsX

func (s *ReplySelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ReplySelect) Float64

func (s *ReplySelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ReplySelect) Float64X

func (s *ReplySelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ReplySelect) Float64s

func (s *ReplySelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ReplySelect) Float64sX

func (s *ReplySelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ReplySelect) Int

func (s *ReplySelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ReplySelect) IntX

func (s *ReplySelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ReplySelect) Ints

func (s *ReplySelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ReplySelect) IntsX

func (s *ReplySelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ReplySelect) Scan

func (rs *ReplySelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ReplySelect) ScanX

func (s *ReplySelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ReplySelect) String

func (s *ReplySelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ReplySelect) StringX

func (s *ReplySelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ReplySelect) Strings

func (s *ReplySelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ReplySelect) StringsX

func (s *ReplySelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ReplyUpdate

type ReplyUpdate struct {
	// contains filtered or unexported fields
}

ReplyUpdate is the builder for updating Reply entities.

func (*ReplyUpdate) AddNotificationIDs

func (ru *ReplyUpdate) AddNotificationIDs(ids ...uuid.UUID) *ReplyUpdate

AddNotificationIDs adds the "notifications" edge to the Notification entity by IDs.

func (*ReplyUpdate) AddNotifications

func (ru *ReplyUpdate) AddNotifications(n ...*Notification) *ReplyUpdate

AddNotifications adds the "notifications" edges to the Notification entity.

func (*ReplyUpdate) AddReactionIDs

func (ru *ReplyUpdate) AddReactionIDs(ids ...uuid.UUID) *ReplyUpdate

AddReactionIDs adds the "reactions" edge to the Reaction entity by IDs.

func (*ReplyUpdate) AddReactions

func (ru *ReplyUpdate) AddReactions(r ...*Reaction) *ReplyUpdate

AddReactions adds the "reactions" edges to the Reaction entity.

func (*ReplyUpdate) ClearAuthor

func (ru *ReplyUpdate) ClearAuthor() *ReplyUpdate

ClearAuthor clears the "author" edge to the User entity.

func (*ReplyUpdate) ClearComment

func (ru *ReplyUpdate) ClearComment() *ReplyUpdate

ClearComment clears the "comment" edge to the Comment entity.

func (*ReplyUpdate) ClearNotifications

func (ru *ReplyUpdate) ClearNotifications() *ReplyUpdate

ClearNotifications clears all "notifications" edges to the Notification entity.

func (*ReplyUpdate) ClearReactions

func (ru *ReplyUpdate) ClearReactions() *ReplyUpdate

ClearReactions clears all "reactions" edges to the Reaction entity.

func (*ReplyUpdate) Exec

func (ru *ReplyUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ReplyUpdate) ExecX

func (ru *ReplyUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReplyUpdate) Mutation

func (ru *ReplyUpdate) Mutation() *ReplyMutation

Mutation returns the ReplyMutation object of the builder.

func (*ReplyUpdate) RemoveNotificationIDs

func (ru *ReplyUpdate) RemoveNotificationIDs(ids ...uuid.UUID) *ReplyUpdate

RemoveNotificationIDs removes the "notifications" edge to Notification entities by IDs.

func (*ReplyUpdate) RemoveNotifications

func (ru *ReplyUpdate) RemoveNotifications(n ...*Notification) *ReplyUpdate

RemoveNotifications removes "notifications" edges to Notification entities.

func (*ReplyUpdate) RemoveReactionIDs

func (ru *ReplyUpdate) RemoveReactionIDs(ids ...uuid.UUID) *ReplyUpdate

RemoveReactionIDs removes the "reactions" edge to Reaction entities by IDs.

func (*ReplyUpdate) RemoveReactions

func (ru *ReplyUpdate) RemoveReactions(r ...*Reaction) *ReplyUpdate

RemoveReactions removes "reactions" edges to Reaction entities.

func (*ReplyUpdate) Save

func (ru *ReplyUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ReplyUpdate) SaveX

func (ru *ReplyUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ReplyUpdate) SetAuthor

func (ru *ReplyUpdate) SetAuthor(u *User) *ReplyUpdate

SetAuthor sets the "author" edge to the User entity.

func (*ReplyUpdate) SetAuthorID

func (ru *ReplyUpdate) SetAuthorID(u uuid.UUID) *ReplyUpdate

SetAuthorID sets the "author_id" field.

func (*ReplyUpdate) SetComment

func (ru *ReplyUpdate) SetComment(c *Comment) *ReplyUpdate

SetComment sets the "comment" edge to the Comment entity.

func (*ReplyUpdate) SetCommentID

func (ru *ReplyUpdate) SetCommentID(u uuid.UUID) *ReplyUpdate

SetCommentID sets the "comment_id" field.

func (*ReplyUpdate) SetCreatedAt

func (ru *ReplyUpdate) SetCreatedAt(t time.Time) *ReplyUpdate

SetCreatedAt sets the "created_at" field.

func (*ReplyUpdate) SetNillableAuthorID

func (ru *ReplyUpdate) SetNillableAuthorID(u *uuid.UUID) *ReplyUpdate

SetNillableAuthorID sets the "author_id" field if the given value is not nil.

func (*ReplyUpdate) SetNillableCommentID

func (ru *ReplyUpdate) SetNillableCommentID(u *uuid.UUID) *ReplyUpdate

SetNillableCommentID sets the "comment_id" field if the given value is not nil.

func (*ReplyUpdate) SetNillableCreatedAt

func (ru *ReplyUpdate) SetNillableCreatedAt(t *time.Time) *ReplyUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ReplyUpdate) SetNillableSlug

func (ru *ReplyUpdate) SetNillableSlug(s *string) *ReplyUpdate

SetNillableSlug sets the "slug" field if the given value is not nil.

func (*ReplyUpdate) SetNillableText

func (ru *ReplyUpdate) SetNillableText(s *string) *ReplyUpdate

SetNillableText sets the "text" field if the given value is not nil.

func (*ReplyUpdate) SetSlug

func (ru *ReplyUpdate) SetSlug(s string) *ReplyUpdate

SetSlug sets the "slug" field.

func (*ReplyUpdate) SetText

func (ru *ReplyUpdate) SetText(s string) *ReplyUpdate

SetText sets the "text" field.

func (*ReplyUpdate) SetUpdatedAt

func (ru *ReplyUpdate) SetUpdatedAt(t time.Time) *ReplyUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ReplyUpdate) Where

func (ru *ReplyUpdate) Where(ps ...predicate.Reply) *ReplyUpdate

Where appends a list predicates to the ReplyUpdate builder.

type ReplyUpdateOne

type ReplyUpdateOne struct {
	// contains filtered or unexported fields
}

ReplyUpdateOne is the builder for updating a single Reply entity.

func (*ReplyUpdateOne) AddNotificationIDs

func (ruo *ReplyUpdateOne) AddNotificationIDs(ids ...uuid.UUID) *ReplyUpdateOne

AddNotificationIDs adds the "notifications" edge to the Notification entity by IDs.

func (*ReplyUpdateOne) AddNotifications

func (ruo *ReplyUpdateOne) AddNotifications(n ...*Notification) *ReplyUpdateOne

AddNotifications adds the "notifications" edges to the Notification entity.

func (*ReplyUpdateOne) AddReactionIDs

func (ruo *ReplyUpdateOne) AddReactionIDs(ids ...uuid.UUID) *ReplyUpdateOne

AddReactionIDs adds the "reactions" edge to the Reaction entity by IDs.

func (*ReplyUpdateOne) AddReactions

func (ruo *ReplyUpdateOne) AddReactions(r ...*Reaction) *ReplyUpdateOne

AddReactions adds the "reactions" edges to the Reaction entity.

func (*ReplyUpdateOne) ClearAuthor

func (ruo *ReplyUpdateOne) ClearAuthor() *ReplyUpdateOne

ClearAuthor clears the "author" edge to the User entity.

func (*ReplyUpdateOne) ClearComment

func (ruo *ReplyUpdateOne) ClearComment() *ReplyUpdateOne

ClearComment clears the "comment" edge to the Comment entity.

func (*ReplyUpdateOne) ClearNotifications

func (ruo *ReplyUpdateOne) ClearNotifications() *ReplyUpdateOne

ClearNotifications clears all "notifications" edges to the Notification entity.

func (*ReplyUpdateOne) ClearReactions

func (ruo *ReplyUpdateOne) ClearReactions() *ReplyUpdateOne

ClearReactions clears all "reactions" edges to the Reaction entity.

func (*ReplyUpdateOne) Exec

func (ruo *ReplyUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ReplyUpdateOne) ExecX

func (ruo *ReplyUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReplyUpdateOne) Mutation

func (ruo *ReplyUpdateOne) Mutation() *ReplyMutation

Mutation returns the ReplyMutation object of the builder.

func (*ReplyUpdateOne) RemoveNotificationIDs

func (ruo *ReplyUpdateOne) RemoveNotificationIDs(ids ...uuid.UUID) *ReplyUpdateOne

RemoveNotificationIDs removes the "notifications" edge to Notification entities by IDs.

func (*ReplyUpdateOne) RemoveNotifications

func (ruo *ReplyUpdateOne) RemoveNotifications(n ...*Notification) *ReplyUpdateOne

RemoveNotifications removes "notifications" edges to Notification entities.

func (*ReplyUpdateOne) RemoveReactionIDs

func (ruo *ReplyUpdateOne) RemoveReactionIDs(ids ...uuid.UUID) *ReplyUpdateOne

RemoveReactionIDs removes the "reactions" edge to Reaction entities by IDs.

func (*ReplyUpdateOne) RemoveReactions

func (ruo *ReplyUpdateOne) RemoveReactions(r ...*Reaction) *ReplyUpdateOne

RemoveReactions removes "reactions" edges to Reaction entities.

func (*ReplyUpdateOne) Save

func (ruo *ReplyUpdateOne) Save(ctx context.Context) (*Reply, error)

Save executes the query and returns the updated Reply entity.

func (*ReplyUpdateOne) SaveX

func (ruo *ReplyUpdateOne) SaveX(ctx context.Context) *Reply

SaveX is like Save, but panics if an error occurs.

func (*ReplyUpdateOne) Select

func (ruo *ReplyUpdateOne) Select(field string, fields ...string) *ReplyUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ReplyUpdateOne) SetAuthor

func (ruo *ReplyUpdateOne) SetAuthor(u *User) *ReplyUpdateOne

SetAuthor sets the "author" edge to the User entity.

func (*ReplyUpdateOne) SetAuthorID

func (ruo *ReplyUpdateOne) SetAuthorID(u uuid.UUID) *ReplyUpdateOne

SetAuthorID sets the "author_id" field.

func (*ReplyUpdateOne) SetComment

func (ruo *ReplyUpdateOne) SetComment(c *Comment) *ReplyUpdateOne

SetComment sets the "comment" edge to the Comment entity.

func (*ReplyUpdateOne) SetCommentID

func (ruo *ReplyUpdateOne) SetCommentID(u uuid.UUID) *ReplyUpdateOne

SetCommentID sets the "comment_id" field.

func (*ReplyUpdateOne) SetCreatedAt

func (ruo *ReplyUpdateOne) SetCreatedAt(t time.Time) *ReplyUpdateOne

SetCreatedAt sets the "created_at" field.

func (*ReplyUpdateOne) SetNillableAuthorID

func (ruo *ReplyUpdateOne) SetNillableAuthorID(u *uuid.UUID) *ReplyUpdateOne

SetNillableAuthorID sets the "author_id" field if the given value is not nil.

func (*ReplyUpdateOne) SetNillableCommentID

func (ruo *ReplyUpdateOne) SetNillableCommentID(u *uuid.UUID) *ReplyUpdateOne

SetNillableCommentID sets the "comment_id" field if the given value is not nil.

func (*ReplyUpdateOne) SetNillableCreatedAt

func (ruo *ReplyUpdateOne) SetNillableCreatedAt(t *time.Time) *ReplyUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ReplyUpdateOne) SetNillableSlug

func (ruo *ReplyUpdateOne) SetNillableSlug(s *string) *ReplyUpdateOne

SetNillableSlug sets the "slug" field if the given value is not nil.

func (*ReplyUpdateOne) SetNillableText

func (ruo *ReplyUpdateOne) SetNillableText(s *string) *ReplyUpdateOne

SetNillableText sets the "text" field if the given value is not nil.

func (*ReplyUpdateOne) SetSlug

func (ruo *ReplyUpdateOne) SetSlug(s string) *ReplyUpdateOne

SetSlug sets the "slug" field.

func (*ReplyUpdateOne) SetText

func (ruo *ReplyUpdateOne) SetText(s string) *ReplyUpdateOne

SetText sets the "text" field.

func (*ReplyUpdateOne) SetUpdatedAt

func (ruo *ReplyUpdateOne) SetUpdatedAt(t time.Time) *ReplyUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ReplyUpdateOne) Where

func (ruo *ReplyUpdateOne) Where(ps ...predicate.Reply) *ReplyUpdateOne

Where appends a list predicates to the ReplyUpdate builder.

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 SiteDetail

type SiteDetail struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// Phone holds the value of the "phone" field.
	Phone string `json:"phone,omitempty"`
	// Address holds the value of the "address" field.
	Address string `json:"address,omitempty"`
	// Fb holds the value of the "fb" field.
	Fb string `json:"fb,omitempty"`
	// Tw holds the value of the "tw" field.
	Tw string `json:"tw,omitempty"`
	// Wh holds the value of the "wh" field.
	Wh string `json:"wh,omitempty"`
	// Ig holds the value of the "ig" field.
	Ig string `json:"ig,omitempty"`
	// contains filtered or unexported fields
}

SiteDetail is the model entity for the SiteDetail schema.

func (*SiteDetail) String

func (sd *SiteDetail) String() string

String implements the fmt.Stringer.

func (*SiteDetail) Unwrap

func (sd *SiteDetail) Unwrap() *SiteDetail

Unwrap unwraps the SiteDetail 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 (*SiteDetail) Update

func (sd *SiteDetail) Update() *SiteDetailUpdateOne

Update returns a builder for updating this SiteDetail. Note that you need to call SiteDetail.Unwrap() before calling this method if this SiteDetail was returned from a transaction, and the transaction was committed or rolled back.

func (*SiteDetail) Value

func (sd *SiteDetail) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the SiteDetail. This includes values selected through modifiers, order, etc.

type SiteDetailClient

type SiteDetailClient struct {
	// contains filtered or unexported fields
}

SiteDetailClient is a client for the SiteDetail schema.

func NewSiteDetailClient

func NewSiteDetailClient(c config) *SiteDetailClient

NewSiteDetailClient returns a client for the SiteDetail from the given config.

func (*SiteDetailClient) Create

func (c *SiteDetailClient) Create() *SiteDetailCreate

Create returns a builder for creating a SiteDetail entity.

func (*SiteDetailClient) CreateBulk

func (c *SiteDetailClient) CreateBulk(builders ...*SiteDetailCreate) *SiteDetailCreateBulk

CreateBulk returns a builder for creating a bulk of SiteDetail entities.

func (*SiteDetailClient) Delete

func (c *SiteDetailClient) Delete() *SiteDetailDelete

Delete returns a delete builder for SiteDetail.

func (*SiteDetailClient) DeleteOne

func (c *SiteDetailClient) DeleteOne(sd *SiteDetail) *SiteDetailDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SiteDetailClient) DeleteOneID

func (c *SiteDetailClient) DeleteOneID(id uuid.UUID) *SiteDetailDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*SiteDetailClient) Get

Get returns a SiteDetail entity by its id.

func (*SiteDetailClient) GetX

func (c *SiteDetailClient) GetX(ctx context.Context, id uuid.UUID) *SiteDetail

GetX is like Get, but panics if an error occurs.

func (*SiteDetailClient) Hooks

func (c *SiteDetailClient) Hooks() []Hook

Hooks returns the client hooks.

func (*SiteDetailClient) Intercept

func (c *SiteDetailClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `sitedetail.Intercept(f(g(h())))`.

func (*SiteDetailClient) Interceptors

func (c *SiteDetailClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*SiteDetailClient) MapCreateBulk

func (c *SiteDetailClient) MapCreateBulk(slice any, setFunc func(*SiteDetailCreate, int)) *SiteDetailCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*SiteDetailClient) Query

func (c *SiteDetailClient) Query() *SiteDetailQuery

Query returns a query builder for SiteDetail.

func (*SiteDetailClient) Update

func (c *SiteDetailClient) Update() *SiteDetailUpdate

Update returns an update builder for SiteDetail.

func (*SiteDetailClient) UpdateOne

func (c *SiteDetailClient) UpdateOne(sd *SiteDetail) *SiteDetailUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SiteDetailClient) UpdateOneID

func (c *SiteDetailClient) UpdateOneID(id uuid.UUID) *SiteDetailUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SiteDetailClient) Use

func (c *SiteDetailClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `sitedetail.Hooks(f(g(h())))`.

type SiteDetailCreate

type SiteDetailCreate struct {
	// contains filtered or unexported fields
}

SiteDetailCreate is the builder for creating a SiteDetail entity.

func (*SiteDetailCreate) Exec

func (sdc *SiteDetailCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SiteDetailCreate) ExecX

func (sdc *SiteDetailCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SiteDetailCreate) Mutation

func (sdc *SiteDetailCreate) Mutation() *SiteDetailMutation

Mutation returns the SiteDetailMutation object of the builder.

func (*SiteDetailCreate) Save

func (sdc *SiteDetailCreate) Save(ctx context.Context) (*SiteDetail, error)

Save creates the SiteDetail in the database.

func (*SiteDetailCreate) SaveX

func (sdc *SiteDetailCreate) SaveX(ctx context.Context) *SiteDetail

SaveX calls Save and panics if Save returns an error.

func (*SiteDetailCreate) SetAddress

func (sdc *SiteDetailCreate) SetAddress(s string) *SiteDetailCreate

SetAddress sets the "address" field.

func (*SiteDetailCreate) SetCreatedAt

func (sdc *SiteDetailCreate) SetCreatedAt(t time.Time) *SiteDetailCreate

SetCreatedAt sets the "created_at" field.

func (*SiteDetailCreate) SetEmail

func (sdc *SiteDetailCreate) SetEmail(s string) *SiteDetailCreate

SetEmail sets the "email" field.

func (*SiteDetailCreate) SetFb

func (sdc *SiteDetailCreate) SetFb(s string) *SiteDetailCreate

SetFb sets the "fb" field.

func (*SiteDetailCreate) SetID

func (sdc *SiteDetailCreate) SetID(u uuid.UUID) *SiteDetailCreate

SetID sets the "id" field.

func (*SiteDetailCreate) SetIg

func (sdc *SiteDetailCreate) SetIg(s string) *SiteDetailCreate

SetIg sets the "ig" field.

func (*SiteDetailCreate) SetName

func (sdc *SiteDetailCreate) SetName(s string) *SiteDetailCreate

SetName sets the "name" field.

func (*SiteDetailCreate) SetNillableAddress

func (sdc *SiteDetailCreate) SetNillableAddress(s *string) *SiteDetailCreate

SetNillableAddress sets the "address" field if the given value is not nil.

func (*SiteDetailCreate) SetNillableCreatedAt

func (sdc *SiteDetailCreate) SetNillableCreatedAt(t *time.Time) *SiteDetailCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*SiteDetailCreate) SetNillableEmail

func (sdc *SiteDetailCreate) SetNillableEmail(s *string) *SiteDetailCreate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*SiteDetailCreate) SetNillableFb

func (sdc *SiteDetailCreate) SetNillableFb(s *string) *SiteDetailCreate

SetNillableFb sets the "fb" field if the given value is not nil.

func (*SiteDetailCreate) SetNillableID

func (sdc *SiteDetailCreate) SetNillableID(u *uuid.UUID) *SiteDetailCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*SiteDetailCreate) SetNillableIg

func (sdc *SiteDetailCreate) SetNillableIg(s *string) *SiteDetailCreate

SetNillableIg sets the "ig" field if the given value is not nil.

func (*SiteDetailCreate) SetNillableName

func (sdc *SiteDetailCreate) SetNillableName(s *string) *SiteDetailCreate

SetNillableName sets the "name" field if the given value is not nil.

func (*SiteDetailCreate) SetNillablePhone

func (sdc *SiteDetailCreate) SetNillablePhone(s *string) *SiteDetailCreate

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*SiteDetailCreate) SetNillableTw

func (sdc *SiteDetailCreate) SetNillableTw(s *string) *SiteDetailCreate

SetNillableTw sets the "tw" field if the given value is not nil.

func (*SiteDetailCreate) SetNillableUpdatedAt

func (sdc *SiteDetailCreate) SetNillableUpdatedAt(t *time.Time) *SiteDetailCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*SiteDetailCreate) SetNillableWh

func (sdc *SiteDetailCreate) SetNillableWh(s *string) *SiteDetailCreate

SetNillableWh sets the "wh" field if the given value is not nil.

func (*SiteDetailCreate) SetPhone

func (sdc *SiteDetailCreate) SetPhone(s string) *SiteDetailCreate

SetPhone sets the "phone" field.

func (*SiteDetailCreate) SetTw

func (sdc *SiteDetailCreate) SetTw(s string) *SiteDetailCreate

SetTw sets the "tw" field.

func (*SiteDetailCreate) SetUpdatedAt

func (sdc *SiteDetailCreate) SetUpdatedAt(t time.Time) *SiteDetailCreate

SetUpdatedAt sets the "updated_at" field.

func (*SiteDetailCreate) SetWh

func (sdc *SiteDetailCreate) SetWh(s string) *SiteDetailCreate

SetWh sets the "wh" field.

type SiteDetailCreateBulk

type SiteDetailCreateBulk struct {
	// contains filtered or unexported fields
}

SiteDetailCreateBulk is the builder for creating many SiteDetail entities in bulk.

func (*SiteDetailCreateBulk) Exec

func (sdcb *SiteDetailCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SiteDetailCreateBulk) ExecX

func (sdcb *SiteDetailCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SiteDetailCreateBulk) Save

func (sdcb *SiteDetailCreateBulk) Save(ctx context.Context) ([]*SiteDetail, error)

Save creates the SiteDetail entities in the database.

func (*SiteDetailCreateBulk) SaveX

func (sdcb *SiteDetailCreateBulk) SaveX(ctx context.Context) []*SiteDetail

SaveX is like Save, but panics if an error occurs.

type SiteDetailDelete

type SiteDetailDelete struct {
	// contains filtered or unexported fields
}

SiteDetailDelete is the builder for deleting a SiteDetail entity.

func (*SiteDetailDelete) Exec

func (sdd *SiteDetailDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*SiteDetailDelete) ExecX

func (sdd *SiteDetailDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*SiteDetailDelete) Where

Where appends a list predicates to the SiteDetailDelete builder.

type SiteDetailDeleteOne

type SiteDetailDeleteOne struct {
	// contains filtered or unexported fields
}

SiteDetailDeleteOne is the builder for deleting a single SiteDetail entity.

func (*SiteDetailDeleteOne) Exec

func (sddo *SiteDetailDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SiteDetailDeleteOne) ExecX

func (sddo *SiteDetailDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SiteDetailDeleteOne) Where

Where appends a list predicates to the SiteDetailDelete builder.

type SiteDetailGroupBy

type SiteDetailGroupBy struct {
	// contains filtered or unexported fields
}

SiteDetailGroupBy is the group-by builder for SiteDetail entities.

func (*SiteDetailGroupBy) Aggregate

func (sdgb *SiteDetailGroupBy) Aggregate(fns ...AggregateFunc) *SiteDetailGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*SiteDetailGroupBy) Bool

func (s *SiteDetailGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SiteDetailGroupBy) BoolX

func (s *SiteDetailGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SiteDetailGroupBy) Bools

func (s *SiteDetailGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SiteDetailGroupBy) BoolsX

func (s *SiteDetailGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SiteDetailGroupBy) Float64

func (s *SiteDetailGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SiteDetailGroupBy) Float64X

func (s *SiteDetailGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SiteDetailGroupBy) Float64s

func (s *SiteDetailGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SiteDetailGroupBy) Float64sX

func (s *SiteDetailGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SiteDetailGroupBy) Int

func (s *SiteDetailGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SiteDetailGroupBy) IntX

func (s *SiteDetailGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SiteDetailGroupBy) Ints

func (s *SiteDetailGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SiteDetailGroupBy) IntsX

func (s *SiteDetailGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SiteDetailGroupBy) Scan

func (sdgb *SiteDetailGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SiteDetailGroupBy) ScanX

func (s *SiteDetailGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SiteDetailGroupBy) String

func (s *SiteDetailGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SiteDetailGroupBy) StringX

func (s *SiteDetailGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SiteDetailGroupBy) Strings

func (s *SiteDetailGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SiteDetailGroupBy) StringsX

func (s *SiteDetailGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SiteDetailMutation

type SiteDetailMutation struct {
	// contains filtered or unexported fields
}

SiteDetailMutation represents an operation that mutates the SiteDetail nodes in the graph.

func (*SiteDetailMutation) AddField

func (m *SiteDetailMutation) 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 (*SiteDetailMutation) AddedEdges

func (m *SiteDetailMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*SiteDetailMutation) AddedField

func (m *SiteDetailMutation) 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 (*SiteDetailMutation) AddedFields

func (m *SiteDetailMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*SiteDetailMutation) AddedIDs

func (m *SiteDetailMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*SiteDetailMutation) Address

func (m *SiteDetailMutation) Address() (r string, exists bool)

Address returns the value of the "address" field in the mutation.

func (*SiteDetailMutation) ClearEdge

func (m *SiteDetailMutation) 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 (*SiteDetailMutation) ClearField

func (m *SiteDetailMutation) 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 (*SiteDetailMutation) ClearedEdges

func (m *SiteDetailMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*SiteDetailMutation) ClearedFields

func (m *SiteDetailMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (SiteDetailMutation) Client

func (m SiteDetailMutation) 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 (*SiteDetailMutation) CreatedAt

func (m *SiteDetailMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*SiteDetailMutation) EdgeCleared

func (m *SiteDetailMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*SiteDetailMutation) Email

func (m *SiteDetailMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*SiteDetailMutation) Fb

func (m *SiteDetailMutation) Fb() (r string, exists bool)

Fb returns the value of the "fb" field in the mutation.

func (*SiteDetailMutation) Field

func (m *SiteDetailMutation) 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 (*SiteDetailMutation) FieldCleared

func (m *SiteDetailMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*SiteDetailMutation) Fields

func (m *SiteDetailMutation) 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 (*SiteDetailMutation) ID

func (m *SiteDetailMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*SiteDetailMutation) IDs

func (m *SiteDetailMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*SiteDetailMutation) Ig

func (m *SiteDetailMutation) Ig() (r string, exists bool)

Ig returns the value of the "ig" field in the mutation.

func (*SiteDetailMutation) Name

func (m *SiteDetailMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*SiteDetailMutation) OldAddress

func (m *SiteDetailMutation) OldAddress(ctx context.Context) (v string, err error)

OldAddress returns the old "address" field's value of the SiteDetail entity. If the SiteDetail 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 (*SiteDetailMutation) OldCreatedAt

func (m *SiteDetailMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the SiteDetail entity. If the SiteDetail 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 (*SiteDetailMutation) OldEmail

func (m *SiteDetailMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" field's value of the SiteDetail entity. If the SiteDetail 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 (*SiteDetailMutation) OldFb

func (m *SiteDetailMutation) OldFb(ctx context.Context) (v string, err error)

OldFb returns the old "fb" field's value of the SiteDetail entity. If the SiteDetail 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 (*SiteDetailMutation) OldField

func (m *SiteDetailMutation) 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 (*SiteDetailMutation) OldIg

func (m *SiteDetailMutation) OldIg(ctx context.Context) (v string, err error)

OldIg returns the old "ig" field's value of the SiteDetail entity. If the SiteDetail 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 (*SiteDetailMutation) OldName

func (m *SiteDetailMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the SiteDetail entity. If the SiteDetail 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 (*SiteDetailMutation) OldPhone

func (m *SiteDetailMutation) OldPhone(ctx context.Context) (v string, err error)

OldPhone returns the old "phone" field's value of the SiteDetail entity. If the SiteDetail 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 (*SiteDetailMutation) OldTw

func (m *SiteDetailMutation) OldTw(ctx context.Context) (v string, err error)

OldTw returns the old "tw" field's value of the SiteDetail entity. If the SiteDetail 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 (*SiteDetailMutation) OldUpdatedAt

func (m *SiteDetailMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the SiteDetail entity. If the SiteDetail 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 (*SiteDetailMutation) OldWh

func (m *SiteDetailMutation) OldWh(ctx context.Context) (v string, err error)

OldWh returns the old "wh" field's value of the SiteDetail entity. If the SiteDetail 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 (*SiteDetailMutation) Op

func (m *SiteDetailMutation) Op() Op

Op returns the operation name.

func (*SiteDetailMutation) Phone

func (m *SiteDetailMutation) Phone() (r string, exists bool)

Phone returns the value of the "phone" field in the mutation.

func (*SiteDetailMutation) RemovedEdges

func (m *SiteDetailMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*SiteDetailMutation) RemovedIDs

func (m *SiteDetailMutation) 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 (*SiteDetailMutation) ResetAddress

func (m *SiteDetailMutation) ResetAddress()

ResetAddress resets all changes to the "address" field.

func (*SiteDetailMutation) ResetCreatedAt

func (m *SiteDetailMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*SiteDetailMutation) ResetEdge

func (m *SiteDetailMutation) 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 (*SiteDetailMutation) ResetEmail

func (m *SiteDetailMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*SiteDetailMutation) ResetFb

func (m *SiteDetailMutation) ResetFb()

ResetFb resets all changes to the "fb" field.

func (*SiteDetailMutation) ResetField

func (m *SiteDetailMutation) 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 (*SiteDetailMutation) ResetIg

func (m *SiteDetailMutation) ResetIg()

ResetIg resets all changes to the "ig" field.

func (*SiteDetailMutation) ResetName

func (m *SiteDetailMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*SiteDetailMutation) ResetPhone

func (m *SiteDetailMutation) ResetPhone()

ResetPhone resets all changes to the "phone" field.

func (*SiteDetailMutation) ResetTw

func (m *SiteDetailMutation) ResetTw()

ResetTw resets all changes to the "tw" field.

func (*SiteDetailMutation) ResetUpdatedAt

func (m *SiteDetailMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*SiteDetailMutation) ResetWh

func (m *SiteDetailMutation) ResetWh()

ResetWh resets all changes to the "wh" field.

func (*SiteDetailMutation) SetAddress

func (m *SiteDetailMutation) SetAddress(s string)

SetAddress sets the "address" field.

func (*SiteDetailMutation) SetCreatedAt

func (m *SiteDetailMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*SiteDetailMutation) SetEmail

func (m *SiteDetailMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*SiteDetailMutation) SetFb

func (m *SiteDetailMutation) SetFb(s string)

SetFb sets the "fb" field.

func (*SiteDetailMutation) SetField

func (m *SiteDetailMutation) 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 (*SiteDetailMutation) SetID

func (m *SiteDetailMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of SiteDetail entities.

func (*SiteDetailMutation) SetIg

func (m *SiteDetailMutation) SetIg(s string)

SetIg sets the "ig" field.

func (*SiteDetailMutation) SetName

func (m *SiteDetailMutation) SetName(s string)

SetName sets the "name" field.

func (*SiteDetailMutation) SetOp

func (m *SiteDetailMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SiteDetailMutation) SetPhone

func (m *SiteDetailMutation) SetPhone(s string)

SetPhone sets the "phone" field.

func (*SiteDetailMutation) SetTw

func (m *SiteDetailMutation) SetTw(s string)

SetTw sets the "tw" field.

func (*SiteDetailMutation) SetUpdatedAt

func (m *SiteDetailMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*SiteDetailMutation) SetWh

func (m *SiteDetailMutation) SetWh(s string)

SetWh sets the "wh" field.

func (*SiteDetailMutation) Tw

func (m *SiteDetailMutation) Tw() (r string, exists bool)

Tw returns the value of the "tw" field in the mutation.

func (SiteDetailMutation) Tx

func (m SiteDetailMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*SiteDetailMutation) Type

func (m *SiteDetailMutation) Type() string

Type returns the node type of this mutation (SiteDetail).

func (*SiteDetailMutation) UpdatedAt

func (m *SiteDetailMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*SiteDetailMutation) Wh

func (m *SiteDetailMutation) Wh() (r string, exists bool)

Wh returns the value of the "wh" field in the mutation.

func (*SiteDetailMutation) Where

func (m *SiteDetailMutation) Where(ps ...predicate.SiteDetail)

Where appends a list predicates to the SiteDetailMutation builder.

func (*SiteDetailMutation) WhereP

func (m *SiteDetailMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the SiteDetailMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type SiteDetailQuery

type SiteDetailQuery struct {
	// contains filtered or unexported fields
}

SiteDetailQuery is the builder for querying SiteDetail entities.

func (*SiteDetailQuery) Aggregate

func (sdq *SiteDetailQuery) Aggregate(fns ...AggregateFunc) *SiteDetailSelect

Aggregate returns a SiteDetailSelect configured with the given aggregations.

func (*SiteDetailQuery) All

func (sdq *SiteDetailQuery) All(ctx context.Context) ([]*SiteDetail, error)

All executes the query and returns a list of SiteDetails.

func (*SiteDetailQuery) AllX

func (sdq *SiteDetailQuery) AllX(ctx context.Context) []*SiteDetail

AllX is like All, but panics if an error occurs.

func (*SiteDetailQuery) Clone

func (sdq *SiteDetailQuery) Clone() *SiteDetailQuery

Clone returns a duplicate of the SiteDetailQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*SiteDetailQuery) Count

func (sdq *SiteDetailQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SiteDetailQuery) CountX

func (sdq *SiteDetailQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*SiteDetailQuery) Exist

func (sdq *SiteDetailQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*SiteDetailQuery) ExistX

func (sdq *SiteDetailQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*SiteDetailQuery) First

func (sdq *SiteDetailQuery) First(ctx context.Context) (*SiteDetail, error)

First returns the first SiteDetail entity from the query. Returns a *NotFoundError when no SiteDetail was found.

func (*SiteDetailQuery) FirstID

func (sdq *SiteDetailQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first SiteDetail ID from the query. Returns a *NotFoundError when no SiteDetail ID was found.

func (*SiteDetailQuery) FirstIDX

func (sdq *SiteDetailQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*SiteDetailQuery) FirstX

func (sdq *SiteDetailQuery) FirstX(ctx context.Context) *SiteDetail

FirstX is like First, but panics if an error occurs.

func (*SiteDetailQuery) GroupBy

func (sdq *SiteDetailQuery) GroupBy(field string, fields ...string) *SiteDetailGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.SiteDetail.Query().
	GroupBy(sitedetail.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SiteDetailQuery) IDs

func (sdq *SiteDetailQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of SiteDetail IDs.

func (*SiteDetailQuery) IDsX

func (sdq *SiteDetailQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*SiteDetailQuery) Limit

func (sdq *SiteDetailQuery) Limit(limit int) *SiteDetailQuery

Limit the number of records to be returned by this query.

func (*SiteDetailQuery) Offset

func (sdq *SiteDetailQuery) Offset(offset int) *SiteDetailQuery

Offset to start from.

func (*SiteDetailQuery) Only

func (sdq *SiteDetailQuery) Only(ctx context.Context) (*SiteDetail, error)

Only returns a single SiteDetail entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one SiteDetail entity is found. Returns a *NotFoundError when no SiteDetail entities are found.

func (*SiteDetailQuery) OnlyID

func (sdq *SiteDetailQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only SiteDetail ID in the query. Returns a *NotSingularError when more than one SiteDetail ID is found. Returns a *NotFoundError when no entities are found.

func (*SiteDetailQuery) OnlyIDX

func (sdq *SiteDetailQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*SiteDetailQuery) OnlyX

func (sdq *SiteDetailQuery) OnlyX(ctx context.Context) *SiteDetail

OnlyX is like Only, but panics if an error occurs.

func (*SiteDetailQuery) Order

Order specifies how the records should be ordered.

func (*SiteDetailQuery) Select

func (sdq *SiteDetailQuery) Select(fields ...string) *SiteDetailSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.SiteDetail.Query().
	Select(sitedetail.FieldCreatedAt).
	Scan(ctx, &v)

func (*SiteDetailQuery) Unique

func (sdq *SiteDetailQuery) Unique(unique bool) *SiteDetailQuery

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 (*SiteDetailQuery) Where

Where adds a new predicate for the SiteDetailQuery builder.

type SiteDetailSelect

type SiteDetailSelect struct {
	*SiteDetailQuery
	// contains filtered or unexported fields
}

SiteDetailSelect is the builder for selecting fields of SiteDetail entities.

func (*SiteDetailSelect) Aggregate

func (sds *SiteDetailSelect) Aggregate(fns ...AggregateFunc) *SiteDetailSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SiteDetailSelect) Bool

func (s *SiteDetailSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SiteDetailSelect) BoolX

func (s *SiteDetailSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SiteDetailSelect) Bools

func (s *SiteDetailSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SiteDetailSelect) BoolsX

func (s *SiteDetailSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SiteDetailSelect) Float64

func (s *SiteDetailSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SiteDetailSelect) Float64X

func (s *SiteDetailSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SiteDetailSelect) Float64s

func (s *SiteDetailSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SiteDetailSelect) Float64sX

func (s *SiteDetailSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SiteDetailSelect) Int

func (s *SiteDetailSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SiteDetailSelect) IntX

func (s *SiteDetailSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SiteDetailSelect) Ints

func (s *SiteDetailSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SiteDetailSelect) IntsX

func (s *SiteDetailSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SiteDetailSelect) Scan

func (sds *SiteDetailSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SiteDetailSelect) ScanX

func (s *SiteDetailSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SiteDetailSelect) String

func (s *SiteDetailSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SiteDetailSelect) StringX

func (s *SiteDetailSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SiteDetailSelect) Strings

func (s *SiteDetailSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SiteDetailSelect) StringsX

func (s *SiteDetailSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SiteDetailUpdate

type SiteDetailUpdate struct {
	// contains filtered or unexported fields
}

SiteDetailUpdate is the builder for updating SiteDetail entities.

func (*SiteDetailUpdate) Exec

func (sdu *SiteDetailUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SiteDetailUpdate) ExecX

func (sdu *SiteDetailUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SiteDetailUpdate) Mutation

func (sdu *SiteDetailUpdate) Mutation() *SiteDetailMutation

Mutation returns the SiteDetailMutation object of the builder.

func (*SiteDetailUpdate) Save

func (sdu *SiteDetailUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*SiteDetailUpdate) SaveX

func (sdu *SiteDetailUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SiteDetailUpdate) SetAddress

func (sdu *SiteDetailUpdate) SetAddress(s string) *SiteDetailUpdate

SetAddress sets the "address" field.

func (*SiteDetailUpdate) SetCreatedAt

func (sdu *SiteDetailUpdate) SetCreatedAt(t time.Time) *SiteDetailUpdate

SetCreatedAt sets the "created_at" field.

func (*SiteDetailUpdate) SetEmail

func (sdu *SiteDetailUpdate) SetEmail(s string) *SiteDetailUpdate

SetEmail sets the "email" field.

func (*SiteDetailUpdate) SetFb

func (sdu *SiteDetailUpdate) SetFb(s string) *SiteDetailUpdate

SetFb sets the "fb" field.

func (*SiteDetailUpdate) SetIg

func (sdu *SiteDetailUpdate) SetIg(s string) *SiteDetailUpdate

SetIg sets the "ig" field.

func (*SiteDetailUpdate) SetName

func (sdu *SiteDetailUpdate) SetName(s string) *SiteDetailUpdate

SetName sets the "name" field.

func (*SiteDetailUpdate) SetNillableAddress

func (sdu *SiteDetailUpdate) SetNillableAddress(s *string) *SiteDetailUpdate

SetNillableAddress sets the "address" field if the given value is not nil.

func (*SiteDetailUpdate) SetNillableCreatedAt

func (sdu *SiteDetailUpdate) SetNillableCreatedAt(t *time.Time) *SiteDetailUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*SiteDetailUpdate) SetNillableEmail

func (sdu *SiteDetailUpdate) SetNillableEmail(s *string) *SiteDetailUpdate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*SiteDetailUpdate) SetNillableFb

func (sdu *SiteDetailUpdate) SetNillableFb(s *string) *SiteDetailUpdate

SetNillableFb sets the "fb" field if the given value is not nil.

func (*SiteDetailUpdate) SetNillableIg

func (sdu *SiteDetailUpdate) SetNillableIg(s *string) *SiteDetailUpdate

SetNillableIg sets the "ig" field if the given value is not nil.

func (*SiteDetailUpdate) SetNillableName

func (sdu *SiteDetailUpdate) SetNillableName(s *string) *SiteDetailUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*SiteDetailUpdate) SetNillablePhone

func (sdu *SiteDetailUpdate) SetNillablePhone(s *string) *SiteDetailUpdate

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*SiteDetailUpdate) SetNillableTw

func (sdu *SiteDetailUpdate) SetNillableTw(s *string) *SiteDetailUpdate

SetNillableTw sets the "tw" field if the given value is not nil.

func (*SiteDetailUpdate) SetNillableWh

func (sdu *SiteDetailUpdate) SetNillableWh(s *string) *SiteDetailUpdate

SetNillableWh sets the "wh" field if the given value is not nil.

func (*SiteDetailUpdate) SetPhone

func (sdu *SiteDetailUpdate) SetPhone(s string) *SiteDetailUpdate

SetPhone sets the "phone" field.

func (*SiteDetailUpdate) SetTw

func (sdu *SiteDetailUpdate) SetTw(s string) *SiteDetailUpdate

SetTw sets the "tw" field.

func (*SiteDetailUpdate) SetUpdatedAt

func (sdu *SiteDetailUpdate) SetUpdatedAt(t time.Time) *SiteDetailUpdate

SetUpdatedAt sets the "updated_at" field.

func (*SiteDetailUpdate) SetWh

func (sdu *SiteDetailUpdate) SetWh(s string) *SiteDetailUpdate

SetWh sets the "wh" field.

func (*SiteDetailUpdate) Where

Where appends a list predicates to the SiteDetailUpdate builder.

type SiteDetailUpdateOne

type SiteDetailUpdateOne struct {
	// contains filtered or unexported fields
}

SiteDetailUpdateOne is the builder for updating a single SiteDetail entity.

func (*SiteDetailUpdateOne) Exec

func (sduo *SiteDetailUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SiteDetailUpdateOne) ExecX

func (sduo *SiteDetailUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SiteDetailUpdateOne) Mutation

func (sduo *SiteDetailUpdateOne) Mutation() *SiteDetailMutation

Mutation returns the SiteDetailMutation object of the builder.

func (*SiteDetailUpdateOne) Save

func (sduo *SiteDetailUpdateOne) Save(ctx context.Context) (*SiteDetail, error)

Save executes the query and returns the updated SiteDetail entity.

func (*SiteDetailUpdateOne) SaveX

func (sduo *SiteDetailUpdateOne) SaveX(ctx context.Context) *SiteDetail

SaveX is like Save, but panics if an error occurs.

func (*SiteDetailUpdateOne) Select

func (sduo *SiteDetailUpdateOne) Select(field string, fields ...string) *SiteDetailUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SiteDetailUpdateOne) SetAddress

func (sduo *SiteDetailUpdateOne) SetAddress(s string) *SiteDetailUpdateOne

SetAddress sets the "address" field.

func (*SiteDetailUpdateOne) SetCreatedAt

func (sduo *SiteDetailUpdateOne) SetCreatedAt(t time.Time) *SiteDetailUpdateOne

SetCreatedAt sets the "created_at" field.

func (*SiteDetailUpdateOne) SetEmail

func (sduo *SiteDetailUpdateOne) SetEmail(s string) *SiteDetailUpdateOne

SetEmail sets the "email" field.

func (*SiteDetailUpdateOne) SetFb

SetFb sets the "fb" field.

func (*SiteDetailUpdateOne) SetIg

SetIg sets the "ig" field.

func (*SiteDetailUpdateOne) SetName

SetName sets the "name" field.

func (*SiteDetailUpdateOne) SetNillableAddress

func (sduo *SiteDetailUpdateOne) SetNillableAddress(s *string) *SiteDetailUpdateOne

SetNillableAddress sets the "address" field if the given value is not nil.

func (*SiteDetailUpdateOne) SetNillableCreatedAt

func (sduo *SiteDetailUpdateOne) SetNillableCreatedAt(t *time.Time) *SiteDetailUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*SiteDetailUpdateOne) SetNillableEmail

func (sduo *SiteDetailUpdateOne) SetNillableEmail(s *string) *SiteDetailUpdateOne

SetNillableEmail sets the "email" field if the given value is not nil.

func (*SiteDetailUpdateOne) SetNillableFb

func (sduo *SiteDetailUpdateOne) SetNillableFb(s *string) *SiteDetailUpdateOne

SetNillableFb sets the "fb" field if the given value is not nil.

func (*SiteDetailUpdateOne) SetNillableIg

func (sduo *SiteDetailUpdateOne) SetNillableIg(s *string) *SiteDetailUpdateOne

SetNillableIg sets the "ig" field if the given value is not nil.

func (*SiteDetailUpdateOne) SetNillableName

func (sduo *SiteDetailUpdateOne) SetNillableName(s *string) *SiteDetailUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*SiteDetailUpdateOne) SetNillablePhone

func (sduo *SiteDetailUpdateOne) SetNillablePhone(s *string) *SiteDetailUpdateOne

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*SiteDetailUpdateOne) SetNillableTw

func (sduo *SiteDetailUpdateOne) SetNillableTw(s *string) *SiteDetailUpdateOne

SetNillableTw sets the "tw" field if the given value is not nil.

func (*SiteDetailUpdateOne) SetNillableWh

func (sduo *SiteDetailUpdateOne) SetNillableWh(s *string) *SiteDetailUpdateOne

SetNillableWh sets the "wh" field if the given value is not nil.

func (*SiteDetailUpdateOne) SetPhone

func (sduo *SiteDetailUpdateOne) SetPhone(s string) *SiteDetailUpdateOne

SetPhone sets the "phone" field.

func (*SiteDetailUpdateOne) SetTw

SetTw sets the "tw" field.

func (*SiteDetailUpdateOne) SetUpdatedAt

func (sduo *SiteDetailUpdateOne) SetUpdatedAt(t time.Time) *SiteDetailUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*SiteDetailUpdateOne) SetWh

SetWh sets the "wh" field.

func (*SiteDetailUpdateOne) Where

Where appends a list predicates to the SiteDetailUpdate builder.

type SiteDetails

type SiteDetails []*SiteDetail

SiteDetails is a parsable slice of SiteDetail.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser

type Traverser = ent.Traverser

ent aliases to avoid import conflicts in user's code.

type Tx

type Tx struct {

	// Chat is the client for interacting with the Chat builders.
	Chat *ChatClient
	// City is the client for interacting with the City builders.
	City *CityClient
	// Comment is the client for interacting with the Comment builders.
	Comment *CommentClient
	// Country is the client for interacting with the Country builders.
	Country *CountryClient
	// File is the client for interacting with the File builders.
	File *FileClient
	// Friend is the client for interacting with the Friend builders.
	Friend *FriendClient
	// Message is the client for interacting with the Message builders.
	Message *MessageClient
	// Notification is the client for interacting with the Notification builders.
	Notification *NotificationClient
	// Otp is the client for interacting with the Otp builders.
	Otp *OtpClient
	// Post is the client for interacting with the Post builders.
	Post *PostClient
	// Reaction is the client for interacting with the Reaction builders.
	Reaction *ReactionClient
	// Region is the client for interacting with the Region builders.
	Region *RegionClient
	// Reply is the client for interacting with the Reply builders.
	Reply *ReplyClient
	// SiteDetail is the client for interacting with the SiteDetail builders.
	SiteDetail *SiteDetailClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type User

type User struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// FirstName holds the value of the "first_name" field.
	FirstName string `json:"first_name,omitempty"`
	// LastName holds the value of the "last_name" field.
	LastName string `json:"last_name,omitempty"`
	// Username holds the value of the "username" field.
	Username string `json:"username,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// Password holds the value of the "password" field.
	Password string `json:"password,omitempty"`
	// TermsAgreement holds the value of the "terms_agreement" field.
	TermsAgreement bool `json:"terms_agreement,omitempty"`
	// IsEmailVerified holds the value of the "is_email_verified" field.
	IsEmailVerified bool `json:"is_email_verified,omitempty"`
	// IsStaff holds the value of the "is_staff" field.
	IsStaff bool `json:"is_staff,omitempty"`
	// IsActive holds the value of the "is_active" field.
	IsActive bool `json:"is_active,omitempty"`
	// Bio holds the value of the "bio" field.
	Bio *string `json:"bio,omitempty"`
	// Dob holds the value of the "dob" field.
	Dob *time.Time `json:"dob,omitempty"`
	// Access holds the value of the "access" field.
	Access *string `json:"access,omitempty"`
	// Refresh holds the value of the "refresh" field.
	Refresh *string `json:"refresh,omitempty"`
	// CityID holds the value of the "city_id" field.
	CityID *uuid.UUID `json:"city_id,omitempty"`
	// AvatarID holds the value of the "avatar_id" field.
	AvatarID *uuid.UUID `json:"avatar_id,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) QueryAvatar

func (u *User) QueryAvatar() *FileQuery

QueryAvatar queries the "avatar" edge of the User entity.

func (*User) QueryCity

func (u *User) QueryCity() *CityQuery

QueryCity queries the "city" edge of the User entity.

func (*User) QueryComments

func (u *User) QueryComments() *CommentQuery

QueryComments queries the "comments" edge of the User entity.

func (*User) QueryMemberChats

func (u *User) QueryMemberChats() *ChatQuery

QueryMemberChats queries the "member_chats" edge of the User entity.

func (*User) QueryMessages

func (u *User) QueryMessages() *MessageQuery

QueryMessages queries the "messages" edge of the User entity.

func (*User) QueryNotifications

func (u *User) QueryNotifications() *NotificationQuery

QueryNotifications queries the "notifications" edge of the User entity.

func (*User) QueryNotificationsFrom

func (u *User) QueryNotificationsFrom() *NotificationQuery

QueryNotificationsFrom queries the "notifications_from" edge of the User entity.

func (*User) QueryNotificationsRead

func (u *User) QueryNotificationsRead() *NotificationQuery

QueryNotificationsRead queries the "notifications_read" edge of the User entity.

func (*User) QueryOtp

func (u *User) QueryOtp() *OtpQuery

QueryOtp queries the "otp" edge of the User entity.

func (*User) QueryOwnedChats

func (u *User) QueryOwnedChats() *ChatQuery

QueryOwnedChats queries the "owned_chats" edge of the User entity.

func (*User) QueryPosts

func (u *User) QueryPosts() *PostQuery

QueryPosts queries the "posts" edge of the User entity.

func (*User) QueryReactions

func (u *User) QueryReactions() *ReactionQuery

QueryReactions queries the "reactions" edge of the User entity.

func (*User) QueryReplies

func (u *User) QueryReplies() *ReplyQuery

QueryReplies queries the "replies" edge of the User entity.

func (*User) QueryRequesteeFriends

func (u *User) QueryRequesteeFriends() *FriendQuery

QueryRequesteeFriends queries the "requestee_friends" edge of the User entity.

func (*User) QueryRequesterFriends

func (u *User) QueryRequesterFriends() *FriendQuery

QueryRequesterFriends queries the "requester_friends" edge of the User entity.

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (u *User) Unwrap() *User

Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*User) Update

func (u *User) Update() *UserUpdateOne

Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.

func (*User) Value

func (u *User) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the User. This includes values selected through modifiers, order, etc.

type UserClient

type UserClient struct {
	// contains filtered or unexported fields
}

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a builder for creating a User entity.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

CreateBulk returns a builder for creating a bulk of User entities.

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(u *User) *UserDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id uuid.UUID) *UserDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id uuid.UUID) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id uuid.UUID) *User

GetX is like Get, but panics if an error occurs.

func (*UserClient) Hooks

func (c *UserClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserClient) Intercept

func (c *UserClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`.

func (*UserClient) Interceptors

func (c *UserClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*UserClient) MapCreateBulk

func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryAvatar

func (c *UserClient) QueryAvatar(u *User) *FileQuery

QueryAvatar queries the avatar edge of a User.

func (*UserClient) QueryCity

func (c *UserClient) QueryCity(u *User) *CityQuery

QueryCity queries the city edge of a User.

func (*UserClient) QueryComments

func (c *UserClient) QueryComments(u *User) *CommentQuery

QueryComments queries the comments edge of a User.

func (*UserClient) QueryMemberChats

func (c *UserClient) QueryMemberChats(u *User) *ChatQuery

QueryMemberChats queries the member_chats edge of a User.

func (*UserClient) QueryMessages

func (c *UserClient) QueryMessages(u *User) *MessageQuery

QueryMessages queries the messages edge of a User.

func (*UserClient) QueryNotifications

func (c *UserClient) QueryNotifications(u *User) *NotificationQuery

QueryNotifications queries the notifications edge of a User.

func (*UserClient) QueryNotificationsFrom

func (c *UserClient) QueryNotificationsFrom(u *User) *NotificationQuery

QueryNotificationsFrom queries the notifications_from edge of a User.

func (*UserClient) QueryNotificationsRead

func (c *UserClient) QueryNotificationsRead(u *User) *NotificationQuery

QueryNotificationsRead queries the notifications_read edge of a User.

func (*UserClient) QueryOtp

func (c *UserClient) QueryOtp(u *User) *OtpQuery

QueryOtp queries the otp edge of a User.

func (*UserClient) QueryOwnedChats

func (c *UserClient) QueryOwnedChats(u *User) *ChatQuery

QueryOwnedChats queries the owned_chats edge of a User.

func (*UserClient) QueryPosts

func (c *UserClient) QueryPosts(u *User) *PostQuery

QueryPosts queries the posts edge of a User.

func (*UserClient) QueryReactions

func (c *UserClient) QueryReactions(u *User) *ReactionQuery

QueryReactions queries the reactions edge of a User.

func (*UserClient) QueryReplies

func (c *UserClient) QueryReplies(u *User) *ReplyQuery

QueryReplies queries the replies edge of a User.

func (*UserClient) QueryRequesteeFriends

func (c *UserClient) QueryRequesteeFriends(u *User) *FriendQuery

QueryRequesteeFriends queries the requestee_friends edge of a User.

func (*UserClient) QueryRequesterFriends

func (c *UserClient) QueryRequesterFriends(u *User) *FriendQuery

QueryRequesterFriends queries the requester_friends edge of a User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(u *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id uuid.UUID) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

func (c *UserClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.

type UserCreate

type UserCreate struct {
	// contains filtered or unexported fields
}

UserCreate is the builder for creating a User entity.

func (*UserCreate) AddCommentIDs

func (uc *UserCreate) AddCommentIDs(ids ...uuid.UUID) *UserCreate

AddCommentIDs adds the "comments" edge to the Comment entity by IDs.

func (*UserCreate) AddComments

func (uc *UserCreate) AddComments(c ...*Comment) *UserCreate

AddComments adds the "comments" edges to the Comment entity.

func (*UserCreate) AddMemberChatIDs

func (uc *UserCreate) AddMemberChatIDs(ids ...uuid.UUID) *UserCreate

AddMemberChatIDs adds the "member_chats" edge to the Chat entity by IDs.

func (*UserCreate) AddMemberChats

func (uc *UserCreate) AddMemberChats(c ...*Chat) *UserCreate

AddMemberChats adds the "member_chats" edges to the Chat entity.

func (*UserCreate) AddMessageIDs

func (uc *UserCreate) AddMessageIDs(ids ...uuid.UUID) *UserCreate

AddMessageIDs adds the "messages" edge to the Message entity by IDs.

func (*UserCreate) AddMessages

func (uc *UserCreate) AddMessages(m ...*Message) *UserCreate

AddMessages adds the "messages" edges to the Message entity.

func (*UserCreate) AddNotificationIDs

func (uc *UserCreate) AddNotificationIDs(ids ...uuid.UUID) *UserCreate

AddNotificationIDs adds the "notifications" edge to the Notification entity by IDs.

func (*UserCreate) AddNotifications

func (uc *UserCreate) AddNotifications(n ...*Notification) *UserCreate

AddNotifications adds the "notifications" edges to the Notification entity.

func (*UserCreate) AddNotificationsFrom

func (uc *UserCreate) AddNotificationsFrom(n ...*Notification) *UserCreate

AddNotificationsFrom adds the "notifications_from" edges to the Notification entity.

func (*UserCreate) AddNotificationsFromIDs

func (uc *UserCreate) AddNotificationsFromIDs(ids ...uuid.UUID) *UserCreate

AddNotificationsFromIDs adds the "notifications_from" edge to the Notification entity by IDs.

func (*UserCreate) AddNotificationsRead

func (uc *UserCreate) AddNotificationsRead(n ...*Notification) *UserCreate

AddNotificationsRead adds the "notifications_read" edges to the Notification entity.

func (*UserCreate) AddNotificationsReadIDs

func (uc *UserCreate) AddNotificationsReadIDs(ids ...uuid.UUID) *UserCreate

AddNotificationsReadIDs adds the "notifications_read" edge to the Notification entity by IDs.

func (*UserCreate) AddOwnedChatIDs

func (uc *UserCreate) AddOwnedChatIDs(ids ...uuid.UUID) *UserCreate

AddOwnedChatIDs adds the "owned_chats" edge to the Chat entity by IDs.

func (*UserCreate) AddOwnedChats

func (uc *UserCreate) AddOwnedChats(c ...*Chat) *UserCreate

AddOwnedChats adds the "owned_chats" edges to the Chat entity.

func (*UserCreate) AddPostIDs

func (uc *UserCreate) AddPostIDs(ids ...uuid.UUID) *UserCreate

AddPostIDs adds the "posts" edge to the Post entity by IDs.

func (*UserCreate) AddPosts

func (uc *UserCreate) AddPosts(p ...*Post) *UserCreate

AddPosts adds the "posts" edges to the Post entity.

func (*UserCreate) AddReactionIDs

func (uc *UserCreate) AddReactionIDs(ids ...uuid.UUID) *UserCreate

AddReactionIDs adds the "reactions" edge to the Reaction entity by IDs.

func (*UserCreate) AddReactions

func (uc *UserCreate) AddReactions(r ...*Reaction) *UserCreate

AddReactions adds the "reactions" edges to the Reaction entity.

func (*UserCreate) AddReplies

func (uc *UserCreate) AddReplies(r ...*Reply) *UserCreate

AddReplies adds the "replies" edges to the Reply entity.

func (*UserCreate) AddReplyIDs

func (uc *UserCreate) AddReplyIDs(ids ...uuid.UUID) *UserCreate

AddReplyIDs adds the "replies" edge to the Reply entity by IDs.

func (*UserCreate) AddRequesteeFriendIDs

func (uc *UserCreate) AddRequesteeFriendIDs(ids ...uuid.UUID) *UserCreate

AddRequesteeFriendIDs adds the "requestee_friends" edge to the Friend entity by IDs.

func (*UserCreate) AddRequesteeFriends

func (uc *UserCreate) AddRequesteeFriends(f ...*Friend) *UserCreate

AddRequesteeFriends adds the "requestee_friends" edges to the Friend entity.

func (*UserCreate) AddRequesterFriendIDs

func (uc *UserCreate) AddRequesterFriendIDs(ids ...uuid.UUID) *UserCreate

AddRequesterFriendIDs adds the "requester_friends" edge to the Friend entity by IDs.

func (*UserCreate) AddRequesterFriends

func (uc *UserCreate) AddRequesterFriends(f ...*Friend) *UserCreate

AddRequesterFriends adds the "requester_friends" edges to the Friend 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) SetAccess

func (uc *UserCreate) SetAccess(s string) *UserCreate

SetAccess sets the "access" field.

func (*UserCreate) SetAvatar

func (uc *UserCreate) SetAvatar(f *File) *UserCreate

SetAvatar sets the "avatar" edge to the File entity.

func (*UserCreate) SetAvatarID

func (uc *UserCreate) SetAvatarID(u uuid.UUID) *UserCreate

SetAvatarID sets the "avatar_id" field.

func (*UserCreate) SetBio

func (uc *UserCreate) SetBio(s string) *UserCreate

SetBio sets the "bio" field.

func (*UserCreate) SetCity

func (uc *UserCreate) SetCity(c *City) *UserCreate

SetCity sets the "city" edge to the City entity.

func (*UserCreate) SetCityID

func (uc *UserCreate) SetCityID(u uuid.UUID) *UserCreate

SetCityID sets the "city_id" field.

func (*UserCreate) SetCreatedAt

func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate

SetCreatedAt sets the "created_at" field.

func (*UserCreate) SetDob

func (uc *UserCreate) SetDob(t time.Time) *UserCreate

SetDob sets the "dob" field.

func (*UserCreate) SetEmail

func (uc *UserCreate) SetEmail(s string) *UserCreate

SetEmail sets the "email" field.

func (*UserCreate) SetFirstName

func (uc *UserCreate) SetFirstName(s string) *UserCreate

SetFirstName sets the "first_name" field.

func (*UserCreate) SetID

func (uc *UserCreate) SetID(u uuid.UUID) *UserCreate

SetID sets the "id" field.

func (*UserCreate) SetIsActive

func (uc *UserCreate) SetIsActive(b bool) *UserCreate

SetIsActive sets the "is_active" field.

func (*UserCreate) SetIsEmailVerified

func (uc *UserCreate) SetIsEmailVerified(b bool) *UserCreate

SetIsEmailVerified sets the "is_email_verified" field.

func (*UserCreate) SetIsStaff

func (uc *UserCreate) SetIsStaff(b bool) *UserCreate

SetIsStaff sets the "is_staff" field.

func (*UserCreate) SetLastName

func (uc *UserCreate) SetLastName(s string) *UserCreate

SetLastName sets the "last_name" field.

func (*UserCreate) SetNillableAccess

func (uc *UserCreate) SetNillableAccess(s *string) *UserCreate

SetNillableAccess sets the "access" field if the given value is not nil.

func (*UserCreate) SetNillableAvatarID

func (uc *UserCreate) SetNillableAvatarID(u *uuid.UUID) *UserCreate

SetNillableAvatarID sets the "avatar_id" field if the given value is not nil.

func (*UserCreate) SetNillableBio

func (uc *UserCreate) SetNillableBio(s *string) *UserCreate

SetNillableBio sets the "bio" field if the given value is not nil.

func (*UserCreate) SetNillableCityID

func (uc *UserCreate) SetNillableCityID(u *uuid.UUID) *UserCreate

SetNillableCityID sets the "city_id" field if the given value is not nil.

func (*UserCreate) SetNillableCreatedAt

func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UserCreate) SetNillableDob

func (uc *UserCreate) SetNillableDob(t *time.Time) *UserCreate

SetNillableDob sets the "dob" field if the given value is not nil.

func (*UserCreate) SetNillableID

func (uc *UserCreate) SetNillableID(u *uuid.UUID) *UserCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*UserCreate) SetNillableIsActive

func (uc *UserCreate) SetNillableIsActive(b *bool) *UserCreate

SetNillableIsActive sets the "is_active" field if the given value is not nil.

func (*UserCreate) SetNillableIsEmailVerified

func (uc *UserCreate) SetNillableIsEmailVerified(b *bool) *UserCreate

SetNillableIsEmailVerified sets the "is_email_verified" field if the given value is not nil.

func (*UserCreate) SetNillableIsStaff

func (uc *UserCreate) SetNillableIsStaff(b *bool) *UserCreate

SetNillableIsStaff sets the "is_staff" field if the given value is not nil.

func (*UserCreate) SetNillableOtpID

func (uc *UserCreate) SetNillableOtpID(id *uuid.UUID) *UserCreate

SetNillableOtpID sets the "otp" edge to the Otp entity by ID if the given value is not nil.

func (*UserCreate) SetNillableRefresh

func (uc *UserCreate) SetNillableRefresh(s *string) *UserCreate

SetNillableRefresh sets the "refresh" field if the given value is not nil.

func (*UserCreate) SetNillableTermsAgreement

func (uc *UserCreate) SetNillableTermsAgreement(b *bool) *UserCreate

SetNillableTermsAgreement sets the "terms_agreement" field if the given value is not nil.

func (*UserCreate) SetNillableUpdatedAt

func (uc *UserCreate) SetNillableUpdatedAt(t *time.Time) *UserCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*UserCreate) SetOtp

func (uc *UserCreate) SetOtp(o *Otp) *UserCreate

SetOtp sets the "otp" edge to the Otp entity.

func (*UserCreate) SetOtpID

func (uc *UserCreate) SetOtpID(id uuid.UUID) *UserCreate

SetOtpID sets the "otp" edge to the Otp entity by ID.

func (*UserCreate) SetPassword

func (uc *UserCreate) SetPassword(s string) *UserCreate

SetPassword sets the "password" field.

func (*UserCreate) SetRefresh

func (uc *UserCreate) SetRefresh(s string) *UserCreate

SetRefresh sets the "refresh" field.

func (*UserCreate) SetTermsAgreement

func (uc *UserCreate) SetTermsAgreement(b bool) *UserCreate

SetTermsAgreement sets the "terms_agreement" field.

func (*UserCreate) SetUpdatedAt

func (uc *UserCreate) SetUpdatedAt(t time.Time) *UserCreate

SetUpdatedAt sets the "updated_at" field.

func (*UserCreate) SetUsername

func (uc *UserCreate) SetUsername(s string) *UserCreate

SetUsername sets the "username" 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.

func (*UserDeleteOne) Where

func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne

Where appends a list predicates to the UserDelete builder.

type UserEdges

type UserEdges struct {
	// City holds the value of the city edge.
	City *City `json:"city,omitempty"`
	// Avatar holds the value of the avatar edge.
	Avatar *File `json:"avatar,omitempty"`
	// Otp holds the value of the otp edge.
	Otp *Otp `json:"otp,omitempty"`
	// Posts holds the value of the posts edge.
	Posts []*Post `json:"posts,omitempty"`
	// Reactions holds the value of the reactions edge.
	Reactions []*Reaction `json:"reactions,omitempty"`
	// Comments holds the value of the comments edge.
	Comments []*Comment `json:"comments,omitempty"`
	// Replies holds the value of the replies edge.
	Replies []*Reply `json:"replies,omitempty"`
	// RequesterFriends holds the value of the requester_friends edge.
	RequesterFriends []*Friend `json:"requester_friends,omitempty"`
	// RequesteeFriends holds the value of the requestee_friends edge.
	RequesteeFriends []*Friend `json:"requestee_friends,omitempty"`
	// NotificationsFrom holds the value of the notifications_from edge.
	NotificationsFrom []*Notification `json:"notifications_from,omitempty"`
	// Notifications holds the value of the notifications edge.
	Notifications []*Notification `json:"notifications,omitempty"`
	// NotificationsRead holds the value of the notifications_read edge.
	NotificationsRead []*Notification `json:"notifications_read,omitempty"`
	// OwnedChats holds the value of the owned_chats edge.
	OwnedChats []*Chat `json:"owned_chats,omitempty"`
	// MemberChats holds the value of the member_chats edge.
	MemberChats []*Chat `json:"member_chats,omitempty"`
	// Messages holds the value of the messages edge.
	Messages []*Message `json:"messages,omitempty"`
	// contains filtered or unexported fields
}

UserEdges holds the relations/edges for other nodes in the graph.

func (UserEdges) AvatarOrErr

func (e UserEdges) AvatarOrErr() (*File, error)

AvatarOrErr returns the Avatar value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (UserEdges) CityOrErr

func (e UserEdges) CityOrErr() (*City, error)

CityOrErr returns the City value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (UserEdges) CommentsOrErr

func (e UserEdges) CommentsOrErr() ([]*Comment, error)

CommentsOrErr returns the Comments value or an error if the edge was not loaded in eager-loading.

func (UserEdges) MemberChatsOrErr

func (e UserEdges) MemberChatsOrErr() ([]*Chat, error)

MemberChatsOrErr returns the MemberChats value or an error if the edge was not loaded in eager-loading.

func (UserEdges) MessagesOrErr

func (e UserEdges) MessagesOrErr() ([]*Message, error)

MessagesOrErr returns the Messages value or an error if the edge was not loaded in eager-loading.

func (UserEdges) NotificationsFromOrErr

func (e UserEdges) NotificationsFromOrErr() ([]*Notification, error)

NotificationsFromOrErr returns the NotificationsFrom value or an error if the edge was not loaded in eager-loading.

func (UserEdges) NotificationsOrErr

func (e UserEdges) NotificationsOrErr() ([]*Notification, error)

NotificationsOrErr returns the Notifications value or an error if the edge was not loaded in eager-loading.

func (UserEdges) NotificationsReadOrErr

func (e UserEdges) NotificationsReadOrErr() ([]*Notification, error)

NotificationsReadOrErr returns the NotificationsRead value or an error if the edge was not loaded in eager-loading.

func (UserEdges) OtpOrErr

func (e UserEdges) OtpOrErr() (*Otp, error)

OtpOrErr returns the Otp value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (UserEdges) OwnedChatsOrErr

func (e UserEdges) OwnedChatsOrErr() ([]*Chat, error)

OwnedChatsOrErr returns the OwnedChats value or an error if the edge was not loaded in eager-loading.

func (UserEdges) PostsOrErr

func (e UserEdges) PostsOrErr() ([]*Post, error)

PostsOrErr returns the Posts value or an error if the edge was not loaded in eager-loading.

func (UserEdges) ReactionsOrErr

func (e UserEdges) ReactionsOrErr() ([]*Reaction, error)

ReactionsOrErr returns the Reactions value or an error if the edge was not loaded in eager-loading.

func (UserEdges) RepliesOrErr

func (e UserEdges) RepliesOrErr() ([]*Reply, error)

RepliesOrErr returns the Replies value or an error if the edge was not loaded in eager-loading.

func (UserEdges) RequesteeFriendsOrErr

func (e UserEdges) RequesteeFriendsOrErr() ([]*Friend, error)

RequesteeFriendsOrErr returns the RequesteeFriends value or an error if the edge was not loaded in eager-loading.

func (UserEdges) RequesterFriendsOrErr

func (e UserEdges) RequesterFriendsOrErr() ([]*Friend, error)

RequesterFriendsOrErr returns the RequesterFriends value or an error if the edge was not loaded in eager-loading.

type UserGroupBy

type UserGroupBy struct {
	// contains filtered or unexported fields
}

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserGroupBy) Bool

func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolX

func (s *UserGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserGroupBy) Bools

func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolsX

func (s *UserGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserGroupBy) Float64

func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64X

func (s *UserGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserGroupBy) Float64s

func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64sX

func (s *UserGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserGroupBy) Int

func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntX

func (s *UserGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserGroupBy) Ints

func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntsX

func (s *UserGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserGroupBy) ScanX

func (s *UserGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserGroupBy) String

func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringX

func (s *UserGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserGroupBy) Strings

func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringsX

func (s *UserGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserMutation

type UserMutation struct {
	// contains filtered or unexported fields
}

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) Access

func (m *UserMutation) Access() (r string, exists bool)

Access returns the value of the "access" field in the mutation.

func (*UserMutation) AccessCleared

func (m *UserMutation) AccessCleared() bool

AccessCleared returns if the "access" field was cleared in this mutation.

func (*UserMutation) AddCommentIDs

func (m *UserMutation) AddCommentIDs(ids ...uuid.UUID)

AddCommentIDs adds the "comments" edge to the Comment entity by ids.

func (*UserMutation) AddField

func (m *UserMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) AddMemberChatIDs

func (m *UserMutation) AddMemberChatIDs(ids ...uuid.UUID)

AddMemberChatIDs adds the "member_chats" edge to the Chat entity by ids.

func (*UserMutation) AddMessageIDs

func (m *UserMutation) AddMessageIDs(ids ...uuid.UUID)

AddMessageIDs adds the "messages" edge to the Message entity by ids.

func (*UserMutation) AddNotificationIDs

func (m *UserMutation) AddNotificationIDs(ids ...uuid.UUID)

AddNotificationIDs adds the "notifications" edge to the Notification entity by ids.

func (*UserMutation) AddNotificationsFromIDs

func (m *UserMutation) AddNotificationsFromIDs(ids ...uuid.UUID)

AddNotificationsFromIDs adds the "notifications_from" edge to the Notification entity by ids.

func (*UserMutation) AddNotificationsReadIDs

func (m *UserMutation) AddNotificationsReadIDs(ids ...uuid.UUID)

AddNotificationsReadIDs adds the "notifications_read" edge to the Notification entity by ids.

func (*UserMutation) AddOwnedChatIDs

func (m *UserMutation) AddOwnedChatIDs(ids ...uuid.UUID)

AddOwnedChatIDs adds the "owned_chats" edge to the Chat entity by ids.

func (*UserMutation) AddPostIDs

func (m *UserMutation) AddPostIDs(ids ...uuid.UUID)

AddPostIDs adds the "posts" edge to the Post entity by ids.

func (*UserMutation) AddReactionIDs

func (m *UserMutation) AddReactionIDs(ids ...uuid.UUID)

AddReactionIDs adds the "reactions" edge to the Reaction entity by ids.

func (*UserMutation) AddReplyIDs

func (m *UserMutation) AddReplyIDs(ids ...uuid.UUID)

AddReplyIDs adds the "replies" edge to the Reply entity by ids.

func (*UserMutation) AddRequesteeFriendIDs

func (m *UserMutation) AddRequesteeFriendIDs(ids ...uuid.UUID)

AddRequesteeFriendIDs adds the "requestee_friends" edge to the Friend entity by ids.

func (*UserMutation) AddRequesterFriendIDs

func (m *UserMutation) AddRequesterFriendIDs(ids ...uuid.UUID)

AddRequesterFriendIDs adds the "requester_friends" edge to the Friend 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) AvatarCleared

func (m *UserMutation) AvatarCleared() bool

AvatarCleared reports if the "avatar" edge to the File entity was cleared.

func (*UserMutation) AvatarID

func (m *UserMutation) AvatarID() (r uuid.UUID, exists bool)

AvatarID returns the value of the "avatar_id" field in the mutation.

func (*UserMutation) AvatarIDCleared

func (m *UserMutation) AvatarIDCleared() bool

AvatarIDCleared returns if the "avatar_id" field was cleared in this mutation.

func (*UserMutation) AvatarIDs

func (m *UserMutation) AvatarIDs() (ids []uuid.UUID)

AvatarIDs returns the "avatar" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use AvatarID instead. It exists only for internal usage by the builders.

func (*UserMutation) Bio

func (m *UserMutation) Bio() (r string, exists bool)

Bio returns the value of the "bio" field in the mutation.

func (*UserMutation) BioCleared

func (m *UserMutation) BioCleared() bool

BioCleared returns if the "bio" field was cleared in this mutation.

func (*UserMutation) CityCleared

func (m *UserMutation) CityCleared() bool

CityCleared reports if the "city" edge to the City entity was cleared.

func (*UserMutation) CityID

func (m *UserMutation) CityID() (r uuid.UUID, exists bool)

CityID returns the value of the "city_id" field in the mutation.

func (*UserMutation) CityIDCleared

func (m *UserMutation) CityIDCleared() bool

CityIDCleared returns if the "city_id" field was cleared in this mutation.

func (*UserMutation) CityIDs

func (m *UserMutation) CityIDs() (ids []uuid.UUID)

CityIDs returns the "city" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CityID instead. It exists only for internal usage by the builders.

func (*UserMutation) ClearAccess

func (m *UserMutation) ClearAccess()

ClearAccess clears the value of the "access" field.

func (*UserMutation) ClearAvatar

func (m *UserMutation) ClearAvatar()

ClearAvatar clears the "avatar" edge to the File entity.

func (*UserMutation) ClearAvatarID

func (m *UserMutation) ClearAvatarID()

ClearAvatarID clears the value of the "avatar_id" field.

func (*UserMutation) ClearBio

func (m *UserMutation) ClearBio()

ClearBio clears the value of the "bio" field.

func (*UserMutation) ClearCity

func (m *UserMutation) ClearCity()

ClearCity clears the "city" edge to the City entity.

func (*UserMutation) ClearCityID

func (m *UserMutation) ClearCityID()

ClearCityID clears the value of the "city_id" field.

func (*UserMutation) ClearComments

func (m *UserMutation) ClearComments()

ClearComments clears the "comments" edge to the Comment entity.

func (*UserMutation) ClearDob

func (m *UserMutation) ClearDob()

ClearDob clears the value of the "dob" field.

func (*UserMutation) ClearEdge

func (m *UserMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*UserMutation) ClearField

func (m *UserMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ClearMemberChats

func (m *UserMutation) ClearMemberChats()

ClearMemberChats clears the "member_chats" edge to the Chat entity.

func (*UserMutation) ClearMessages

func (m *UserMutation) ClearMessages()

ClearMessages clears the "messages" edge to the Message entity.

func (*UserMutation) ClearNotifications

func (m *UserMutation) ClearNotifications()

ClearNotifications clears the "notifications" edge to the Notification entity.

func (*UserMutation) ClearNotificationsFrom

func (m *UserMutation) ClearNotificationsFrom()

ClearNotificationsFrom clears the "notifications_from" edge to the Notification entity.

func (*UserMutation) ClearNotificationsRead

func (m *UserMutation) ClearNotificationsRead()

ClearNotificationsRead clears the "notifications_read" edge to the Notification entity.

func (*UserMutation) ClearOtp

func (m *UserMutation) ClearOtp()

ClearOtp clears the "otp" edge to the Otp entity.

func (*UserMutation) ClearOwnedChats

func (m *UserMutation) ClearOwnedChats()

ClearOwnedChats clears the "owned_chats" edge to the Chat entity.

func (*UserMutation) ClearPosts

func (m *UserMutation) ClearPosts()

ClearPosts clears the "posts" edge to the Post entity.

func (*UserMutation) ClearReactions

func (m *UserMutation) ClearReactions()

ClearReactions clears the "reactions" edge to the Reaction entity.

func (*UserMutation) ClearRefresh

func (m *UserMutation) ClearRefresh()

ClearRefresh clears the value of the "refresh" field.

func (*UserMutation) ClearReplies

func (m *UserMutation) ClearReplies()

ClearReplies clears the "replies" edge to the Reply entity.

func (*UserMutation) ClearRequesteeFriends

func (m *UserMutation) ClearRequesteeFriends()

ClearRequesteeFriends clears the "requestee_friends" edge to the Friend entity.

func (*UserMutation) ClearRequesterFriends

func (m *UserMutation) ClearRequesterFriends()

ClearRequesterFriends clears the "requester_friends" edge to the Friend 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) CommentsCleared

func (m *UserMutation) CommentsCleared() bool

CommentsCleared reports if the "comments" edge to the Comment entity was cleared.

func (*UserMutation) CommentsIDs

func (m *UserMutation) CommentsIDs() (ids []uuid.UUID)

CommentsIDs returns the "comments" edge IDs in the mutation.

func (*UserMutation) CreatedAt

func (m *UserMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*UserMutation) Dob

func (m *UserMutation) Dob() (r time.Time, exists bool)

Dob returns the value of the "dob" field in the mutation.

func (*UserMutation) DobCleared

func (m *UserMutation) DobCleared() bool

DobCleared returns if the "dob" field was cleared in this mutation.

func (*UserMutation) EdgeCleared

func (m *UserMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserMutation) Email

func (m *UserMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*UserMutation) Field

func (m *UserMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) FieldCleared

func (m *UserMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserMutation) Fields

func (m *UserMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*UserMutation) FirstName

func (m *UserMutation) FirstName() (r string, exists bool)

FirstName returns the value of the "first_name" field in the mutation.

func (*UserMutation) ID

func (m *UserMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*UserMutation) IDs

func (m *UserMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*UserMutation) IsActive

func (m *UserMutation) IsActive() (r bool, exists bool)

IsActive returns the value of the "is_active" field in the mutation.

func (*UserMutation) IsEmailVerified

func (m *UserMutation) IsEmailVerified() (r bool, exists bool)

IsEmailVerified returns the value of the "is_email_verified" field in the mutation.

func (*UserMutation) IsStaff

func (m *UserMutation) IsStaff() (r bool, exists bool)

IsStaff returns the value of the "is_staff" field in the mutation.

func (*UserMutation) LastName

func (m *UserMutation) LastName() (r string, exists bool)

LastName returns the value of the "last_name" field in the mutation.

func (*UserMutation) MemberChatsCleared

func (m *UserMutation) MemberChatsCleared() bool

MemberChatsCleared reports if the "member_chats" edge to the Chat entity was cleared.

func (*UserMutation) MemberChatsIDs

func (m *UserMutation) MemberChatsIDs() (ids []uuid.UUID)

MemberChatsIDs returns the "member_chats" edge IDs in the mutation.

func (*UserMutation) MessagesCleared

func (m *UserMutation) MessagesCleared() bool

MessagesCleared reports if the "messages" edge to the Message entity was cleared.

func (*UserMutation) MessagesIDs

func (m *UserMutation) MessagesIDs() (ids []uuid.UUID)

MessagesIDs returns the "messages" edge IDs in the mutation.

func (*UserMutation) NotificationsCleared

func (m *UserMutation) NotificationsCleared() bool

NotificationsCleared reports if the "notifications" edge to the Notification entity was cleared.

func (*UserMutation) NotificationsFromCleared

func (m *UserMutation) NotificationsFromCleared() bool

NotificationsFromCleared reports if the "notifications_from" edge to the Notification entity was cleared.

func (*UserMutation) NotificationsFromIDs

func (m *UserMutation) NotificationsFromIDs() (ids []uuid.UUID)

NotificationsFromIDs returns the "notifications_from" edge IDs in the mutation.

func (*UserMutation) NotificationsIDs

func (m *UserMutation) NotificationsIDs() (ids []uuid.UUID)

NotificationsIDs returns the "notifications" edge IDs in the mutation.

func (*UserMutation) NotificationsReadCleared

func (m *UserMutation) NotificationsReadCleared() bool

NotificationsReadCleared reports if the "notifications_read" edge to the Notification entity was cleared.

func (*UserMutation) NotificationsReadIDs

func (m *UserMutation) NotificationsReadIDs() (ids []uuid.UUID)

NotificationsReadIDs returns the "notifications_read" edge IDs in the mutation.

func (*UserMutation) OldAccess

func (m *UserMutation) OldAccess(ctx context.Context) (v *string, err error)

OldAccess returns the old "access" 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) OldAvatarID

func (m *UserMutation) OldAvatarID(ctx context.Context) (v *uuid.UUID, err error)

OldAvatarID returns the old "avatar_id" 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) OldBio

func (m *UserMutation) OldBio(ctx context.Context) (v *string, err error)

OldBio returns the old "bio" 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) OldCityID

func (m *UserMutation) OldCityID(ctx context.Context) (v *uuid.UUID, err error)

OldCityID returns the old "city_id" 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) OldCreatedAt

func (m *UserMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldDob

func (m *UserMutation) OldDob(ctx context.Context) (v *time.Time, err error)

OldDob returns the old "dob" 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) OldFirstName

func (m *UserMutation) OldFirstName(ctx context.Context) (v string, err error)

OldFirstName returns the old "first_name" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldIsActive

func (m *UserMutation) OldIsActive(ctx context.Context) (v bool, err error)

OldIsActive returns the old "is_active" 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) OldIsEmailVerified

func (m *UserMutation) OldIsEmailVerified(ctx context.Context) (v bool, err error)

OldIsEmailVerified returns the old "is_email_verified" 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) OldIsStaff

func (m *UserMutation) OldIsStaff(ctx context.Context) (v bool, err error)

OldIsStaff returns the old "is_staff" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldLastName

func (m *UserMutation) OldLastName(ctx context.Context) (v string, err error)

OldLastName returns the old "last_name" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldPassword

func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error)

OldPassword returns the old "password" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldRefresh

func (m *UserMutation) OldRefresh(ctx context.Context) (v *string, err error)

OldRefresh returns the old "refresh" 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) OldTermsAgreement

func (m *UserMutation) OldTermsAgreement(ctx context.Context) (v bool, err error)

OldTermsAgreement returns the old "terms_agreement" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldUpdatedAt

func (m *UserMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldUsername

func (m *UserMutation) OldUsername(ctx context.Context) (v string, err error)

OldUsername returns the old "username" 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) OtpCleared

func (m *UserMutation) OtpCleared() bool

OtpCleared reports if the "otp" edge to the Otp entity was cleared.

func (*UserMutation) OtpID

func (m *UserMutation) OtpID() (id uuid.UUID, exists bool)

OtpID returns the "otp" edge ID in the mutation.

func (*UserMutation) OtpIDs

func (m *UserMutation) OtpIDs() (ids []uuid.UUID)

OtpIDs returns the "otp" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use OtpID instead. It exists only for internal usage by the builders.

func (*UserMutation) OwnedChatsCleared

func (m *UserMutation) OwnedChatsCleared() bool

OwnedChatsCleared reports if the "owned_chats" edge to the Chat entity was cleared.

func (*UserMutation) OwnedChatsIDs

func (m *UserMutation) OwnedChatsIDs() (ids []uuid.UUID)

OwnedChatsIDs returns the "owned_chats" edge IDs in the mutation.

func (*UserMutation) Password

func (m *UserMutation) Password() (r string, exists bool)

Password returns the value of the "password" field in the mutation.

func (*UserMutation) PostsCleared

func (m *UserMutation) PostsCleared() bool

PostsCleared reports if the "posts" edge to the Post entity was cleared.

func (*UserMutation) PostsIDs

func (m *UserMutation) PostsIDs() (ids []uuid.UUID)

PostsIDs returns the "posts" edge IDs in the mutation.

func (*UserMutation) ReactionsCleared

func (m *UserMutation) ReactionsCleared() bool

ReactionsCleared reports if the "reactions" edge to the Reaction entity was cleared.

func (*UserMutation) ReactionsIDs

func (m *UserMutation) ReactionsIDs() (ids []uuid.UUID)

ReactionsIDs returns the "reactions" edge IDs in the mutation.

func (*UserMutation) Refresh

func (m *UserMutation) Refresh() (r string, exists bool)

Refresh returns the value of the "refresh" field in the mutation.

func (*UserMutation) RefreshCleared

func (m *UserMutation) RefreshCleared() bool

RefreshCleared returns if the "refresh" field was cleared in this mutation.

func (*UserMutation) RemoveCommentIDs

func (m *UserMutation) RemoveCommentIDs(ids ...uuid.UUID)

RemoveCommentIDs removes the "comments" edge to the Comment entity by IDs.

func (*UserMutation) RemoveMemberChatIDs

func (m *UserMutation) RemoveMemberChatIDs(ids ...uuid.UUID)

RemoveMemberChatIDs removes the "member_chats" edge to the Chat entity by IDs.

func (*UserMutation) RemoveMessageIDs

func (m *UserMutation) RemoveMessageIDs(ids ...uuid.UUID)

RemoveMessageIDs removes the "messages" edge to the Message entity by IDs.

func (*UserMutation) RemoveNotificationIDs

func (m *UserMutation) RemoveNotificationIDs(ids ...uuid.UUID)

RemoveNotificationIDs removes the "notifications" edge to the Notification entity by IDs.

func (*UserMutation) RemoveNotificationsFromIDs

func (m *UserMutation) RemoveNotificationsFromIDs(ids ...uuid.UUID)

RemoveNotificationsFromIDs removes the "notifications_from" edge to the Notification entity by IDs.

func (*UserMutation) RemoveNotificationsReadIDs

func (m *UserMutation) RemoveNotificationsReadIDs(ids ...uuid.UUID)

RemoveNotificationsReadIDs removes the "notifications_read" edge to the Notification entity by IDs.

func (*UserMutation) RemoveOwnedChatIDs

func (m *UserMutation) RemoveOwnedChatIDs(ids ...uuid.UUID)

RemoveOwnedChatIDs removes the "owned_chats" edge to the Chat entity by IDs.

func (*UserMutation) RemovePostIDs

func (m *UserMutation) RemovePostIDs(ids ...uuid.UUID)

RemovePostIDs removes the "posts" edge to the Post entity by IDs.

func (*UserMutation) RemoveReactionIDs

func (m *UserMutation) RemoveReactionIDs(ids ...uuid.UUID)

RemoveReactionIDs removes the "reactions" edge to the Reaction entity by IDs.

func (*UserMutation) RemoveReplyIDs

func (m *UserMutation) RemoveReplyIDs(ids ...uuid.UUID)

RemoveReplyIDs removes the "replies" edge to the Reply entity by IDs.

func (*UserMutation) RemoveRequesteeFriendIDs

func (m *UserMutation) RemoveRequesteeFriendIDs(ids ...uuid.UUID)

RemoveRequesteeFriendIDs removes the "requestee_friends" edge to the Friend entity by IDs.

func (*UserMutation) RemoveRequesterFriendIDs

func (m *UserMutation) RemoveRequesterFriendIDs(ids ...uuid.UUID)

RemoveRequesterFriendIDs removes the "requester_friends" edge to the Friend entity by IDs.

func (*UserMutation) RemovedCommentsIDs

func (m *UserMutation) RemovedCommentsIDs() (ids []uuid.UUID)

RemovedComments returns the removed IDs of the "comments" edge to the Comment entity.

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) RemovedMemberChatsIDs

func (m *UserMutation) RemovedMemberChatsIDs() (ids []uuid.UUID)

RemovedMemberChats returns the removed IDs of the "member_chats" edge to the Chat entity.

func (*UserMutation) RemovedMessagesIDs

func (m *UserMutation) RemovedMessagesIDs() (ids []uuid.UUID)

RemovedMessages returns the removed IDs of the "messages" edge to the Message entity.

func (*UserMutation) RemovedNotificationsFromIDs

func (m *UserMutation) RemovedNotificationsFromIDs() (ids []uuid.UUID)

RemovedNotificationsFrom returns the removed IDs of the "notifications_from" edge to the Notification entity.

func (*UserMutation) RemovedNotificationsIDs

func (m *UserMutation) RemovedNotificationsIDs() (ids []uuid.UUID)

RemovedNotifications returns the removed IDs of the "notifications" edge to the Notification entity.

func (*UserMutation) RemovedNotificationsReadIDs

func (m *UserMutation) RemovedNotificationsReadIDs() (ids []uuid.UUID)

RemovedNotificationsRead returns the removed IDs of the "notifications_read" edge to the Notification entity.

func (*UserMutation) RemovedOwnedChatsIDs

func (m *UserMutation) RemovedOwnedChatsIDs() (ids []uuid.UUID)

RemovedOwnedChats returns the removed IDs of the "owned_chats" edge to the Chat entity.

func (*UserMutation) RemovedPostsIDs

func (m *UserMutation) RemovedPostsIDs() (ids []uuid.UUID)

RemovedPosts returns the removed IDs of the "posts" edge to the Post entity.

func (*UserMutation) RemovedReactionsIDs

func (m *UserMutation) RemovedReactionsIDs() (ids []uuid.UUID)

RemovedReactions returns the removed IDs of the "reactions" edge to the Reaction entity.

func (*UserMutation) RemovedRepliesIDs

func (m *UserMutation) RemovedRepliesIDs() (ids []uuid.UUID)

RemovedReplies returns the removed IDs of the "replies" edge to the Reply entity.

func (*UserMutation) RemovedRequesteeFriendsIDs

func (m *UserMutation) RemovedRequesteeFriendsIDs() (ids []uuid.UUID)

RemovedRequesteeFriends returns the removed IDs of the "requestee_friends" edge to the Friend entity.

func (*UserMutation) RemovedRequesterFriendsIDs

func (m *UserMutation) RemovedRequesterFriendsIDs() (ids []uuid.UUID)

RemovedRequesterFriends returns the removed IDs of the "requester_friends" edge to the Friend entity.

func (*UserMutation) RepliesCleared

func (m *UserMutation) RepliesCleared() bool

RepliesCleared reports if the "replies" edge to the Reply entity was cleared.

func (*UserMutation) RepliesIDs

func (m *UserMutation) RepliesIDs() (ids []uuid.UUID)

RepliesIDs returns the "replies" edge IDs in the mutation.

func (*UserMutation) RequesteeFriendsCleared

func (m *UserMutation) RequesteeFriendsCleared() bool

RequesteeFriendsCleared reports if the "requestee_friends" edge to the Friend entity was cleared.

func (*UserMutation) RequesteeFriendsIDs

func (m *UserMutation) RequesteeFriendsIDs() (ids []uuid.UUID)

RequesteeFriendsIDs returns the "requestee_friends" edge IDs in the mutation.

func (*UserMutation) RequesterFriendsCleared

func (m *UserMutation) RequesterFriendsCleared() bool

RequesterFriendsCleared reports if the "requester_friends" edge to the Friend entity was cleared.

func (*UserMutation) RequesterFriendsIDs

func (m *UserMutation) RequesterFriendsIDs() (ids []uuid.UUID)

RequesterFriendsIDs returns the "requester_friends" edge IDs in the mutation.

func (*UserMutation) ResetAccess

func (m *UserMutation) ResetAccess()

ResetAccess resets all changes to the "access" field.

func (*UserMutation) ResetAvatar

func (m *UserMutation) ResetAvatar()

ResetAvatar resets all changes to the "avatar" edge.

func (*UserMutation) ResetAvatarID

func (m *UserMutation) ResetAvatarID()

ResetAvatarID resets all changes to the "avatar_id" field.

func (*UserMutation) ResetBio

func (m *UserMutation) ResetBio()

ResetBio resets all changes to the "bio" field.

func (*UserMutation) ResetCity

func (m *UserMutation) ResetCity()

ResetCity resets all changes to the "city" edge.

func (*UserMutation) ResetCityID

func (m *UserMutation) ResetCityID()

ResetCityID resets all changes to the "city_id" field.

func (*UserMutation) ResetComments

func (m *UserMutation) ResetComments()

ResetComments resets all changes to the "comments" edge.

func (*UserMutation) ResetCreatedAt

func (m *UserMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserMutation) ResetDob

func (m *UserMutation) ResetDob()

ResetDob resets all changes to the "dob" 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) ResetFirstName

func (m *UserMutation) ResetFirstName()

ResetFirstName resets all changes to the "first_name" field.

func (*UserMutation) ResetIsActive

func (m *UserMutation) ResetIsActive()

ResetIsActive resets all changes to the "is_active" field.

func (*UserMutation) ResetIsEmailVerified

func (m *UserMutation) ResetIsEmailVerified()

ResetIsEmailVerified resets all changes to the "is_email_verified" field.

func (*UserMutation) ResetIsStaff

func (m *UserMutation) ResetIsStaff()

ResetIsStaff resets all changes to the "is_staff" field.

func (*UserMutation) ResetLastName

func (m *UserMutation) ResetLastName()

ResetLastName resets all changes to the "last_name" field.

func (*UserMutation) ResetMemberChats

func (m *UserMutation) ResetMemberChats()

ResetMemberChats resets all changes to the "member_chats" edge.

func (*UserMutation) ResetMessages

func (m *UserMutation) ResetMessages()

ResetMessages resets all changes to the "messages" edge.

func (*UserMutation) ResetNotifications

func (m *UserMutation) ResetNotifications()

ResetNotifications resets all changes to the "notifications" edge.

func (*UserMutation) ResetNotificationsFrom

func (m *UserMutation) ResetNotificationsFrom()

ResetNotificationsFrom resets all changes to the "notifications_from" edge.

func (*UserMutation) ResetNotificationsRead

func (m *UserMutation) ResetNotificationsRead()

ResetNotificationsRead resets all changes to the "notifications_read" edge.

func (*UserMutation) ResetOtp

func (m *UserMutation) ResetOtp()

ResetOtp resets all changes to the "otp" edge.

func (*UserMutation) ResetOwnedChats

func (m *UserMutation) ResetOwnedChats()

ResetOwnedChats resets all changes to the "owned_chats" edge.

func (*UserMutation) ResetPassword

func (m *UserMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*UserMutation) ResetPosts

func (m *UserMutation) ResetPosts()

ResetPosts resets all changes to the "posts" edge.

func (*UserMutation) ResetReactions

func (m *UserMutation) ResetReactions()

ResetReactions resets all changes to the "reactions" edge.

func (*UserMutation) ResetRefresh

func (m *UserMutation) ResetRefresh()

ResetRefresh resets all changes to the "refresh" field.

func (*UserMutation) ResetReplies

func (m *UserMutation) ResetReplies()

ResetReplies resets all changes to the "replies" edge.

func (*UserMutation) ResetRequesteeFriends

func (m *UserMutation) ResetRequesteeFriends()

ResetRequesteeFriends resets all changes to the "requestee_friends" edge.

func (*UserMutation) ResetRequesterFriends

func (m *UserMutation) ResetRequesterFriends()

ResetRequesterFriends resets all changes to the "requester_friends" edge.

func (*UserMutation) ResetTermsAgreement

func (m *UserMutation) ResetTermsAgreement()

ResetTermsAgreement resets all changes to the "terms_agreement" field.

func (*UserMutation) ResetUpdatedAt

func (m *UserMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*UserMutation) ResetUsername

func (m *UserMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*UserMutation) SetAccess

func (m *UserMutation) SetAccess(s string)

SetAccess sets the "access" field.

func (*UserMutation) SetAvatarID

func (m *UserMutation) SetAvatarID(u uuid.UUID)

SetAvatarID sets the "avatar_id" field.

func (*UserMutation) SetBio

func (m *UserMutation) SetBio(s string)

SetBio sets the "bio" field.

func (*UserMutation) SetCityID

func (m *UserMutation) SetCityID(u uuid.UUID)

SetCityID sets the "city_id" field.

func (*UserMutation) SetCreatedAt

func (m *UserMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*UserMutation) SetDob

func (m *UserMutation) SetDob(t time.Time)

SetDob sets the "dob" 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) SetFirstName

func (m *UserMutation) SetFirstName(s string)

SetFirstName sets the "first_name" field.

func (*UserMutation) SetID

func (m *UserMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.

func (*UserMutation) SetIsActive

func (m *UserMutation) SetIsActive(b bool)

SetIsActive sets the "is_active" field.

func (*UserMutation) SetIsEmailVerified

func (m *UserMutation) SetIsEmailVerified(b bool)

SetIsEmailVerified sets the "is_email_verified" field.

func (*UserMutation) SetIsStaff

func (m *UserMutation) SetIsStaff(b bool)

SetIsStaff sets the "is_staff" field.

func (*UserMutation) SetLastName

func (m *UserMutation) SetLastName(s string)

SetLastName sets the "last_name" field.

func (*UserMutation) SetOp

func (m *UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserMutation) SetOtpID

func (m *UserMutation) SetOtpID(id uuid.UUID)

SetOtpID sets the "otp" edge to the Otp entity by id.

func (*UserMutation) SetPassword

func (m *UserMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*UserMutation) SetRefresh

func (m *UserMutation) SetRefresh(s string)

SetRefresh sets the "refresh" field.

func (*UserMutation) SetTermsAgreement

func (m *UserMutation) SetTermsAgreement(b bool)

SetTermsAgreement sets the "terms_agreement" field.

func (*UserMutation) SetUpdatedAt

func (m *UserMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*UserMutation) SetUsername

func (m *UserMutation) SetUsername(s string)

SetUsername sets the "username" field.

func (*UserMutation) TermsAgreement

func (m *UserMutation) TermsAgreement() (r bool, exists bool)

TermsAgreement returns the value of the "terms_agreement" field in the mutation.

func (UserMutation) Tx

func (m UserMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserMutation) Type

func (m *UserMutation) Type() string

Type returns the node type of this mutation (User).

func (*UserMutation) UpdatedAt

func (m *UserMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*UserMutation) Username

func (m *UserMutation) Username() (r string, exists bool)

Username returns the value of the "username" field in the mutation.

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

func (*UserMutation) WhereP

func (m *UserMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UserQuery

type UserQuery struct {
	// contains filtered or unexported fields
}

UserQuery is the builder for querying User entities.

func (*UserQuery) Aggregate

func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate returns a UserSelect configured with the given aggregations.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

AllX is like All, but panics if an error occurs.

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserQuery) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

First returns the first User entity from the query. Returns a *NotFoundError when no User was found.

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.

func (*UserQuery) FirstIDX

func (uq *UserQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserQuery) FirstX

func (uq *UserQuery) FirstX(ctx context.Context) *User

FirstX is like First, but panics if an error occurs.

func (*UserQuery) GroupBy

func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

Limit the number of records to be returned by this query.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset to start from.

func (*UserQuery) Only

func (uq *UserQuery) Only(ctx context.Context) (*User, error)

Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.

func (*UserQuery) OnlyID

func (uq *UserQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.

func (*UserQuery) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserQuery) OnlyX

func (uq *UserQuery) OnlyX(ctx context.Context) *User

OnlyX is like Only, but panics if an error occurs.

func (*UserQuery) Order

func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery

Order specifies how the records should be ordered.

func (*UserQuery) QueryAvatar

func (uq *UserQuery) QueryAvatar() *FileQuery

QueryAvatar chains the current query on the "avatar" edge.

func (*UserQuery) QueryCity

func (uq *UserQuery) QueryCity() *CityQuery

QueryCity chains the current query on the "city" edge.

func (*UserQuery) QueryComments

func (uq *UserQuery) QueryComments() *CommentQuery

QueryComments chains the current query on the "comments" edge.

func (*UserQuery) QueryMemberChats

func (uq *UserQuery) QueryMemberChats() *ChatQuery

QueryMemberChats chains the current query on the "member_chats" edge.

func (*UserQuery) QueryMessages

func (uq *UserQuery) QueryMessages() *MessageQuery

QueryMessages chains the current query on the "messages" edge.

func (*UserQuery) QueryNotifications

func (uq *UserQuery) QueryNotifications() *NotificationQuery

QueryNotifications chains the current query on the "notifications" edge.

func (*UserQuery) QueryNotificationsFrom

func (uq *UserQuery) QueryNotificationsFrom() *NotificationQuery

QueryNotificationsFrom chains the current query on the "notifications_from" edge.

func (*UserQuery) QueryNotificationsRead

func (uq *UserQuery) QueryNotificationsRead() *NotificationQuery

QueryNotificationsRead chains the current query on the "notifications_read" edge.

func (*UserQuery) QueryOtp

func (uq *UserQuery) QueryOtp() *OtpQuery

QueryOtp chains the current query on the "otp" edge.

func (*UserQuery) QueryOwnedChats

func (uq *UserQuery) QueryOwnedChats() *ChatQuery

QueryOwnedChats chains the current query on the "owned_chats" edge.

func (*UserQuery) QueryPosts

func (uq *UserQuery) QueryPosts() *PostQuery

QueryPosts chains the current query on the "posts" edge.

func (*UserQuery) QueryReactions

func (uq *UserQuery) QueryReactions() *ReactionQuery

QueryReactions chains the current query on the "reactions" edge.

func (*UserQuery) QueryReplies

func (uq *UserQuery) QueryReplies() *ReplyQuery

QueryReplies chains the current query on the "replies" edge.

func (*UserQuery) QueryRequesteeFriends

func (uq *UserQuery) QueryRequesteeFriends() *FriendQuery

QueryRequesteeFriends chains the current query on the "requestee_friends" edge.

func (*UserQuery) QueryRequesterFriends

func (uq *UserQuery) QueryRequesterFriends() *FriendQuery

QueryRequesterFriends chains the current query on the "requester_friends" edge.

func (*UserQuery) Select

func (uq *UserQuery) Select(fields ...string) *UserSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.User.Query().
	Select(user.FieldCreatedAt).
	Scan(ctx, &v)

func (*UserQuery) Unique

func (uq *UserQuery) Unique(unique bool) *UserQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*UserQuery) Where

func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

func (*UserQuery) WithAvatar

func (uq *UserQuery) WithAvatar(opts ...func(*FileQuery)) *UserQuery

WithAvatar tells the query-builder to eager-load the nodes that are connected to the "avatar" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithCity

func (uq *UserQuery) WithCity(opts ...func(*CityQuery)) *UserQuery

WithCity tells the query-builder to eager-load the nodes that are connected to the "city" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithComments

func (uq *UserQuery) WithComments(opts ...func(*CommentQuery)) *UserQuery

WithComments tells the query-builder to eager-load the nodes that are connected to the "comments" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithMemberChats

func (uq *UserQuery) WithMemberChats(opts ...func(*ChatQuery)) *UserQuery

WithMemberChats tells the query-builder to eager-load the nodes that are connected to the "member_chats" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithMessages

func (uq *UserQuery) WithMessages(opts ...func(*MessageQuery)) *UserQuery

WithMessages tells the query-builder to eager-load the nodes that are connected to the "messages" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithNotifications

func (uq *UserQuery) WithNotifications(opts ...func(*NotificationQuery)) *UserQuery

WithNotifications tells the query-builder to eager-load the nodes that are connected to the "notifications" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithNotificationsFrom

func (uq *UserQuery) WithNotificationsFrom(opts ...func(*NotificationQuery)) *UserQuery

WithNotificationsFrom tells the query-builder to eager-load the nodes that are connected to the "notifications_from" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithNotificationsRead

func (uq *UserQuery) WithNotificationsRead(opts ...func(*NotificationQuery)) *UserQuery

WithNotificationsRead tells the query-builder to eager-load the nodes that are connected to the "notifications_read" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithOtp

func (uq *UserQuery) WithOtp(opts ...func(*OtpQuery)) *UserQuery

WithOtp tells the query-builder to eager-load the nodes that are connected to the "otp" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithOwnedChats

func (uq *UserQuery) WithOwnedChats(opts ...func(*ChatQuery)) *UserQuery

WithOwnedChats tells the query-builder to eager-load the nodes that are connected to the "owned_chats" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithPosts

func (uq *UserQuery) WithPosts(opts ...func(*PostQuery)) *UserQuery

WithPosts tells the query-builder to eager-load the nodes that are connected to the "posts" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithReactions

func (uq *UserQuery) WithReactions(opts ...func(*ReactionQuery)) *UserQuery

WithReactions tells the query-builder to eager-load the nodes that are connected to the "reactions" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithReplies

func (uq *UserQuery) WithReplies(opts ...func(*ReplyQuery)) *UserQuery

WithReplies tells the query-builder to eager-load the nodes that are connected to the "replies" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithRequesteeFriends

func (uq *UserQuery) WithRequesteeFriends(opts ...func(*FriendQuery)) *UserQuery

WithRequesteeFriends tells the query-builder to eager-load the nodes that are connected to the "requestee_friends" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithRequesterFriends

func (uq *UserQuery) WithRequesterFriends(opts ...func(*FriendQuery)) *UserQuery

WithRequesterFriends tells the query-builder to eager-load the nodes that are connected to the "requester_friends" 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) AddCommentIDs

func (uu *UserUpdate) AddCommentIDs(ids ...uuid.UUID) *UserUpdate

AddCommentIDs adds the "comments" edge to the Comment entity by IDs.

func (*UserUpdate) AddComments

func (uu *UserUpdate) AddComments(c ...*Comment) *UserUpdate

AddComments adds the "comments" edges to the Comment entity.

func (*UserUpdate) AddMemberChatIDs

func (uu *UserUpdate) AddMemberChatIDs(ids ...uuid.UUID) *UserUpdate

AddMemberChatIDs adds the "member_chats" edge to the Chat entity by IDs.

func (*UserUpdate) AddMemberChats

func (uu *UserUpdate) AddMemberChats(c ...*Chat) *UserUpdate

AddMemberChats adds the "member_chats" edges to the Chat entity.

func (*UserUpdate) AddMessageIDs

func (uu *UserUpdate) AddMessageIDs(ids ...uuid.UUID) *UserUpdate

AddMessageIDs adds the "messages" edge to the Message entity by IDs.

func (*UserUpdate) AddMessages

func (uu *UserUpdate) AddMessages(m ...*Message) *UserUpdate

AddMessages adds the "messages" edges to the Message entity.

func (*UserUpdate) AddNotificationIDs

func (uu *UserUpdate) AddNotificationIDs(ids ...uuid.UUID) *UserUpdate

AddNotificationIDs adds the "notifications" edge to the Notification entity by IDs.

func (*UserUpdate) AddNotifications

func (uu *UserUpdate) AddNotifications(n ...*Notification) *UserUpdate

AddNotifications adds the "notifications" edges to the Notification entity.

func (*UserUpdate) AddNotificationsFrom

func (uu *UserUpdate) AddNotificationsFrom(n ...*Notification) *UserUpdate

AddNotificationsFrom adds the "notifications_from" edges to the Notification entity.

func (*UserUpdate) AddNotificationsFromIDs

func (uu *UserUpdate) AddNotificationsFromIDs(ids ...uuid.UUID) *UserUpdate

AddNotificationsFromIDs adds the "notifications_from" edge to the Notification entity by IDs.

func (*UserUpdate) AddNotificationsRead

func (uu *UserUpdate) AddNotificationsRead(n ...*Notification) *UserUpdate

AddNotificationsRead adds the "notifications_read" edges to the Notification entity.

func (*UserUpdate) AddNotificationsReadIDs

func (uu *UserUpdate) AddNotificationsReadIDs(ids ...uuid.UUID) *UserUpdate

AddNotificationsReadIDs adds the "notifications_read" edge to the Notification entity by IDs.

func (*UserUpdate) AddOwnedChatIDs

func (uu *UserUpdate) AddOwnedChatIDs(ids ...uuid.UUID) *UserUpdate

AddOwnedChatIDs adds the "owned_chats" edge to the Chat entity by IDs.

func (*UserUpdate) AddOwnedChats

func (uu *UserUpdate) AddOwnedChats(c ...*Chat) *UserUpdate

AddOwnedChats adds the "owned_chats" edges to the Chat entity.

func (*UserUpdate) AddPostIDs

func (uu *UserUpdate) AddPostIDs(ids ...uuid.UUID) *UserUpdate

AddPostIDs adds the "posts" edge to the Post entity by IDs.

func (*UserUpdate) AddPosts

func (uu *UserUpdate) AddPosts(p ...*Post) *UserUpdate

AddPosts adds the "posts" edges to the Post entity.

func (*UserUpdate) AddReactionIDs

func (uu *UserUpdate) AddReactionIDs(ids ...uuid.UUID) *UserUpdate

AddReactionIDs adds the "reactions" edge to the Reaction entity by IDs.

func (*UserUpdate) AddReactions

func (uu *UserUpdate) AddReactions(r ...*Reaction) *UserUpdate

AddReactions adds the "reactions" edges to the Reaction entity.

func (*UserUpdate) AddReplies

func (uu *UserUpdate) AddReplies(r ...*Reply) *UserUpdate

AddReplies adds the "replies" edges to the Reply entity.

func (*UserUpdate) AddReplyIDs

func (uu *UserUpdate) AddReplyIDs(ids ...uuid.UUID) *UserUpdate

AddReplyIDs adds the "replies" edge to the Reply entity by IDs.

func (*UserUpdate) AddRequesteeFriendIDs

func (uu *UserUpdate) AddRequesteeFriendIDs(ids ...uuid.UUID) *UserUpdate

AddRequesteeFriendIDs adds the "requestee_friends" edge to the Friend entity by IDs.

func (*UserUpdate) AddRequesteeFriends

func (uu *UserUpdate) AddRequesteeFriends(f ...*Friend) *UserUpdate

AddRequesteeFriends adds the "requestee_friends" edges to the Friend entity.

func (*UserUpdate) AddRequesterFriendIDs

func (uu *UserUpdate) AddRequesterFriendIDs(ids ...uuid.UUID) *UserUpdate

AddRequesterFriendIDs adds the "requester_friends" edge to the Friend entity by IDs.

func (*UserUpdate) AddRequesterFriends

func (uu *UserUpdate) AddRequesterFriends(f ...*Friend) *UserUpdate

AddRequesterFriends adds the "requester_friends" edges to the Friend entity.

func (*UserUpdate) ClearAccess

func (uu *UserUpdate) ClearAccess() *UserUpdate

ClearAccess clears the value of the "access" field.

func (*UserUpdate) ClearAvatar

func (uu *UserUpdate) ClearAvatar() *UserUpdate

ClearAvatar clears the "avatar" edge to the File entity.

func (*UserUpdate) ClearAvatarID

func (uu *UserUpdate) ClearAvatarID() *UserUpdate

ClearAvatarID clears the value of the "avatar_id" field.

func (*UserUpdate) ClearBio

func (uu *UserUpdate) ClearBio() *UserUpdate

ClearBio clears the value of the "bio" field.

func (*UserUpdate) ClearCity

func (uu *UserUpdate) ClearCity() *UserUpdate

ClearCity clears the "city" edge to the City entity.

func (*UserUpdate) ClearCityID

func (uu *UserUpdate) ClearCityID() *UserUpdate

ClearCityID clears the value of the "city_id" field.

func (*UserUpdate) ClearComments

func (uu *UserUpdate) ClearComments() *UserUpdate

ClearComments clears all "comments" edges to the Comment entity.

func (*UserUpdate) ClearDob

func (uu *UserUpdate) ClearDob() *UserUpdate

ClearDob clears the value of the "dob" field.

func (*UserUpdate) ClearMemberChats

func (uu *UserUpdate) ClearMemberChats() *UserUpdate

ClearMemberChats clears all "member_chats" edges to the Chat entity.

func (*UserUpdate) ClearMessages

func (uu *UserUpdate) ClearMessages() *UserUpdate

ClearMessages clears all "messages" edges to the Message entity.

func (*UserUpdate) ClearNotifications

func (uu *UserUpdate) ClearNotifications() *UserUpdate

ClearNotifications clears all "notifications" edges to the Notification entity.

func (*UserUpdate) ClearNotificationsFrom

func (uu *UserUpdate) ClearNotificationsFrom() *UserUpdate

ClearNotificationsFrom clears all "notifications_from" edges to the Notification entity.

func (*UserUpdate) ClearNotificationsRead

func (uu *UserUpdate) ClearNotificationsRead() *UserUpdate

ClearNotificationsRead clears all "notifications_read" edges to the Notification entity.

func (*UserUpdate) ClearOtp

func (uu *UserUpdate) ClearOtp() *UserUpdate

ClearOtp clears the "otp" edge to the Otp entity.

func (*UserUpdate) ClearOwnedChats

func (uu *UserUpdate) ClearOwnedChats() *UserUpdate

ClearOwnedChats clears all "owned_chats" edges to the Chat entity.

func (*UserUpdate) ClearPosts

func (uu *UserUpdate) ClearPosts() *UserUpdate

ClearPosts clears all "posts" edges to the Post entity.

func (*UserUpdate) ClearReactions

func (uu *UserUpdate) ClearReactions() *UserUpdate

ClearReactions clears all "reactions" edges to the Reaction entity.

func (*UserUpdate) ClearRefresh

func (uu *UserUpdate) ClearRefresh() *UserUpdate

ClearRefresh clears the value of the "refresh" field.

func (*UserUpdate) ClearReplies

func (uu *UserUpdate) ClearReplies() *UserUpdate

ClearReplies clears all "replies" edges to the Reply entity.

func (*UserUpdate) ClearRequesteeFriends

func (uu *UserUpdate) ClearRequesteeFriends() *UserUpdate

ClearRequesteeFriends clears all "requestee_friends" edges to the Friend entity.

func (*UserUpdate) ClearRequesterFriends

func (uu *UserUpdate) ClearRequesterFriends() *UserUpdate

ClearRequesterFriends clears all "requester_friends" edges to the Friend 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) RemoveCommentIDs

func (uu *UserUpdate) RemoveCommentIDs(ids ...uuid.UUID) *UserUpdate

RemoveCommentIDs removes the "comments" edge to Comment entities by IDs.

func (*UserUpdate) RemoveComments

func (uu *UserUpdate) RemoveComments(c ...*Comment) *UserUpdate

RemoveComments removes "comments" edges to Comment entities.

func (*UserUpdate) RemoveMemberChatIDs

func (uu *UserUpdate) RemoveMemberChatIDs(ids ...uuid.UUID) *UserUpdate

RemoveMemberChatIDs removes the "member_chats" edge to Chat entities by IDs.

func (*UserUpdate) RemoveMemberChats

func (uu *UserUpdate) RemoveMemberChats(c ...*Chat) *UserUpdate

RemoveMemberChats removes "member_chats" edges to Chat entities.

func (*UserUpdate) RemoveMessageIDs

func (uu *UserUpdate) RemoveMessageIDs(ids ...uuid.UUID) *UserUpdate

RemoveMessageIDs removes the "messages" edge to Message entities by IDs.

func (*UserUpdate) RemoveMessages

func (uu *UserUpdate) RemoveMessages(m ...*Message) *UserUpdate

RemoveMessages removes "messages" edges to Message entities.

func (*UserUpdate) RemoveNotificationIDs

func (uu *UserUpdate) RemoveNotificationIDs(ids ...uuid.UUID) *UserUpdate

RemoveNotificationIDs removes the "notifications" edge to Notification entities by IDs.

func (*UserUpdate) RemoveNotifications

func (uu *UserUpdate) RemoveNotifications(n ...*Notification) *UserUpdate

RemoveNotifications removes "notifications" edges to Notification entities.

func (*UserUpdate) RemoveNotificationsFrom

func (uu *UserUpdate) RemoveNotificationsFrom(n ...*Notification) *UserUpdate

RemoveNotificationsFrom removes "notifications_from" edges to Notification entities.

func (*UserUpdate) RemoveNotificationsFromIDs

func (uu *UserUpdate) RemoveNotificationsFromIDs(ids ...uuid.UUID) *UserUpdate

RemoveNotificationsFromIDs removes the "notifications_from" edge to Notification entities by IDs.

func (*UserUpdate) RemoveNotificationsRead

func (uu *UserUpdate) RemoveNotificationsRead(n ...*Notification) *UserUpdate

RemoveNotificationsRead removes "notifications_read" edges to Notification entities.

func (*UserUpdate) RemoveNotificationsReadIDs

func (uu *UserUpdate) RemoveNotificationsReadIDs(ids ...uuid.UUID) *UserUpdate

RemoveNotificationsReadIDs removes the "notifications_read" edge to Notification entities by IDs.

func (*UserUpdate) RemoveOwnedChatIDs

func (uu *UserUpdate) RemoveOwnedChatIDs(ids ...uuid.UUID) *UserUpdate

RemoveOwnedChatIDs removes the "owned_chats" edge to Chat entities by IDs.

func (*UserUpdate) RemoveOwnedChats

func (uu *UserUpdate) RemoveOwnedChats(c ...*Chat) *UserUpdate

RemoveOwnedChats removes "owned_chats" edges to Chat entities.

func (*UserUpdate) RemovePostIDs

func (uu *UserUpdate) RemovePostIDs(ids ...uuid.UUID) *UserUpdate

RemovePostIDs removes the "posts" edge to Post entities by IDs.

func (*UserUpdate) RemovePosts

func (uu *UserUpdate) RemovePosts(p ...*Post) *UserUpdate

RemovePosts removes "posts" edges to Post entities.

func (*UserUpdate) RemoveReactionIDs

func (uu *UserUpdate) RemoveReactionIDs(ids ...uuid.UUID) *UserUpdate

RemoveReactionIDs removes the "reactions" edge to Reaction entities by IDs.

func (*UserUpdate) RemoveReactions

func (uu *UserUpdate) RemoveReactions(r ...*Reaction) *UserUpdate

RemoveReactions removes "reactions" edges to Reaction entities.

func (*UserUpdate) RemoveReplies

func (uu *UserUpdate) RemoveReplies(r ...*Reply) *UserUpdate

RemoveReplies removes "replies" edges to Reply entities.

func (*UserUpdate) RemoveReplyIDs

func (uu *UserUpdate) RemoveReplyIDs(ids ...uuid.UUID) *UserUpdate

RemoveReplyIDs removes the "replies" edge to Reply entities by IDs.

func (*UserUpdate) RemoveRequesteeFriendIDs

func (uu *UserUpdate) RemoveRequesteeFriendIDs(ids ...uuid.UUID) *UserUpdate

RemoveRequesteeFriendIDs removes the "requestee_friends" edge to Friend entities by IDs.

func (*UserUpdate) RemoveRequesteeFriends

func (uu *UserUpdate) RemoveRequesteeFriends(f ...*Friend) *UserUpdate

RemoveRequesteeFriends removes "requestee_friends" edges to Friend entities.

func (*UserUpdate) RemoveRequesterFriendIDs

func (uu *UserUpdate) RemoveRequesterFriendIDs(ids ...uuid.UUID) *UserUpdate

RemoveRequesterFriendIDs removes the "requester_friends" edge to Friend entities by IDs.

func (*UserUpdate) RemoveRequesterFriends

func (uu *UserUpdate) RemoveRequesterFriends(f ...*Friend) *UserUpdate

RemoveRequesterFriends removes "requester_friends" edges to Friend 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) SetAccess

func (uu *UserUpdate) SetAccess(s string) *UserUpdate

SetAccess sets the "access" field.

func (*UserUpdate) SetAvatar

func (uu *UserUpdate) SetAvatar(f *File) *UserUpdate

SetAvatar sets the "avatar" edge to the File entity.

func (*UserUpdate) SetAvatarID

func (uu *UserUpdate) SetAvatarID(u uuid.UUID) *UserUpdate

SetAvatarID sets the "avatar_id" field.

func (*UserUpdate) SetBio

func (uu *UserUpdate) SetBio(s string) *UserUpdate

SetBio sets the "bio" field.

func (*UserUpdate) SetCity

func (uu *UserUpdate) SetCity(c *City) *UserUpdate

SetCity sets the "city" edge to the City entity.

func (*UserUpdate) SetCityID

func (uu *UserUpdate) SetCityID(u uuid.UUID) *UserUpdate

SetCityID sets the "city_id" field.

func (*UserUpdate) SetCreatedAt

func (uu *UserUpdate) SetCreatedAt(t time.Time) *UserUpdate

SetCreatedAt sets the "created_at" field.

func (*UserUpdate) SetDob

func (uu *UserUpdate) SetDob(t time.Time) *UserUpdate

SetDob sets the "dob" field.

func (*UserUpdate) SetEmail

func (uu *UserUpdate) SetEmail(s string) *UserUpdate

SetEmail sets the "email" field.

func (*UserUpdate) SetFirstName

func (uu *UserUpdate) SetFirstName(s string) *UserUpdate

SetFirstName sets the "first_name" field.

func (*UserUpdate) SetIsActive

func (uu *UserUpdate) SetIsActive(b bool) *UserUpdate

SetIsActive sets the "is_active" field.

func (*UserUpdate) SetIsEmailVerified

func (uu *UserUpdate) SetIsEmailVerified(b bool) *UserUpdate

SetIsEmailVerified sets the "is_email_verified" field.

func (*UserUpdate) SetIsStaff

func (uu *UserUpdate) SetIsStaff(b bool) *UserUpdate

SetIsStaff sets the "is_staff" field.

func (*UserUpdate) SetLastName

func (uu *UserUpdate) SetLastName(s string) *UserUpdate

SetLastName sets the "last_name" field.

func (*UserUpdate) SetNillableAccess

func (uu *UserUpdate) SetNillableAccess(s *string) *UserUpdate

SetNillableAccess sets the "access" field if the given value is not nil.

func (*UserUpdate) SetNillableAvatarID

func (uu *UserUpdate) SetNillableAvatarID(u *uuid.UUID) *UserUpdate

SetNillableAvatarID sets the "avatar_id" field if the given value is not nil.

func (*UserUpdate) SetNillableBio

func (uu *UserUpdate) SetNillableBio(s *string) *UserUpdate

SetNillableBio sets the "bio" field if the given value is not nil.

func (*UserUpdate) SetNillableCityID

func (uu *UserUpdate) SetNillableCityID(u *uuid.UUID) *UserUpdate

SetNillableCityID sets the "city_id" field if the given value is not nil.

func (*UserUpdate) SetNillableCreatedAt

func (uu *UserUpdate) SetNillableCreatedAt(t *time.Time) *UserUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UserUpdate) SetNillableDob

func (uu *UserUpdate) SetNillableDob(t *time.Time) *UserUpdate

SetNillableDob sets the "dob" field 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) SetNillableFirstName

func (uu *UserUpdate) SetNillableFirstName(s *string) *UserUpdate

SetNillableFirstName sets the "first_name" field if the given value is not nil.

func (*UserUpdate) SetNillableIsActive

func (uu *UserUpdate) SetNillableIsActive(b *bool) *UserUpdate

SetNillableIsActive sets the "is_active" field if the given value is not nil.

func (*UserUpdate) SetNillableIsEmailVerified

func (uu *UserUpdate) SetNillableIsEmailVerified(b *bool) *UserUpdate

SetNillableIsEmailVerified sets the "is_email_verified" field if the given value is not nil.

func (*UserUpdate) SetNillableIsStaff

func (uu *UserUpdate) SetNillableIsStaff(b *bool) *UserUpdate

SetNillableIsStaff sets the "is_staff" field if the given value is not nil.

func (*UserUpdate) SetNillableLastName

func (uu *UserUpdate) SetNillableLastName(s *string) *UserUpdate

SetNillableLastName sets the "last_name" field if the given value is not nil.

func (*UserUpdate) SetNillableOtpID

func (uu *UserUpdate) SetNillableOtpID(id *uuid.UUID) *UserUpdate

SetNillableOtpID sets the "otp" edge to the Otp entity by ID if the given value is not nil.

func (*UserUpdate) SetNillablePassword

func (uu *UserUpdate) SetNillablePassword(s *string) *UserUpdate

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UserUpdate) SetNillableRefresh

func (uu *UserUpdate) SetNillableRefresh(s *string) *UserUpdate

SetNillableRefresh sets the "refresh" field if the given value is not nil.

func (*UserUpdate) SetNillableTermsAgreement

func (uu *UserUpdate) SetNillableTermsAgreement(b *bool) *UserUpdate

SetNillableTermsAgreement sets the "terms_agreement" field if the given value is not nil.

func (*UserUpdate) SetNillableUsername

func (uu *UserUpdate) SetNillableUsername(s *string) *UserUpdate

SetNillableUsername sets the "username" field if the given value is not nil.

func (*UserUpdate) SetOtp

func (uu *UserUpdate) SetOtp(o *Otp) *UserUpdate

SetOtp sets the "otp" edge to the Otp entity.

func (*UserUpdate) SetOtpID

func (uu *UserUpdate) SetOtpID(id uuid.UUID) *UserUpdate

SetOtpID sets the "otp" edge to the Otp entity by ID.

func (*UserUpdate) SetPassword

func (uu *UserUpdate) SetPassword(s string) *UserUpdate

SetPassword sets the "password" field.

func (*UserUpdate) SetRefresh

func (uu *UserUpdate) SetRefresh(s string) *UserUpdate

SetRefresh sets the "refresh" field.

func (*UserUpdate) SetTermsAgreement

func (uu *UserUpdate) SetTermsAgreement(b bool) *UserUpdate

SetTermsAgreement sets the "terms_agreement" field.

func (*UserUpdate) SetUpdatedAt

func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdate) SetUsername

func (uu *UserUpdate) SetUsername(s string) *UserUpdate

SetUsername sets the "username" 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) AddCommentIDs

func (uuo *UserUpdateOne) AddCommentIDs(ids ...uuid.UUID) *UserUpdateOne

AddCommentIDs adds the "comments" edge to the Comment entity by IDs.

func (*UserUpdateOne) AddComments

func (uuo *UserUpdateOne) AddComments(c ...*Comment) *UserUpdateOne

AddComments adds the "comments" edges to the Comment entity.

func (*UserUpdateOne) AddMemberChatIDs

func (uuo *UserUpdateOne) AddMemberChatIDs(ids ...uuid.UUID) *UserUpdateOne

AddMemberChatIDs adds the "member_chats" edge to the Chat entity by IDs.

func (*UserUpdateOne) AddMemberChats

func (uuo *UserUpdateOne) AddMemberChats(c ...*Chat) *UserUpdateOne

AddMemberChats adds the "member_chats" edges to the Chat entity.

func (*UserUpdateOne) AddMessageIDs

func (uuo *UserUpdateOne) AddMessageIDs(ids ...uuid.UUID) *UserUpdateOne

AddMessageIDs adds the "messages" edge to the Message entity by IDs.

func (*UserUpdateOne) AddMessages

func (uuo *UserUpdateOne) AddMessages(m ...*Message) *UserUpdateOne

AddMessages adds the "messages" edges to the Message entity.

func (*UserUpdateOne) AddNotificationIDs

func (uuo *UserUpdateOne) AddNotificationIDs(ids ...uuid.UUID) *UserUpdateOne

AddNotificationIDs adds the "notifications" edge to the Notification entity by IDs.

func (*UserUpdateOne) AddNotifications

func (uuo *UserUpdateOne) AddNotifications(n ...*Notification) *UserUpdateOne

AddNotifications adds the "notifications" edges to the Notification entity.

func (*UserUpdateOne) AddNotificationsFrom

func (uuo *UserUpdateOne) AddNotificationsFrom(n ...*Notification) *UserUpdateOne

AddNotificationsFrom adds the "notifications_from" edges to the Notification entity.

func (*UserUpdateOne) AddNotificationsFromIDs

func (uuo *UserUpdateOne) AddNotificationsFromIDs(ids ...uuid.UUID) *UserUpdateOne

AddNotificationsFromIDs adds the "notifications_from" edge to the Notification entity by IDs.

func (*UserUpdateOne) AddNotificationsRead

func (uuo *UserUpdateOne) AddNotificationsRead(n ...*Notification) *UserUpdateOne

AddNotificationsRead adds the "notifications_read" edges to the Notification entity.

func (*UserUpdateOne) AddNotificationsReadIDs

func (uuo *UserUpdateOne) AddNotificationsReadIDs(ids ...uuid.UUID) *UserUpdateOne

AddNotificationsReadIDs adds the "notifications_read" edge to the Notification entity by IDs.

func (*UserUpdateOne) AddOwnedChatIDs

func (uuo *UserUpdateOne) AddOwnedChatIDs(ids ...uuid.UUID) *UserUpdateOne

AddOwnedChatIDs adds the "owned_chats" edge to the Chat entity by IDs.

func (*UserUpdateOne) AddOwnedChats

func (uuo *UserUpdateOne) AddOwnedChats(c ...*Chat) *UserUpdateOne

AddOwnedChats adds the "owned_chats" edges to the Chat entity.

func (*UserUpdateOne) AddPostIDs

func (uuo *UserUpdateOne) AddPostIDs(ids ...uuid.UUID) *UserUpdateOne

AddPostIDs adds the "posts" edge to the Post entity by IDs.

func (*UserUpdateOne) AddPosts

func (uuo *UserUpdateOne) AddPosts(p ...*Post) *UserUpdateOne

AddPosts adds the "posts" edges to the Post entity.

func (*UserUpdateOne) AddReactionIDs

func (uuo *UserUpdateOne) AddReactionIDs(ids ...uuid.UUID) *UserUpdateOne

AddReactionIDs adds the "reactions" edge to the Reaction entity by IDs.

func (*UserUpdateOne) AddReactions

func (uuo *UserUpdateOne) AddReactions(r ...*Reaction) *UserUpdateOne

AddReactions adds the "reactions" edges to the Reaction entity.

func (*UserUpdateOne) AddReplies

func (uuo *UserUpdateOne) AddReplies(r ...*Reply) *UserUpdateOne

AddReplies adds the "replies" edges to the Reply entity.

func (*UserUpdateOne) AddReplyIDs

func (uuo *UserUpdateOne) AddReplyIDs(ids ...uuid.UUID) *UserUpdateOne

AddReplyIDs adds the "replies" edge to the Reply entity by IDs.

func (*UserUpdateOne) AddRequesteeFriendIDs

func (uuo *UserUpdateOne) AddRequesteeFriendIDs(ids ...uuid.UUID) *UserUpdateOne

AddRequesteeFriendIDs adds the "requestee_friends" edge to the Friend entity by IDs.

func (*UserUpdateOne) AddRequesteeFriends

func (uuo *UserUpdateOne) AddRequesteeFriends(f ...*Friend) *UserUpdateOne

AddRequesteeFriends adds the "requestee_friends" edges to the Friend entity.

func (*UserUpdateOne) AddRequesterFriendIDs

func (uuo *UserUpdateOne) AddRequesterFriendIDs(ids ...uuid.UUID) *UserUpdateOne

AddRequesterFriendIDs adds the "requester_friends" edge to the Friend entity by IDs.

func (*UserUpdateOne) AddRequesterFriends

func (uuo *UserUpdateOne) AddRequesterFriends(f ...*Friend) *UserUpdateOne

AddRequesterFriends adds the "requester_friends" edges to the Friend entity.

func (*UserUpdateOne) ClearAccess

func (uuo *UserUpdateOne) ClearAccess() *UserUpdateOne

ClearAccess clears the value of the "access" field.

func (*UserUpdateOne) ClearAvatar

func (uuo *UserUpdateOne) ClearAvatar() *UserUpdateOne

ClearAvatar clears the "avatar" edge to the File entity.

func (*UserUpdateOne) ClearAvatarID

func (uuo *UserUpdateOne) ClearAvatarID() *UserUpdateOne

ClearAvatarID clears the value of the "avatar_id" field.

func (*UserUpdateOne) ClearBio

func (uuo *UserUpdateOne) ClearBio() *UserUpdateOne

ClearBio clears the value of the "bio" field.

func (*UserUpdateOne) ClearCity

func (uuo *UserUpdateOne) ClearCity() *UserUpdateOne

ClearCity clears the "city" edge to the City entity.

func (*UserUpdateOne) ClearCityID

func (uuo *UserUpdateOne) ClearCityID() *UserUpdateOne

ClearCityID clears the value of the "city_id" field.

func (*UserUpdateOne) ClearComments

func (uuo *UserUpdateOne) ClearComments() *UserUpdateOne

ClearComments clears all "comments" edges to the Comment entity.

func (*UserUpdateOne) ClearDob

func (uuo *UserUpdateOne) ClearDob() *UserUpdateOne

ClearDob clears the value of the "dob" field.

func (*UserUpdateOne) ClearMemberChats

func (uuo *UserUpdateOne) ClearMemberChats() *UserUpdateOne

ClearMemberChats clears all "member_chats" edges to the Chat entity.

func (*UserUpdateOne) ClearMessages

func (uuo *UserUpdateOne) ClearMessages() *UserUpdateOne

ClearMessages clears all "messages" edges to the Message entity.

func (*UserUpdateOne) ClearNotifications

func (uuo *UserUpdateOne) ClearNotifications() *UserUpdateOne

ClearNotifications clears all "notifications" edges to the Notification entity.

func (*UserUpdateOne) ClearNotificationsFrom

func (uuo *UserUpdateOne) ClearNotificationsFrom() *UserUpdateOne

ClearNotificationsFrom clears all "notifications_from" edges to the Notification entity.

func (*UserUpdateOne) ClearNotificationsRead

func (uuo *UserUpdateOne) ClearNotificationsRead() *UserUpdateOne

ClearNotificationsRead clears all "notifications_read" edges to the Notification entity.

func (*UserUpdateOne) ClearOtp

func (uuo *UserUpdateOne) ClearOtp() *UserUpdateOne

ClearOtp clears the "otp" edge to the Otp entity.

func (*UserUpdateOne) ClearOwnedChats

func (uuo *UserUpdateOne) ClearOwnedChats() *UserUpdateOne

ClearOwnedChats clears all "owned_chats" edges to the Chat entity.

func (*UserUpdateOne) ClearPosts

func (uuo *UserUpdateOne) ClearPosts() *UserUpdateOne

ClearPosts clears all "posts" edges to the Post entity.

func (*UserUpdateOne) ClearReactions

func (uuo *UserUpdateOne) ClearReactions() *UserUpdateOne

ClearReactions clears all "reactions" edges to the Reaction entity.

func (*UserUpdateOne) ClearRefresh

func (uuo *UserUpdateOne) ClearRefresh() *UserUpdateOne

ClearRefresh clears the value of the "refresh" field.

func (*UserUpdateOne) ClearReplies

func (uuo *UserUpdateOne) ClearReplies() *UserUpdateOne

ClearReplies clears all "replies" edges to the Reply entity.

func (*UserUpdateOne) ClearRequesteeFriends

func (uuo *UserUpdateOne) ClearRequesteeFriends() *UserUpdateOne

ClearRequesteeFriends clears all "requestee_friends" edges to the Friend entity.

func (*UserUpdateOne) ClearRequesterFriends

func (uuo *UserUpdateOne) ClearRequesterFriends() *UserUpdateOne

ClearRequesterFriends clears all "requester_friends" edges to the Friend 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) RemoveCommentIDs

func (uuo *UserUpdateOne) RemoveCommentIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveCommentIDs removes the "comments" edge to Comment entities by IDs.

func (*UserUpdateOne) RemoveComments

func (uuo *UserUpdateOne) RemoveComments(c ...*Comment) *UserUpdateOne

RemoveComments removes "comments" edges to Comment entities.

func (*UserUpdateOne) RemoveMemberChatIDs

func (uuo *UserUpdateOne) RemoveMemberChatIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveMemberChatIDs removes the "member_chats" edge to Chat entities by IDs.

func (*UserUpdateOne) RemoveMemberChats

func (uuo *UserUpdateOne) RemoveMemberChats(c ...*Chat) *UserUpdateOne

RemoveMemberChats removes "member_chats" edges to Chat entities.

func (*UserUpdateOne) RemoveMessageIDs

func (uuo *UserUpdateOne) RemoveMessageIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveMessageIDs removes the "messages" edge to Message entities by IDs.

func (*UserUpdateOne) RemoveMessages

func (uuo *UserUpdateOne) RemoveMessages(m ...*Message) *UserUpdateOne

RemoveMessages removes "messages" edges to Message entities.

func (*UserUpdateOne) RemoveNotificationIDs

func (uuo *UserUpdateOne) RemoveNotificationIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveNotificationIDs removes the "notifications" edge to Notification entities by IDs.

func (*UserUpdateOne) RemoveNotifications

func (uuo *UserUpdateOne) RemoveNotifications(n ...*Notification) *UserUpdateOne

RemoveNotifications removes "notifications" edges to Notification entities.

func (*UserUpdateOne) RemoveNotificationsFrom

func (uuo *UserUpdateOne) RemoveNotificationsFrom(n ...*Notification) *UserUpdateOne

RemoveNotificationsFrom removes "notifications_from" edges to Notification entities.

func (*UserUpdateOne) RemoveNotificationsFromIDs

func (uuo *UserUpdateOne) RemoveNotificationsFromIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveNotificationsFromIDs removes the "notifications_from" edge to Notification entities by IDs.

func (*UserUpdateOne) RemoveNotificationsRead

func (uuo *UserUpdateOne) RemoveNotificationsRead(n ...*Notification) *UserUpdateOne

RemoveNotificationsRead removes "notifications_read" edges to Notification entities.

func (*UserUpdateOne) RemoveNotificationsReadIDs

func (uuo *UserUpdateOne) RemoveNotificationsReadIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveNotificationsReadIDs removes the "notifications_read" edge to Notification entities by IDs.

func (*UserUpdateOne) RemoveOwnedChatIDs

func (uuo *UserUpdateOne) RemoveOwnedChatIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveOwnedChatIDs removes the "owned_chats" edge to Chat entities by IDs.

func (*UserUpdateOne) RemoveOwnedChats

func (uuo *UserUpdateOne) RemoveOwnedChats(c ...*Chat) *UserUpdateOne

RemoveOwnedChats removes "owned_chats" edges to Chat entities.

func (*UserUpdateOne) RemovePostIDs

func (uuo *UserUpdateOne) RemovePostIDs(ids ...uuid.UUID) *UserUpdateOne

RemovePostIDs removes the "posts" edge to Post entities by IDs.

func (*UserUpdateOne) RemovePosts

func (uuo *UserUpdateOne) RemovePosts(p ...*Post) *UserUpdateOne

RemovePosts removes "posts" edges to Post entities.

func (*UserUpdateOne) RemoveReactionIDs

func (uuo *UserUpdateOne) RemoveReactionIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveReactionIDs removes the "reactions" edge to Reaction entities by IDs.

func (*UserUpdateOne) RemoveReactions

func (uuo *UserUpdateOne) RemoveReactions(r ...*Reaction) *UserUpdateOne

RemoveReactions removes "reactions" edges to Reaction entities.

func (*UserUpdateOne) RemoveReplies

func (uuo *UserUpdateOne) RemoveReplies(r ...*Reply) *UserUpdateOne

RemoveReplies removes "replies" edges to Reply entities.

func (*UserUpdateOne) RemoveReplyIDs

func (uuo *UserUpdateOne) RemoveReplyIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveReplyIDs removes the "replies" edge to Reply entities by IDs.

func (*UserUpdateOne) RemoveRequesteeFriendIDs

func (uuo *UserUpdateOne) RemoveRequesteeFriendIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveRequesteeFriendIDs removes the "requestee_friends" edge to Friend entities by IDs.

func (*UserUpdateOne) RemoveRequesteeFriends

func (uuo *UserUpdateOne) RemoveRequesteeFriends(f ...*Friend) *UserUpdateOne

RemoveRequesteeFriends removes "requestee_friends" edges to Friend entities.

func (*UserUpdateOne) RemoveRequesterFriendIDs

func (uuo *UserUpdateOne) RemoveRequesterFriendIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveRequesterFriendIDs removes the "requester_friends" edge to Friend entities by IDs.

func (*UserUpdateOne) RemoveRequesterFriends

func (uuo *UserUpdateOne) RemoveRequesterFriends(f ...*Friend) *UserUpdateOne

RemoveRequesterFriends removes "requester_friends" edges to Friend 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) SetAccess

func (uuo *UserUpdateOne) SetAccess(s string) *UserUpdateOne

SetAccess sets the "access" field.

func (*UserUpdateOne) SetAvatar

func (uuo *UserUpdateOne) SetAvatar(f *File) *UserUpdateOne

SetAvatar sets the "avatar" edge to the File entity.

func (*UserUpdateOne) SetAvatarID

func (uuo *UserUpdateOne) SetAvatarID(u uuid.UUID) *UserUpdateOne

SetAvatarID sets the "avatar_id" field.

func (*UserUpdateOne) SetBio

func (uuo *UserUpdateOne) SetBio(s string) *UserUpdateOne

SetBio sets the "bio" field.

func (*UserUpdateOne) SetCity

func (uuo *UserUpdateOne) SetCity(c *City) *UserUpdateOne

SetCity sets the "city" edge to the City entity.

func (*UserUpdateOne) SetCityID

func (uuo *UserUpdateOne) SetCityID(u uuid.UUID) *UserUpdateOne

SetCityID sets the "city_id" field.

func (*UserUpdateOne) SetCreatedAt

func (uuo *UserUpdateOne) SetCreatedAt(t time.Time) *UserUpdateOne

SetCreatedAt sets the "created_at" field.

func (*UserUpdateOne) SetDob

func (uuo *UserUpdateOne) SetDob(t time.Time) *UserUpdateOne

SetDob sets the "dob" field.

func (*UserUpdateOne) SetEmail

func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne

SetEmail sets the "email" field.

func (*UserUpdateOne) SetFirstName

func (uuo *UserUpdateOne) SetFirstName(s string) *UserUpdateOne

SetFirstName sets the "first_name" field.

func (*UserUpdateOne) SetIsActive

func (uuo *UserUpdateOne) SetIsActive(b bool) *UserUpdateOne

SetIsActive sets the "is_active" field.

func (*UserUpdateOne) SetIsEmailVerified

func (uuo *UserUpdateOne) SetIsEmailVerified(b bool) *UserUpdateOne

SetIsEmailVerified sets the "is_email_verified" field.

func (*UserUpdateOne) SetIsStaff

func (uuo *UserUpdateOne) SetIsStaff(b bool) *UserUpdateOne

SetIsStaff sets the "is_staff" field.

func (*UserUpdateOne) SetLastName

func (uuo *UserUpdateOne) SetLastName(s string) *UserUpdateOne

SetLastName sets the "last_name" field.

func (*UserUpdateOne) SetNillableAccess

func (uuo *UserUpdateOne) SetNillableAccess(s *string) *UserUpdateOne

SetNillableAccess sets the "access" field if the given value is not nil.

func (*UserUpdateOne) SetNillableAvatarID

func (uuo *UserUpdateOne) SetNillableAvatarID(u *uuid.UUID) *UserUpdateOne

SetNillableAvatarID sets the "avatar_id" field if the given value is not nil.

func (*UserUpdateOne) SetNillableBio

func (uuo *UserUpdateOne) SetNillableBio(s *string) *UserUpdateOne

SetNillableBio sets the "bio" field if the given value is not nil.

func (*UserUpdateOne) SetNillableCityID

func (uuo *UserUpdateOne) SetNillableCityID(u *uuid.UUID) *UserUpdateOne

SetNillableCityID sets the "city_id" field if the given value is not nil.

func (*UserUpdateOne) SetNillableCreatedAt

func (uuo *UserUpdateOne) SetNillableCreatedAt(t *time.Time) *UserUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UserUpdateOne) SetNillableDob

func (uuo *UserUpdateOne) SetNillableDob(t *time.Time) *UserUpdateOne

SetNillableDob sets the "dob" field 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) SetNillableFirstName

func (uuo *UserUpdateOne) SetNillableFirstName(s *string) *UserUpdateOne

SetNillableFirstName sets the "first_name" field if the given value is not nil.

func (*UserUpdateOne) SetNillableIsActive

func (uuo *UserUpdateOne) SetNillableIsActive(b *bool) *UserUpdateOne

SetNillableIsActive sets the "is_active" field if the given value is not nil.

func (*UserUpdateOne) SetNillableIsEmailVerified

func (uuo *UserUpdateOne) SetNillableIsEmailVerified(b *bool) *UserUpdateOne

SetNillableIsEmailVerified sets the "is_email_verified" field if the given value is not nil.

func (*UserUpdateOne) SetNillableIsStaff

func (uuo *UserUpdateOne) SetNillableIsStaff(b *bool) *UserUpdateOne

SetNillableIsStaff sets the "is_staff" field if the given value is not nil.

func (*UserUpdateOne) SetNillableLastName

func (uuo *UserUpdateOne) SetNillableLastName(s *string) *UserUpdateOne

SetNillableLastName sets the "last_name" field if the given value is not nil.

func (*UserUpdateOne) SetNillableOtpID

func (uuo *UserUpdateOne) SetNillableOtpID(id *uuid.UUID) *UserUpdateOne

SetNillableOtpID sets the "otp" edge to the Otp entity by ID if the given value is not nil.

func (*UserUpdateOne) SetNillablePassword

func (uuo *UserUpdateOne) SetNillablePassword(s *string) *UserUpdateOne

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UserUpdateOne) SetNillableRefresh

func (uuo *UserUpdateOne) SetNillableRefresh(s *string) *UserUpdateOne

SetNillableRefresh sets the "refresh" field if the given value is not nil.

func (*UserUpdateOne) SetNillableTermsAgreement

func (uuo *UserUpdateOne) SetNillableTermsAgreement(b *bool) *UserUpdateOne

SetNillableTermsAgreement sets the "terms_agreement" field if the given value is not nil.

func (*UserUpdateOne) SetNillableUsername

func (uuo *UserUpdateOne) SetNillableUsername(s *string) *UserUpdateOne

SetNillableUsername sets the "username" field if the given value is not nil.

func (*UserUpdateOne) SetOtp

func (uuo *UserUpdateOne) SetOtp(o *Otp) *UserUpdateOne

SetOtp sets the "otp" edge to the Otp entity.

func (*UserUpdateOne) SetOtpID

func (uuo *UserUpdateOne) SetOtpID(id uuid.UUID) *UserUpdateOne

SetOtpID sets the "otp" edge to the Otp entity by ID.

func (*UserUpdateOne) SetPassword

func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne

SetPassword sets the "password" field.

func (*UserUpdateOne) SetRefresh

func (uuo *UserUpdateOne) SetRefresh(s string) *UserUpdateOne

SetRefresh sets the "refresh" field.

func (*UserUpdateOne) SetTermsAgreement

func (uuo *UserUpdateOne) SetTermsAgreement(b bool) *UserUpdateOne

SetTermsAgreement sets the "terms_agreement" field.

func (*UserUpdateOne) SetUpdatedAt

func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdateOne) SetUsername

func (uuo *UserUpdateOne) SetUsername(s string) *UserUpdateOne

SetUsername sets the "username" field.

func (*UserUpdateOne) Where

func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne

Where appends a list predicates to the UserUpdate builder.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL