internal

package
v0.0.0-...-259ba49 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: MIT Imports: 39 Imported by: 0

Documentation

Index

Constants

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

	// Node types.
	TypeGroup        = "Group"
	TypeMessage      = "Message"
	TypeNotification = "Notification"
	TypePost         = "Post"
	TypeSetting      = "Setting"
	TypeUser         = "User"
)

Variables

View Source
var DefaultGroupOrder = &GroupOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &GroupOrderField{
		Value: func(gr *Group) (ent.Value, error) {
			return gr.ID, nil
		},
		column: group.FieldID,
		toTerm: group.ByID,
		toCursor: func(gr *Group) Cursor {
			return Cursor{ID: gr.ID}
		},
	},
}

DefaultGroupOrder is the default ordering of Group.

View Source
var DefaultMessageOrder = &MessageOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &MessageOrderField{
		Value: func(m *Message) (ent.Value, error) {
			return m.ID, nil
		},
		column: message.FieldID,
		toTerm: message.ByID,
		toCursor: func(m *Message) Cursor {
			return Cursor{ID: m.ID}
		},
	},
}

DefaultMessageOrder is the default ordering of Message.

View Source
var DefaultNotificationOrder = &NotificationOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &NotificationOrderField{
		Value: func(n *Notification) (ent.Value, error) {
			return n.ID, nil
		},
		column: notification.FieldID,
		toTerm: notification.ByID,
		toCursor: func(n *Notification) Cursor {
			return Cursor{ID: n.ID}
		},
	},
}

DefaultNotificationOrder is the default ordering of Notification.

View Source
var DefaultPostOrder = &PostOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &PostOrderField{
		Value: func(po *Post) (ent.Value, error) {
			return po.ID, nil
		},
		column: post.FieldID,
		toTerm: post.ByID,
		toCursor: func(po *Post) Cursor {
			return Cursor{ID: po.ID}
		},
	},
}

DefaultPostOrder is the default ordering of Post.

View Source
var DefaultSettingOrder = &SettingOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &SettingOrderField{
		Value: func(s *Setting) (ent.Value, error) {
			return s.ID, nil
		},
		column: setting.FieldID,
		toTerm: setting.ByID,
		toCursor: func(s *Setting) Cursor {
			return Cursor{ID: s.ID}
		},
	},
}

DefaultSettingOrder is the default ordering of Setting.

View Source
var DefaultUserOrder = &UserOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &UserOrderField{
		Value: func(u *User) (ent.Value, error) {
			return u.ID, nil
		},
		column: user.FieldID,
		toTerm: user.ByID,
		toCursor: func(u *User) Cursor {
			return Cursor{ID: u.ID}
		},
	},
}

DefaultUserOrder is the default ordering of User.

View Source
var ErrEmptyGroupWhereInput = errors.New("internal: empty predicate GroupWhereInput")

ErrEmptyGroupWhereInput is returned in case the GroupWhereInput is empty.

View Source
var ErrEmptyMessageWhereInput = errors.New("internal: empty predicate MessageWhereInput")

ErrEmptyMessageWhereInput is returned in case the MessageWhereInput is empty.

View Source
var ErrEmptyNotificationWhereInput = errors.New("internal: empty predicate NotificationWhereInput")

ErrEmptyNotificationWhereInput is returned in case the NotificationWhereInput is empty.

View Source
var ErrEmptyPostWhereInput = errors.New("internal: empty predicate PostWhereInput")

ErrEmptyPostWhereInput is returned in case the PostWhereInput is empty.

View Source
var ErrEmptySettingWhereInput = errors.New("internal: empty predicate SettingWhereInput")

ErrEmptySettingWhereInput is returned in case the SettingWhereInput is empty.

View Source
var ErrEmptyUserWhereInput = errors.New("internal: empty predicate UserWhereInput")

ErrEmptyUserWhereInput is returned in case the UserWhereInput is empty.

View Source
var Module = fx.Module("internal",
	fx.Provide(
		NewGraph,
		NewExecutableSchema,
	),
)

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 NewExecutableSchema

func NewExecutableSchema(cfg Config) graphql.ExecutableSchema

NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

func OpenTxFromContext

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

OpenTxFromContext open transactions from client stored in context.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Group is the client for interacting with the Group builders.
	Group *GroupClient
	// Message is the client for interacting with the Message builders.
	Message *MessageClient
	// Notification is the client for interacting with the Notification builders.
	Notification *NotificationClient
	// Post is the client for interacting with the Post builders.
	Post *PostClient
	// Setting is the client for interacting with the Setting builders.
	Setting *SettingClient
	// 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 NewGraph

func NewGraph(lc fx.Lifecycle, drv dialect.Driver) *Client

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().
	Group.
	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) Node

func (c *Client) Node(ctx context.Context, id uuid.UUID) (*Node, error)

Node returns the node with given global ID.

This API helpful in case you want to build an administrator tool to browser all types in system.

func (*Client) Noder

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

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

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

func (*Client) Noders

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

func (*Client) OpenTx

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

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

func (*Client) Tx

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

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

func (*Client) Use

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

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

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 ComplexityRoot

type ComplexityRoot struct {
	Group struct {
		CreatedAt func(childComplexity int) int
		ID        func(childComplexity int) int
		UpdatedAt func(childComplexity int) int
		Users     func(childComplexity int, after *entgql.Cursor[uuid.UUID], first *int, before *entgql.Cursor[uuid.UUID], last *int, where *UserWhereInput) int
	}

	GroupConnection struct {
		Edges      func(childComplexity int) int
		PageInfo   func(childComplexity int) int
		TotalCount func(childComplexity int) int
	}

	GroupEdge struct {
		Cursor func(childComplexity int) int
		Node   func(childComplexity int) int
	}

	Message struct {
		Body      func(childComplexity int) int
		CreatedAt func(childComplexity int) int
		From      func(childComplexity int, after *entgql.Cursor[uuid.UUID], first *int, before *entgql.Cursor[uuid.UUID], last *int, where *MessageWhereInput) int
		ID        func(childComplexity int) int
		To        func(childComplexity int, after *entgql.Cursor[uuid.UUID], first *int, before *entgql.Cursor[uuid.UUID], last *int, where *MessageWhereInput) int
		UpdatedAt func(childComplexity int) int
	}

	MessageConnection struct {
		Edges      func(childComplexity int) int
		PageInfo   func(childComplexity int) int
		TotalCount func(childComplexity int) int
	}

	MessageEdge struct {
		Cursor func(childComplexity int) int
		Node   func(childComplexity int) int
	}

	Notification struct {
		CreatedAt func(childComplexity int) int
		ID        func(childComplexity int) int
		UpdatedAt func(childComplexity int) int
	}

	NotificationConnection struct {
		Edges      func(childComplexity int) int
		PageInfo   func(childComplexity int) int
		TotalCount func(childComplexity int) int
	}

	NotificationEdge struct {
		Cursor func(childComplexity int) int
		Node   func(childComplexity int) int
	}

	PageInfo struct {
		EndCursor       func(childComplexity int) int
		HasNextPage     func(childComplexity int) int
		HasPreviousPage func(childComplexity int) int
		StartCursor     func(childComplexity int) int
	}

	Post struct {
		CreatedAt func(childComplexity int) int
		ID        func(childComplexity int) int
		UpdatedAt func(childComplexity int) int
		User      func(childComplexity int) int
	}

	PostConnection struct {
		Edges      func(childComplexity int) int
		PageInfo   func(childComplexity int) int
		TotalCount func(childComplexity int) int
	}

	PostEdge struct {
		Cursor func(childComplexity int) int
		Node   func(childComplexity int) int
	}

	Query struct {
		Node  func(childComplexity int, id uuid.UUID) int
		Nodes func(childComplexity int, ids []uuid.UUID) int
	}

	Setting struct {
		CreatedAt func(childComplexity int) int
		ID        func(childComplexity int) int
		UpdatedAt func(childComplexity int) int
	}

	SettingConnection struct {
		Edges      func(childComplexity int) int
		PageInfo   func(childComplexity int) int
		TotalCount func(childComplexity int) int
	}

	SettingEdge struct {
		Cursor func(childComplexity int) int
		Node   func(childComplexity int) int
	}

	User struct {
		AccountAddress func(childComplexity int) int
		Alias          func(childComplexity int) int
		Bio            func(childComplexity int) int
		CreatedAt      func(childComplexity int) int
		EmailAddress   func(childComplexity int) int
		FirstName      func(childComplexity int) int
		Followers      func(childComplexity int, after *entgql.Cursor[uuid.UUID], first *int, before *entgql.Cursor[uuid.UUID], last *int, where *UserWhereInput) int
		Following      func(childComplexity int, after *entgql.Cursor[uuid.UUID], first *int, before *entgql.Cursor[uuid.UUID], last *int, where *UserWhereInput) int
		Groups         func(childComplexity int, after *entgql.Cursor[uuid.UUID], first *int, before *entgql.Cursor[uuid.UUID], last *int, where *GroupWhereInput) int
		ID             func(childComplexity int) int
		LastName       func(childComplexity int) int
		Posts          func(childComplexity int, after *entgql.Cursor[uuid.UUID], first *int, before *entgql.Cursor[uuid.UUID], last *int, where *PostWhereInput) int
		UpdatedAt      func(childComplexity int) int
	}

	UserConnection struct {
		Edges      func(childComplexity int) int
		PageInfo   func(childComplexity int) int
		TotalCount func(childComplexity int) int
	}

	UserEdge struct {
		Cursor func(childComplexity int) int
		Node   func(childComplexity int) int
	}
}

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

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 Cursor

type Cursor = entgql.Cursor[uuid.UUID]

Common entgql types.

type DirectiveRoot

type DirectiveRoot struct {
}

type Edge

type Edge struct {
	Type string      `json:"type,omitempty"` // edge type.
	Name string      `json:"name,omitempty"` // edge name.
	IDs  []uuid.UUID `json:"ids,omitempty"`  // node ids (where this edge point to).
}

Edges between two nodes.

type Field

type Field struct {
	Type  string `json:"type,omitempty"`  // field type.
	Name  string `json:"name,omitempty"`  // field name (as in struct).
	Value string `json:"value,omitempty"` // stringified value.
}

Field of a node.

type Group

type Group 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"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the GroupQuery when eager-loading is set.
	Edges GroupEdges `json:"edges"`
	// contains filtered or unexported fields
}

Group is the model entity for the Group schema.

func (*Group) IsNode

func (n *Group) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*Group) NamedUsers

func (gr *Group) NamedUsers(name string) ([]*User, error)

NamedUsers returns the Users named value or an error if the edge was not loaded in eager-loading with this name.

func (*Group) Node

func (gr *Group) Node(ctx context.Context) (node *Node, err error)

Node implements Noder interface

func (*Group) QueryUsers

func (gr *Group) QueryUsers() *UserQuery

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

func (*Group) String

func (gr *Group) String() string

String implements the fmt.Stringer.

func (*Group) ToEdge

func (gr *Group) ToEdge(order *GroupOrder) *GroupEdge

ToEdge converts Group into GroupEdge.

func (*Group) Unwrap

func (gr *Group) Unwrap() *Group

Unwrap unwraps the Group entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Group) Update

func (gr *Group) Update() *GroupUpdateOne

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

func (*Group) Users

func (gr *Group) Users(
	ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, where *UserWhereInput,
) (*UserConnection, error)

func (*Group) Value

func (gr *Group) Value(name string) (ent.Value, error)

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

type GroupClient

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

GroupClient is a client for the Group schema.

func NewGroupClient

func NewGroupClient(c config) *GroupClient

NewGroupClient returns a client for the Group from the given config.

func (*GroupClient) Create

func (c *GroupClient) Create() *GroupCreate

Create returns a builder for creating a Group entity.

func (*GroupClient) CreateBulk

func (c *GroupClient) CreateBulk(builders ...*GroupCreate) *GroupCreateBulk

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

func (*GroupClient) Delete

func (c *GroupClient) Delete() *GroupDelete

Delete returns a delete builder for Group.

func (*GroupClient) DeleteOne

func (c *GroupClient) DeleteOne(gr *Group) *GroupDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GroupClient) DeleteOneID

func (c *GroupClient) DeleteOneID(id uuid.UUID) *GroupDeleteOne

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

func (*GroupClient) Get

func (c *GroupClient) Get(ctx context.Context, id uuid.UUID) (*Group, error)

Get returns a Group entity by its id.

func (*GroupClient) GetX

func (c *GroupClient) GetX(ctx context.Context, id uuid.UUID) *Group

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

func (*GroupClient) Hooks

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

Hooks returns the client hooks.

func (*GroupClient) Intercept

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

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

func (*GroupClient) Interceptors

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

Interceptors returns the client interceptors.

func (*GroupClient) Query

func (c *GroupClient) Query() *GroupQuery

Query returns a query builder for Group.

func (*GroupClient) QueryUsers

func (c *GroupClient) QueryUsers(gr *Group) *UserQuery

QueryUsers queries the users edge of a Group.

func (*GroupClient) Update

func (c *GroupClient) Update() *GroupUpdate

Update returns an update builder for Group.

func (*GroupClient) UpdateOne

func (c *GroupClient) UpdateOne(gr *Group) *GroupUpdateOne

UpdateOne returns an update builder for the given entity.

func (*GroupClient) UpdateOneID

func (c *GroupClient) UpdateOneID(id uuid.UUID) *GroupUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GroupClient) Use

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

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

type GroupConnection

type GroupConnection struct {
	Edges      []*GroupEdge `json:"edges"`
	PageInfo   PageInfo     `json:"pageInfo"`
	TotalCount int          `json:"totalCount"`
}

GroupConnection is the connection containing edges to Group.

type GroupCreate

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

GroupCreate is the builder for creating a Group entity.

func (*GroupCreate) AddUserIDs

func (gc *GroupCreate) AddUserIDs(ids ...uuid.UUID) *GroupCreate

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

func (*GroupCreate) AddUsers

func (gc *GroupCreate) AddUsers(u ...*User) *GroupCreate

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

func (*GroupCreate) Exec

func (gc *GroupCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupCreate) ExecX

func (gc *GroupCreate) ExecX(ctx context.Context)

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

func (*GroupCreate) Mutation

func (gc *GroupCreate) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupCreate) Save

func (gc *GroupCreate) Save(ctx context.Context) (*Group, error)

Save creates the Group in the database.

func (*GroupCreate) SaveX

func (gc *GroupCreate) SaveX(ctx context.Context) *Group

SaveX calls Save and panics if Save returns an error.

func (*GroupCreate) SetCreatedAt

func (gc *GroupCreate) SetCreatedAt(t time.Time) *GroupCreate

SetCreatedAt sets the "created_at" field.

func (*GroupCreate) SetID

func (gc *GroupCreate) SetID(u uuid.UUID) *GroupCreate

SetID sets the "id" field.

func (*GroupCreate) SetNillableCreatedAt

func (gc *GroupCreate) SetNillableCreatedAt(t *time.Time) *GroupCreate

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

func (*GroupCreate) SetNillableID

func (gc *GroupCreate) SetNillableID(u *uuid.UUID) *GroupCreate

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

func (*GroupCreate) SetNillableUpdatedAt

func (gc *GroupCreate) SetNillableUpdatedAt(t *time.Time) *GroupCreate

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

func (*GroupCreate) SetUpdatedAt

func (gc *GroupCreate) SetUpdatedAt(t time.Time) *GroupCreate

SetUpdatedAt sets the "updated_at" field.

type GroupCreateBulk

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

GroupCreateBulk is the builder for creating many Group entities in bulk.

func (*GroupCreateBulk) Exec

func (gcb *GroupCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupCreateBulk) ExecX

func (gcb *GroupCreateBulk) ExecX(ctx context.Context)

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

func (*GroupCreateBulk) Save

func (gcb *GroupCreateBulk) Save(ctx context.Context) ([]*Group, error)

Save creates the Group entities in the database.

func (*GroupCreateBulk) SaveX

func (gcb *GroupCreateBulk) SaveX(ctx context.Context) []*Group

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

type GroupDelete

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

GroupDelete is the builder for deleting a Group entity.

func (*GroupDelete) Exec

func (gd *GroupDelete) Exec(ctx context.Context) (int, error)

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

func (*GroupDelete) ExecX

func (gd *GroupDelete) ExecX(ctx context.Context) int

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

func (*GroupDelete) Where

func (gd *GroupDelete) Where(ps ...predicate.Group) *GroupDelete

Where appends a list predicates to the GroupDelete builder.

type GroupDeleteOne

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

GroupDeleteOne is the builder for deleting a single Group entity.

func (*GroupDeleteOne) Exec

func (gdo *GroupDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*GroupDeleteOne) ExecX

func (gdo *GroupDeleteOne) ExecX(ctx context.Context)

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

func (*GroupDeleteOne) Where

func (gdo *GroupDeleteOne) Where(ps ...predicate.Group) *GroupDeleteOne

Where appends a list predicates to the GroupDelete builder.

type GroupEdge

type GroupEdge struct {
	Node   *Group `json:"node"`
	Cursor Cursor `json:"cursor"`
}

GroupEdge is the edge representation of Group.

type GroupEdges

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

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

func (GroupEdges) UsersOrErr

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

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

type GroupGroupBy

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

GroupGroupBy is the group-by builder for Group entities.

func (*GroupGroupBy) Aggregate

func (ggb *GroupGroupBy) Aggregate(fns ...AggregateFunc) *GroupGroupBy

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

func (*GroupGroupBy) Bool

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

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

func (*GroupGroupBy) BoolX

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

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

func (*GroupGroupBy) Bools

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

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

func (*GroupGroupBy) BoolsX

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

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

func (*GroupGroupBy) Float64

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

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

func (*GroupGroupBy) Float64X

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

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

func (*GroupGroupBy) Float64s

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

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

func (*GroupGroupBy) Float64sX

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

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

func (*GroupGroupBy) Int

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

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

func (*GroupGroupBy) IntX

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

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

func (*GroupGroupBy) Ints

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

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

func (*GroupGroupBy) IntsX

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

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

func (*GroupGroupBy) Scan

func (ggb *GroupGroupBy) Scan(ctx context.Context, v any) error

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

func (*GroupGroupBy) ScanX

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

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

func (*GroupGroupBy) String

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

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

func (*GroupGroupBy) StringX

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

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

func (*GroupGroupBy) Strings

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

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

func (*GroupGroupBy) StringsX

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

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

type GroupMutation

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

GroupMutation represents an operation that mutates the Group nodes in the graph.

func (*GroupMutation) AddField

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

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

func (*GroupMutation) AddUserIDs

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

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

func (*GroupMutation) AddedEdges

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

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

func (*GroupMutation) AddedField

func (m *GroupMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*GroupMutation) AddedFields

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

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

func (*GroupMutation) AddedIDs

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

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

func (*GroupMutation) ClearEdge

func (m *GroupMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*GroupMutation) ClearField

func (m *GroupMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*GroupMutation) ClearUsers

func (m *GroupMutation) ClearUsers()

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

func (*GroupMutation) ClearedEdges

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

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

func (*GroupMutation) ClearedFields

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

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

func (GroupMutation) Client

func (m GroupMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*GroupMutation) CreatedAt

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

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

func (*GroupMutation) EdgeCleared

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

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

func (*GroupMutation) Field

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

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

func (*GroupMutation) FieldCleared

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

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

func (*GroupMutation) Fields

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

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

func (*GroupMutation) ID

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

func (m *GroupMutation) 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 (*GroupMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the Group entity. If the Group object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*GroupMutation) OldField

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

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*GroupMutation) OldUpdatedAt

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

OldUpdatedAt returns the old "updated_at" field's value of the Group entity. If the Group object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*GroupMutation) Op

func (m *GroupMutation) Op() Op

Op returns the operation name.

func (*GroupMutation) RemoveUserIDs

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

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

func (*GroupMutation) RemovedEdges

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

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

func (*GroupMutation) RemovedIDs

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

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

func (*GroupMutation) RemovedUsersIDs

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

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

func (*GroupMutation) ResetCreatedAt

func (m *GroupMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*GroupMutation) ResetEdge

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

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

func (*GroupMutation) ResetField

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

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

func (*GroupMutation) ResetUpdatedAt

func (m *GroupMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*GroupMutation) ResetUsers

func (m *GroupMutation) ResetUsers()

ResetUsers resets all changes to the "users" edge.

func (*GroupMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*GroupMutation) SetField

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

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

func (*GroupMutation) SetID

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

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

func (*GroupMutation) SetOp

func (m *GroupMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*GroupMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (GroupMutation) Tx

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

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

func (*GroupMutation) Type

func (m *GroupMutation) Type() string

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

func (*GroupMutation) UpdatedAt

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

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

func (*GroupMutation) UsersCleared

func (m *GroupMutation) UsersCleared() bool

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

func (*GroupMutation) UsersIDs

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

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

func (*GroupMutation) Where

func (m *GroupMutation) Where(ps ...predicate.Group)

Where appends a list predicates to the GroupMutation builder.

func (*GroupMutation) WhereP

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

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

type GroupOrder

type GroupOrder struct {
	Direction OrderDirection   `json:"direction"`
	Field     *GroupOrderField `json:"field"`
}

GroupOrder defines the ordering of Group.

type GroupOrderField

type GroupOrderField struct {
	// Value extracts the ordering value from the given Group.
	Value func(*Group) (ent.Value, error)
	// contains filtered or unexported fields
}

GroupOrderField defines the ordering field of Group.

type GroupPaginateOption

type GroupPaginateOption func(*groupPager) error

GroupPaginateOption enables pagination customization.

func WithGroupFilter

func WithGroupFilter(filter func(*GroupQuery) (*GroupQuery, error)) GroupPaginateOption

WithGroupFilter configures pagination filter.

func WithGroupOrder

func WithGroupOrder(order *GroupOrder) GroupPaginateOption

WithGroupOrder configures pagination ordering.

type GroupQuery

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

GroupQuery is the builder for querying Group entities.

func (*GroupQuery) Aggregate

func (gq *GroupQuery) Aggregate(fns ...AggregateFunc) *GroupSelect

Aggregate returns a GroupSelect configured with the given aggregations.

func (*GroupQuery) All

func (gq *GroupQuery) All(ctx context.Context) ([]*Group, error)

All executes the query and returns a list of Groups.

func (*GroupQuery) AllX

func (gq *GroupQuery) AllX(ctx context.Context) []*Group

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

func (*GroupQuery) Clone

func (gq *GroupQuery) Clone() *GroupQuery

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

func (*GroupQuery) CollectFields

func (gr *GroupQuery) CollectFields(ctx context.Context, satisfies ...string) (*GroupQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*GroupQuery) Count

func (gq *GroupQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GroupQuery) CountX

func (gq *GroupQuery) CountX(ctx context.Context) int

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

func (*GroupQuery) Exist

func (gq *GroupQuery) Exist(ctx context.Context) (bool, error)

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

func (*GroupQuery) ExistX

func (gq *GroupQuery) ExistX(ctx context.Context) bool

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

func (*GroupQuery) First

func (gq *GroupQuery) First(ctx context.Context) (*Group, error)

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

func (*GroupQuery) FirstID

func (gq *GroupQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*GroupQuery) FirstIDX

func (gq *GroupQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*GroupQuery) FirstX

func (gq *GroupQuery) FirstX(ctx context.Context) *Group

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

func (*GroupQuery) GroupBy

func (gq *GroupQuery) GroupBy(field string, fields ...string) *GroupGroupBy

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

Example:

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

client.Group.Query().
	GroupBy(group.FieldCreatedAt).
	Aggregate(internal.Count()).
	Scan(ctx, &v)

func (*GroupQuery) IDs

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

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

func (*GroupQuery) IDsX

func (gq *GroupQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*GroupQuery) Limit

func (gq *GroupQuery) Limit(limit int) *GroupQuery

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

func (*GroupQuery) Offset

func (gq *GroupQuery) Offset(offset int) *GroupQuery

Offset to start from.

func (*GroupQuery) Only

func (gq *GroupQuery) Only(ctx context.Context) (*Group, error)

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

func (*GroupQuery) OnlyID

func (gq *GroupQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*GroupQuery) OnlyIDX

func (gq *GroupQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*GroupQuery) OnlyX

func (gq *GroupQuery) OnlyX(ctx context.Context) *Group

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

func (*GroupQuery) Order

func (gq *GroupQuery) Order(o ...group.OrderOption) *GroupQuery

Order specifies how the records should be ordered.

func (*GroupQuery) Paginate

func (gr *GroupQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...GroupPaginateOption,
) (*GroupConnection, error)

Paginate executes the query and returns a relay based cursor connection to Group.

func (*GroupQuery) QueryUsers

func (gq *GroupQuery) QueryUsers() *UserQuery

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

func (*GroupQuery) Select

func (gq *GroupQuery) Select(fields ...string) *GroupSelect

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

Example:

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

client.Group.Query().
	Select(group.FieldCreatedAt).
	Scan(ctx, &v)

func (*GroupQuery) Unique

func (gq *GroupQuery) Unique(unique bool) *GroupQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*GroupQuery) Where

func (gq *GroupQuery) Where(ps ...predicate.Group) *GroupQuery

Where adds a new predicate for the GroupQuery builder.

func (*GroupQuery) WithNamedUsers

func (gq *GroupQuery) WithNamedUsers(name string, opts ...func(*UserQuery)) *GroupQuery

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

func (*GroupQuery) WithUsers

func (gq *GroupQuery) WithUsers(opts ...func(*UserQuery)) *GroupQuery

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

type GroupSelect

type GroupSelect struct {
	*GroupQuery
	// contains filtered or unexported fields
}

GroupSelect is the builder for selecting fields of Group entities.

func (*GroupSelect) Aggregate

func (gs *GroupSelect) Aggregate(fns ...AggregateFunc) *GroupSelect

Aggregate adds the given aggregation functions to the selector query.

func (*GroupSelect) Bool

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

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

func (*GroupSelect) BoolX

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

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

func (*GroupSelect) Bools

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

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

func (*GroupSelect) BoolsX

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

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

func (*GroupSelect) Float64

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

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

func (*GroupSelect) Float64X

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

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

func (*GroupSelect) Float64s

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

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

func (*GroupSelect) Float64sX

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

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

func (*GroupSelect) Int

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

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

func (*GroupSelect) IntX

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

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

func (*GroupSelect) Ints

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

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

func (*GroupSelect) IntsX

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

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

func (*GroupSelect) Scan

func (gs *GroupSelect) Scan(ctx context.Context, v any) error

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

func (*GroupSelect) ScanX

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

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

func (*GroupSelect) String

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

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

func (*GroupSelect) StringX

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

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

func (*GroupSelect) Strings

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

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

func (*GroupSelect) StringsX

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

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

type GroupUpdate

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

GroupUpdate is the builder for updating Group entities.

func (*GroupUpdate) AddUserIDs

func (gu *GroupUpdate) AddUserIDs(ids ...uuid.UUID) *GroupUpdate

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

func (*GroupUpdate) AddUsers

func (gu *GroupUpdate) AddUsers(u ...*User) *GroupUpdate

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

func (*GroupUpdate) ClearUsers

func (gu *GroupUpdate) ClearUsers() *GroupUpdate

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

func (*GroupUpdate) Exec

func (gu *GroupUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupUpdate) ExecX

func (gu *GroupUpdate) ExecX(ctx context.Context)

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

func (*GroupUpdate) Mutation

func (gu *GroupUpdate) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupUpdate) RemoveUserIDs

func (gu *GroupUpdate) RemoveUserIDs(ids ...uuid.UUID) *GroupUpdate

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

func (*GroupUpdate) RemoveUsers

func (gu *GroupUpdate) RemoveUsers(u ...*User) *GroupUpdate

RemoveUsers removes "users" edges to User entities.

func (*GroupUpdate) Save

func (gu *GroupUpdate) Save(ctx context.Context) (int, error)

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

func (*GroupUpdate) SaveX

func (gu *GroupUpdate) SaveX(ctx context.Context) int

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

func (*GroupUpdate) SetUpdatedAt

func (gu *GroupUpdate) SetUpdatedAt(t time.Time) *GroupUpdate

SetUpdatedAt sets the "updated_at" field.

func (*GroupUpdate) Where

func (gu *GroupUpdate) Where(ps ...predicate.Group) *GroupUpdate

Where appends a list predicates to the GroupUpdate builder.

type GroupUpdateOne

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

GroupUpdateOne is the builder for updating a single Group entity.

func (*GroupUpdateOne) AddUserIDs

func (guo *GroupUpdateOne) AddUserIDs(ids ...uuid.UUID) *GroupUpdateOne

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

func (*GroupUpdateOne) AddUsers

func (guo *GroupUpdateOne) AddUsers(u ...*User) *GroupUpdateOne

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

func (*GroupUpdateOne) ClearUsers

func (guo *GroupUpdateOne) ClearUsers() *GroupUpdateOne

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

func (*GroupUpdateOne) Exec

func (guo *GroupUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GroupUpdateOne) ExecX

func (guo *GroupUpdateOne) ExecX(ctx context.Context)

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

func (*GroupUpdateOne) Mutation

func (guo *GroupUpdateOne) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupUpdateOne) RemoveUserIDs

func (guo *GroupUpdateOne) RemoveUserIDs(ids ...uuid.UUID) *GroupUpdateOne

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

func (*GroupUpdateOne) RemoveUsers

func (guo *GroupUpdateOne) RemoveUsers(u ...*User) *GroupUpdateOne

RemoveUsers removes "users" edges to User entities.

func (*GroupUpdateOne) Save

func (guo *GroupUpdateOne) Save(ctx context.Context) (*Group, error)

Save executes the query and returns the updated Group entity.

func (*GroupUpdateOne) SaveX

func (guo *GroupUpdateOne) SaveX(ctx context.Context) *Group

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

func (*GroupUpdateOne) Select

func (guo *GroupUpdateOne) Select(field string, fields ...string) *GroupUpdateOne

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

func (*GroupUpdateOne) SetUpdatedAt

func (guo *GroupUpdateOne) SetUpdatedAt(t time.Time) *GroupUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*GroupUpdateOne) Where

func (guo *GroupUpdateOne) Where(ps ...predicate.Group) *GroupUpdateOne

Where appends a list predicates to the GroupUpdate builder.

type GroupWhereInput

type GroupWhereInput struct {
	Predicates []predicate.Group  `json:"-"`
	Not        *GroupWhereInput   `json:"not,omitempty"`
	Or         []*GroupWhereInput `json:"or,omitempty"`
	And        []*GroupWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *uuid.UUID  `json:"id,omitempty"`
	IDNEQ   *uuid.UUID  `json:"idNEQ,omitempty"`
	IDIn    []uuid.UUID `json:"idIn,omitempty"`
	IDNotIn []uuid.UUID `json:"idNotIn,omitempty"`
	IDGT    *uuid.UUID  `json:"idGT,omitempty"`
	IDGTE   *uuid.UUID  `json:"idGTE,omitempty"`
	IDLT    *uuid.UUID  `json:"idLT,omitempty"`
	IDLTE   *uuid.UUID  `json:"idLTE,omitempty"`

	// "created_at" field predicates.
	CreatedAt      *time.Time  `json:"createdAt,omitempty"`
	CreatedAtNEQ   *time.Time  `json:"createdAtNEQ,omitempty"`
	CreatedAtIn    []time.Time `json:"createdAtIn,omitempty"`
	CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"`
	CreatedAtGT    *time.Time  `json:"createdAtGT,omitempty"`
	CreatedAtGTE   *time.Time  `json:"createdAtGTE,omitempty"`
	CreatedAtLT    *time.Time  `json:"createdAtLT,omitempty"`
	CreatedAtLTE   *time.Time  `json:"createdAtLTE,omitempty"`

	// "updated_at" field predicates.
	UpdatedAt      *time.Time  `json:"updatedAt,omitempty"`
	UpdatedAtNEQ   *time.Time  `json:"updatedAtNEQ,omitempty"`
	UpdatedAtIn    []time.Time `json:"updatedAtIn,omitempty"`
	UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"`
	UpdatedAtGT    *time.Time  `json:"updatedAtGT,omitempty"`
	UpdatedAtGTE   *time.Time  `json:"updatedAtGTE,omitempty"`
	UpdatedAtLT    *time.Time  `json:"updatedAtLT,omitempty"`
	UpdatedAtLTE   *time.Time  `json:"updatedAtLTE,omitempty"`

	// "users" edge predicates.
	HasUsers     *bool             `json:"hasUsers,omitempty"`
	HasUsersWith []*UserWhereInput `json:"hasUsersWith,omitempty"`
}

GroupWhereInput represents a where input for filtering Group queries.

func (*GroupWhereInput) AddPredicates

func (i *GroupWhereInput) AddPredicates(predicates ...predicate.Group)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*GroupWhereInput) Filter

func (i *GroupWhereInput) Filter(q *GroupQuery) (*GroupQuery, error)

Filter applies the GroupWhereInput filter on the GroupQuery builder.

func (*GroupWhereInput) P

P returns a predicate for filtering groups. An error is returned if the input is empty or invalid.

type Groups

type Groups []*Group

Groups is a parsable slice of Group.

type Hook

type Hook = ent.Hook

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

type 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"`
	// Body holds the value of the "body" field.
	Body string `json:"body,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) From

func (m *Message) From(
	ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, where *MessageWhereInput,
) (*MessageConnection, error)

func (*Message) IsNode

func (n *Message) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*Message) NamedFrom

func (m *Message) NamedFrom(name string) ([]*Message, error)

NamedFrom returns the From named value or an error if the edge was not loaded in eager-loading with this name.

func (*Message) NamedTo

func (m *Message) NamedTo(name string) ([]*Message, error)

NamedTo returns the To named value or an error if the edge was not loaded in eager-loading with this name.

func (*Message) Node

func (m *Message) Node(ctx context.Context) (node *Node, err error)

Node implements Noder interface

func (*Message) QueryFrom

func (m *Message) QueryFrom() *MessageQuery

QueryFrom queries the "from" edge of the Message entity.

func (*Message) QueryTo

func (m *Message) QueryTo() *MessageQuery

QueryTo queries the "to" edge of the Message entity.

func (*Message) String

func (m *Message) String() string

String implements the fmt.Stringer.

func (*Message) To

func (m *Message) To(
	ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, where *MessageWhereInput,
) (*MessageConnection, error)

func (*Message) ToEdge

func (m *Message) ToEdge(order *MessageOrder) *MessageEdge

ToEdge converts Message into MessageEdge.

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

func (c *MessageClient) Query() *MessageQuery

Query returns a query builder for Message.

func (*MessageClient) QueryFrom

func (c *MessageClient) QueryFrom(m *Message) *MessageQuery

QueryFrom queries the from edge of a Message.

func (*MessageClient) QueryTo

func (c *MessageClient) QueryTo(m *Message) *MessageQuery

QueryTo queries the to 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 MessageConnection

type MessageConnection struct {
	Edges      []*MessageEdge `json:"edges"`
	PageInfo   PageInfo       `json:"pageInfo"`
	TotalCount int            `json:"totalCount"`
}

MessageConnection is the connection containing edges to Message.

type MessageCreate

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

MessageCreate is the builder for creating a Message entity.

func (*MessageCreate) AddFrom

func (mc *MessageCreate) AddFrom(m ...*Message) *MessageCreate

AddFrom adds the "from" edges to the Message entity.

func (*MessageCreate) AddFromIDs

func (mc *MessageCreate) AddFromIDs(ids ...uuid.UUID) *MessageCreate

AddFromIDs adds the "from" edge to the Message entity by IDs.

func (*MessageCreate) AddTo

func (mc *MessageCreate) AddTo(m ...*Message) *MessageCreate

AddTo adds the "to" edges to the Message entity.

func (*MessageCreate) AddToIDs

func (mc *MessageCreate) AddToIDs(ids ...uuid.UUID) *MessageCreate

AddToIDs adds the "to" edge to the Message entity by IDs.

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

func (mc *MessageCreate) SetBody(s string) *MessageCreate

SetBody sets the "body" field.

func (*MessageCreate) SetCreatedAt

func (mc *MessageCreate) SetCreatedAt(t time.Time) *MessageCreate

SetCreatedAt sets the "created_at" 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) SetNillableID

func (mc *MessageCreate) SetNillableID(u *uuid.UUID) *MessageCreate

SetNillableID sets the "id" 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) 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 MessageEdge

type MessageEdge struct {
	Node   *Message `json:"node"`
	Cursor Cursor   `json:"cursor"`
}

MessageEdge is the edge representation of Message.

type MessageEdges

type MessageEdges struct {
	// From holds the value of the from edge.
	From []*Message `json:"from,omitempty"`
	// To holds the value of the to edge.
	To []*Message `json:"to,omitempty"`
	// contains filtered or unexported fields
}

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

func (MessageEdges) FromOrErr

func (e MessageEdges) FromOrErr() ([]*Message, error)

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

func (MessageEdges) ToOrErr

func (e MessageEdges) ToOrErr() ([]*Message, error)

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

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

func (m *MessageMutation) AddFromIDs(ids ...uuid.UUID)

AddFromIDs adds the "from" edge to the Message entity by ids.

func (*MessageMutation) AddToIDs

func (m *MessageMutation) AddToIDs(ids ...uuid.UUID)

AddToIDs adds the "to" edge to the Message entity by ids.

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

func (m *MessageMutation) Body() (r string, exists bool)

Body returns the value of the "body" field in the mutation.

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

func (m *MessageMutation) ClearFrom()

ClearFrom clears the "from" edge to the Message entity.

func (*MessageMutation) ClearTo

func (m *MessageMutation) ClearTo()

ClearTo clears the "to" edge to the Message entity.

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

func (m *MessageMutation) FromCleared() bool

FromCleared reports if the "from" edge to the Message entity was cleared.

func (*MessageMutation) FromIDs

func (m *MessageMutation) FromIDs() (ids []uuid.UUID)

FromIDs returns the "from" edge IDs in the mutation.

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

func (m *MessageMutation) OldBody(ctx context.Context) (v string, err error)

OldBody returns the old "body" 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) 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) RemoveFromIDs

func (m *MessageMutation) RemoveFromIDs(ids ...uuid.UUID)

RemoveFromIDs removes the "from" edge to the Message entity by IDs.

func (*MessageMutation) RemoveToIDs

func (m *MessageMutation) RemoveToIDs(ids ...uuid.UUID)

RemoveToIDs removes the "to" edge to the Message entity by IDs.

func (*MessageMutation) RemovedEdges

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

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

func (*MessageMutation) RemovedFromIDs

func (m *MessageMutation) RemovedFromIDs() (ids []uuid.UUID)

RemovedFrom returns the removed IDs of the "from" edge to the Message entity.

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

func (m *MessageMutation) RemovedToIDs() (ids []uuid.UUID)

RemovedTo returns the removed IDs of the "to" edge to the Message entity.

func (*MessageMutation) ResetBody

func (m *MessageMutation) ResetBody()

ResetBody resets all changes to the "body" 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) ResetFrom

func (m *MessageMutation) ResetFrom()

ResetFrom resets all changes to the "from" edge.

func (*MessageMutation) ResetTo

func (m *MessageMutation) ResetTo()

ResetTo resets all changes to the "to" edge.

func (*MessageMutation) ResetUpdatedAt

func (m *MessageMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*MessageMutation) SetBody

func (m *MessageMutation) SetBody(s string)

SetBody sets the "body" 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) 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) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*MessageMutation) ToCleared

func (m *MessageMutation) ToCleared() bool

ToCleared reports if the "to" edge to the Message entity was cleared.

func (*MessageMutation) ToIDs

func (m *MessageMutation) ToIDs() (ids []uuid.UUID)

ToIDs returns the "to" edge IDs in the 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 MessageOrder

type MessageOrder struct {
	Direction OrderDirection     `json:"direction"`
	Field     *MessageOrderField `json:"field"`
}

MessageOrder defines the ordering of Message.

type MessageOrderField

type MessageOrderField struct {
	// Value extracts the ordering value from the given Message.
	Value func(*Message) (ent.Value, error)
	// contains filtered or unexported fields
}

MessageOrderField defines the ordering field of Message.

type MessagePaginateOption

type MessagePaginateOption func(*messagePager) error

MessagePaginateOption enables pagination customization.

func WithMessageFilter

func WithMessageFilter(filter func(*MessageQuery) (*MessageQuery, error)) MessagePaginateOption

WithMessageFilter configures pagination filter.

func WithMessageOrder

func WithMessageOrder(order *MessageOrder) MessagePaginateOption

WithMessageOrder configures pagination ordering.

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

func (m *MessageQuery) CollectFields(ctx context.Context, satisfies ...string) (*MessageQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

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(internal.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) Paginate

func (m *MessageQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...MessagePaginateOption,
) (*MessageConnection, error)

Paginate executes the query and returns a relay based cursor connection to Message.

func (*MessageQuery) QueryFrom

func (mq *MessageQuery) QueryFrom() *MessageQuery

QueryFrom chains the current query on the "from" edge.

func (*MessageQuery) QueryTo

func (mq *MessageQuery) QueryTo() *MessageQuery

QueryTo chains the current query on the "to" 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) WithFrom

func (mq *MessageQuery) WithFrom(opts ...func(*MessageQuery)) *MessageQuery

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

func (*MessageQuery) WithNamedFrom

func (mq *MessageQuery) WithNamedFrom(name string, opts ...func(*MessageQuery)) *MessageQuery

WithNamedFrom tells the query-builder to eager-load the nodes that are connected to the "from" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*MessageQuery) WithNamedTo

func (mq *MessageQuery) WithNamedTo(name string, opts ...func(*MessageQuery)) *MessageQuery

WithNamedTo tells the query-builder to eager-load the nodes that are connected to the "to" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*MessageQuery) WithTo

func (mq *MessageQuery) WithTo(opts ...func(*MessageQuery)) *MessageQuery

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

func (mu *MessageUpdate) AddFrom(m ...*Message) *MessageUpdate

AddFrom adds the "from" edges to the Message entity.

func (*MessageUpdate) AddFromIDs

func (mu *MessageUpdate) AddFromIDs(ids ...uuid.UUID) *MessageUpdate

AddFromIDs adds the "from" edge to the Message entity by IDs.

func (*MessageUpdate) AddTo

func (mu *MessageUpdate) AddTo(m ...*Message) *MessageUpdate

AddTo adds the "to" edges to the Message entity.

func (*MessageUpdate) AddToIDs

func (mu *MessageUpdate) AddToIDs(ids ...uuid.UUID) *MessageUpdate

AddToIDs adds the "to" edge to the Message entity by IDs.

func (*MessageUpdate) ClearFrom

func (mu *MessageUpdate) ClearFrom() *MessageUpdate

ClearFrom clears all "from" edges to the Message entity.

func (*MessageUpdate) ClearTo

func (mu *MessageUpdate) ClearTo() *MessageUpdate

ClearTo clears all "to" edges to the Message entity.

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

func (mu *MessageUpdate) RemoveFrom(m ...*Message) *MessageUpdate

RemoveFrom removes "from" edges to Message entities.

func (*MessageUpdate) RemoveFromIDs

func (mu *MessageUpdate) RemoveFromIDs(ids ...uuid.UUID) *MessageUpdate

RemoveFromIDs removes the "from" edge to Message entities by IDs.

func (*MessageUpdate) RemoveTo

func (mu *MessageUpdate) RemoveTo(m ...*Message) *MessageUpdate

RemoveTo removes "to" edges to Message entities.

func (*MessageUpdate) RemoveToIDs

func (mu *MessageUpdate) RemoveToIDs(ids ...uuid.UUID) *MessageUpdate

RemoveToIDs removes the "to" edge to Message entities by IDs.

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

func (mu *MessageUpdate) SetBody(s string) *MessageUpdate

SetBody sets the "body" 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) AddFrom

func (muo *MessageUpdateOne) AddFrom(m ...*Message) *MessageUpdateOne

AddFrom adds the "from" edges to the Message entity.

func (*MessageUpdateOne) AddFromIDs

func (muo *MessageUpdateOne) AddFromIDs(ids ...uuid.UUID) *MessageUpdateOne

AddFromIDs adds the "from" edge to the Message entity by IDs.

func (*MessageUpdateOne) AddTo

func (muo *MessageUpdateOne) AddTo(m ...*Message) *MessageUpdateOne

AddTo adds the "to" edges to the Message entity.

func (*MessageUpdateOne) AddToIDs

func (muo *MessageUpdateOne) AddToIDs(ids ...uuid.UUID) *MessageUpdateOne

AddToIDs adds the "to" edge to the Message entity by IDs.

func (*MessageUpdateOne) ClearFrom

func (muo *MessageUpdateOne) ClearFrom() *MessageUpdateOne

ClearFrom clears all "from" edges to the Message entity.

func (*MessageUpdateOne) ClearTo

func (muo *MessageUpdateOne) ClearTo() *MessageUpdateOne

ClearTo clears all "to" edges to the Message entity.

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

func (muo *MessageUpdateOne) RemoveFrom(m ...*Message) *MessageUpdateOne

RemoveFrom removes "from" edges to Message entities.

func (*MessageUpdateOne) RemoveFromIDs

func (muo *MessageUpdateOne) RemoveFromIDs(ids ...uuid.UUID) *MessageUpdateOne

RemoveFromIDs removes the "from" edge to Message entities by IDs.

func (*MessageUpdateOne) RemoveTo

func (muo *MessageUpdateOne) RemoveTo(m ...*Message) *MessageUpdateOne

RemoveTo removes "to" edges to Message entities.

func (*MessageUpdateOne) RemoveToIDs

func (muo *MessageUpdateOne) RemoveToIDs(ids ...uuid.UUID) *MessageUpdateOne

RemoveToIDs removes the "to" edge to Message entities by IDs.

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

func (muo *MessageUpdateOne) SetBody(s string) *MessageUpdateOne

SetBody sets the "body" 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 MessageWhereInput

type MessageWhereInput struct {
	Predicates []predicate.Message  `json:"-"`
	Not        *MessageWhereInput   `json:"not,omitempty"`
	Or         []*MessageWhereInput `json:"or,omitempty"`
	And        []*MessageWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *uuid.UUID  `json:"id,omitempty"`
	IDNEQ   *uuid.UUID  `json:"idNEQ,omitempty"`
	IDIn    []uuid.UUID `json:"idIn,omitempty"`
	IDNotIn []uuid.UUID `json:"idNotIn,omitempty"`
	IDGT    *uuid.UUID  `json:"idGT,omitempty"`
	IDGTE   *uuid.UUID  `json:"idGTE,omitempty"`
	IDLT    *uuid.UUID  `json:"idLT,omitempty"`
	IDLTE   *uuid.UUID  `json:"idLTE,omitempty"`

	// "created_at" field predicates.
	CreatedAt      *time.Time  `json:"createdAt,omitempty"`
	CreatedAtNEQ   *time.Time  `json:"createdAtNEQ,omitempty"`
	CreatedAtIn    []time.Time `json:"createdAtIn,omitempty"`
	CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"`
	CreatedAtGT    *time.Time  `json:"createdAtGT,omitempty"`
	CreatedAtGTE   *time.Time  `json:"createdAtGTE,omitempty"`
	CreatedAtLT    *time.Time  `json:"createdAtLT,omitempty"`
	CreatedAtLTE   *time.Time  `json:"createdAtLTE,omitempty"`

	// "updated_at" field predicates.
	UpdatedAt      *time.Time  `json:"updatedAt,omitempty"`
	UpdatedAtNEQ   *time.Time  `json:"updatedAtNEQ,omitempty"`
	UpdatedAtIn    []time.Time `json:"updatedAtIn,omitempty"`
	UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"`
	UpdatedAtGT    *time.Time  `json:"updatedAtGT,omitempty"`
	UpdatedAtGTE   *time.Time  `json:"updatedAtGTE,omitempty"`
	UpdatedAtLT    *time.Time  `json:"updatedAtLT,omitempty"`
	UpdatedAtLTE   *time.Time  `json:"updatedAtLTE,omitempty"`

	// "body" field predicates.
	Body             *string  `json:"body,omitempty"`
	BodyNEQ          *string  `json:"bodyNEQ,omitempty"`
	BodyIn           []string `json:"bodyIn,omitempty"`
	BodyNotIn        []string `json:"bodyNotIn,omitempty"`
	BodyGT           *string  `json:"bodyGT,omitempty"`
	BodyGTE          *string  `json:"bodyGTE,omitempty"`
	BodyLT           *string  `json:"bodyLT,omitempty"`
	BodyLTE          *string  `json:"bodyLTE,omitempty"`
	BodyContains     *string  `json:"bodyContains,omitempty"`
	BodyHasPrefix    *string  `json:"bodyHasPrefix,omitempty"`
	BodyHasSuffix    *string  `json:"bodyHasSuffix,omitempty"`
	BodyEqualFold    *string  `json:"bodyEqualFold,omitempty"`
	BodyContainsFold *string  `json:"bodyContainsFold,omitempty"`

	// "from" edge predicates.
	HasFrom     *bool                `json:"hasFrom,omitempty"`
	HasFromWith []*MessageWhereInput `json:"hasFromWith,omitempty"`

	// "to" edge predicates.
	HasTo     *bool                `json:"hasTo,omitempty"`
	HasToWith []*MessageWhereInput `json:"hasToWith,omitempty"`
}

MessageWhereInput represents a where input for filtering Message queries.

func (*MessageWhereInput) AddPredicates

func (i *MessageWhereInput) AddPredicates(predicates ...predicate.Message)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*MessageWhereInput) Filter

Filter applies the MessageWhereInput filter on the MessageQuery builder.

func (*MessageWhereInput) P

P returns a predicate for filtering messages. An error is returned if the input is empty or invalid.

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 Node

type Node struct {
	ID     uuid.UUID `json:"id,omitempty"`     // node id.
	Type   string    `json:"type,omitempty"`   // node type.
	Fields []*Field  `json:"fields,omitempty"` // node fields.
	Edges  []*Edge   `json:"edges,omitempty"`  // node edges.
}

Node in the graph.

type NodeOption

type NodeOption func(*nodeOptions)

NodeOption allows configuring the Noder execution using functional options.

func WithFixedNodeType

func WithFixedNodeType(t string) NodeOption

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

func WithNodeType

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

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

type Noder

type Noder interface {
	Node(context.Context) (*Node, error)
	IsNode()
}

Noder wraps the basic Node method.

type NotFoundError

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

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type 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"`
	// contains filtered or unexported fields
}

Notification is the model entity for the Notification schema.

func (*Notification) IsNode

func (n *Notification) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*Notification) Node

func (n *Notification) Node(ctx context.Context) (node *Node, err error)

Node implements Noder interface

func (*Notification) String

func (n *Notification) String() string

String implements the fmt.Stringer.

func (*Notification) ToEdge

func (n *Notification) ToEdge(order *NotificationOrder) *NotificationEdge

ToEdge converts Notification into NotificationEdge.

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

Query returns a query builder for 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 NotificationConnection

type NotificationConnection struct {
	Edges      []*NotificationEdge `json:"edges"`
	PageInfo   PageInfo            `json:"pageInfo"`
	TotalCount int                 `json:"totalCount"`
}

NotificationConnection is the connection containing edges to Notification.

type NotificationCreate

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

NotificationCreate is the builder for creating a Notification 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) 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) 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) SetNillableUpdatedAt

func (nc *NotificationCreate) SetNillableUpdatedAt(t *time.Time) *NotificationCreate

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

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 NotificationEdge

type NotificationEdge struct {
	Node   *Notification `json:"node"`
	Cursor Cursor        `json:"cursor"`
}

NotificationEdge is the edge representation of Notification.

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

func (m *NotificationMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" 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) SetOp

func (m *NotificationMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*NotificationMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

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 NotificationOrder

type NotificationOrder struct {
	Direction OrderDirection          `json:"direction"`
	Field     *NotificationOrderField `json:"field"`
}

NotificationOrder defines the ordering of Notification.

type NotificationOrderField

type NotificationOrderField struct {
	// Value extracts the ordering value from the given Notification.
	Value func(*Notification) (ent.Value, error)
	// contains filtered or unexported fields
}

NotificationOrderField defines the ordering field of Notification.

type NotificationPaginateOption

type NotificationPaginateOption func(*notificationPager) error

NotificationPaginateOption enables pagination customization.

func WithNotificationFilter

func WithNotificationFilter(filter func(*NotificationQuery) (*NotificationQuery, error)) NotificationPaginateOption

WithNotificationFilter configures pagination filter.

func WithNotificationOrder

func WithNotificationOrder(order *NotificationOrder) NotificationPaginateOption

WithNotificationOrder configures pagination ordering.

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

func (n *NotificationQuery) CollectFields(ctx context.Context, satisfies ...string) (*NotificationQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

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(internal.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) Paginate

func (n *NotificationQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...NotificationPaginateOption,
) (*NotificationConnection, error)

Paginate executes the query and returns a relay based cursor connection to Notification.

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.

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

type NotificationWhereInput struct {
	Predicates []predicate.Notification  `json:"-"`
	Not        *NotificationWhereInput   `json:"not,omitempty"`
	Or         []*NotificationWhereInput `json:"or,omitempty"`
	And        []*NotificationWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *uuid.UUID  `json:"id,omitempty"`
	IDNEQ   *uuid.UUID  `json:"idNEQ,omitempty"`
	IDIn    []uuid.UUID `json:"idIn,omitempty"`
	IDNotIn []uuid.UUID `json:"idNotIn,omitempty"`
	IDGT    *uuid.UUID  `json:"idGT,omitempty"`
	IDGTE   *uuid.UUID  `json:"idGTE,omitempty"`
	IDLT    *uuid.UUID  `json:"idLT,omitempty"`
	IDLTE   *uuid.UUID  `json:"idLTE,omitempty"`

	// "created_at" field predicates.
	CreatedAt      *time.Time  `json:"createdAt,omitempty"`
	CreatedAtNEQ   *time.Time  `json:"createdAtNEQ,omitempty"`
	CreatedAtIn    []time.Time `json:"createdAtIn,omitempty"`
	CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"`
	CreatedAtGT    *time.Time  `json:"createdAtGT,omitempty"`
	CreatedAtGTE   *time.Time  `json:"createdAtGTE,omitempty"`
	CreatedAtLT    *time.Time  `json:"createdAtLT,omitempty"`
	CreatedAtLTE   *time.Time  `json:"createdAtLTE,omitempty"`

	// "updated_at" field predicates.
	UpdatedAt      *time.Time  `json:"updatedAt,omitempty"`
	UpdatedAtNEQ   *time.Time  `json:"updatedAtNEQ,omitempty"`
	UpdatedAtIn    []time.Time `json:"updatedAtIn,omitempty"`
	UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"`
	UpdatedAtGT    *time.Time  `json:"updatedAtGT,omitempty"`
	UpdatedAtGTE   *time.Time  `json:"updatedAtGTE,omitempty"`
	UpdatedAtLT    *time.Time  `json:"updatedAtLT,omitempty"`
	UpdatedAtLTE   *time.Time  `json:"updatedAtLTE,omitempty"`
}

NotificationWhereInput represents a where input for filtering Notification queries.

func (*NotificationWhereInput) AddPredicates

func (i *NotificationWhereInput) AddPredicates(predicates ...predicate.Notification)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*NotificationWhereInput) Filter

Filter applies the NotificationWhereInput filter on the NotificationQuery builder.

func (*NotificationWhereInput) P

P returns a predicate for filtering notifications. An error is returned if the input is empty or invalid.

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 OrderDirection

type OrderDirection = entgql.OrderDirection

Common entgql types.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type PageInfo

type PageInfo = entgql.PageInfo[uuid.UUID]

Common entgql types.

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"`
	// 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) IsNode

func (n *Post) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*Post) Node

func (po *Post) Node(ctx context.Context) (node *Node, err error)

Node implements Noder interface

func (*Post) QueryUser

func (po *Post) QueryUser() *UserQuery

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

func (*Post) String

func (po *Post) String() string

String implements the fmt.Stringer.

func (*Post) ToEdge

func (po *Post) ToEdge(order *PostOrder) *PostEdge

ToEdge converts Post into PostEdge.

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

func (po *Post) User(ctx context.Context) (*User, error)

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

func (c *PostClient) Query() *PostQuery

Query returns a query builder for Post.

func (*PostClient) QueryUser

func (c *PostClient) QueryUser(po *Post) *UserQuery

QueryUser queries the user 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 PostConnection

type PostConnection struct {
	Edges      []*PostEdge `json:"edges"`
	PageInfo   PageInfo    `json:"pageInfo"`
	TotalCount int         `json:"totalCount"`
}

PostConnection is the connection containing edges to Post.

type PostCreate

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

PostCreate is the builder for creating a Post 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) 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) 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) SetNillableUpdatedAt

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

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

func (*PostCreate) SetNillableUserID

func (pc *PostCreate) SetNillableUserID(id *uuid.UUID) *PostCreate

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

func (*PostCreate) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*PostCreate) SetUser

func (pc *PostCreate) SetUser(u *User) *PostCreate

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

func (*PostCreate) SetUserID

func (pc *PostCreate) SetUserID(id uuid.UUID) *PostCreate

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

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 PostEdge

type PostEdge struct {
	Node   *Post  `json:"node"`
	Cursor Cursor `json:"cursor"`
}

PostEdge is the edge representation of Post.

type PostEdges

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

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

func (PostEdges) UserOrErr

func (e PostEdges) 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 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) 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) 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) 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) ClearUser

func (m *PostMutation) ClearUser()

ClearUser clears the "user" edge to the User 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) 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) 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) 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) 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) 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) ResetUpdatedAt

func (m *PostMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*PostMutation) ResetUser

func (m *PostMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

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

func (m *PostMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PostMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*PostMutation) SetUserID

func (m *PostMutation) SetUserID(id uuid.UUID)

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

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

func (m *PostMutation) UserCleared() bool

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

func (*PostMutation) UserID

func (m *PostMutation) UserID() (id uuid.UUID, exists bool)

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

func (*PostMutation) UserIDs

func (m *PostMutation) 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 (*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 PostOrder

type PostOrder struct {
	Direction OrderDirection  `json:"direction"`
	Field     *PostOrderField `json:"field"`
}

PostOrder defines the ordering of Post.

type PostOrderField

type PostOrderField struct {
	// Value extracts the ordering value from the given Post.
	Value func(*Post) (ent.Value, error)
	// contains filtered or unexported fields
}

PostOrderField defines the ordering field of Post.

type PostPaginateOption

type PostPaginateOption func(*postPager) error

PostPaginateOption enables pagination customization.

func WithPostFilter

func WithPostFilter(filter func(*PostQuery) (*PostQuery, error)) PostPaginateOption

WithPostFilter configures pagination filter.

func WithPostOrder

func WithPostOrder(order *PostOrder) PostPaginateOption

WithPostOrder configures pagination ordering.

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

func (po *PostQuery) CollectFields(ctx context.Context, satisfies ...string) (*PostQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

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(internal.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) Paginate

func (po *PostQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...PostPaginateOption,
) (*PostConnection, error)

Paginate executes the query and returns a relay based cursor connection to Post.

func (*PostQuery) QueryUser

func (pq *PostQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" 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) WithUser

func (pq *PostQuery) WithUser(opts ...func(*UserQuery)) *PostQuery

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

func (pu *PostUpdate) ClearUser() *PostUpdate

ClearUser clears the "user" edge to the User 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) 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) SetNillableUserID

func (pu *PostUpdate) SetNillableUserID(id *uuid.UUID) *PostUpdate

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

func (*PostUpdate) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*PostUpdate) SetUser

func (pu *PostUpdate) SetUser(u *User) *PostUpdate

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

func (*PostUpdate) SetUserID

func (pu *PostUpdate) SetUserID(id uuid.UUID) *PostUpdate

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

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

func (puo *PostUpdateOne) ClearUser() *PostUpdateOne

ClearUser clears the "user" edge to the User 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) 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) SetNillableUserID

func (puo *PostUpdateOne) SetNillableUserID(id *uuid.UUID) *PostUpdateOne

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

func (*PostUpdateOne) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*PostUpdateOne) SetUser

func (puo *PostUpdateOne) SetUser(u *User) *PostUpdateOne

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

func (*PostUpdateOne) SetUserID

func (puo *PostUpdateOne) SetUserID(id uuid.UUID) *PostUpdateOne

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

func (*PostUpdateOne) Where

func (puo *PostUpdateOne) Where(ps ...predicate.Post) *PostUpdateOne

Where appends a list predicates to the PostUpdate builder.

type PostWhereInput

type PostWhereInput struct {
	Predicates []predicate.Post  `json:"-"`
	Not        *PostWhereInput   `json:"not,omitempty"`
	Or         []*PostWhereInput `json:"or,omitempty"`
	And        []*PostWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *uuid.UUID  `json:"id,omitempty"`
	IDNEQ   *uuid.UUID  `json:"idNEQ,omitempty"`
	IDIn    []uuid.UUID `json:"idIn,omitempty"`
	IDNotIn []uuid.UUID `json:"idNotIn,omitempty"`
	IDGT    *uuid.UUID  `json:"idGT,omitempty"`
	IDGTE   *uuid.UUID  `json:"idGTE,omitempty"`
	IDLT    *uuid.UUID  `json:"idLT,omitempty"`
	IDLTE   *uuid.UUID  `json:"idLTE,omitempty"`

	// "created_at" field predicates.
	CreatedAt      *time.Time  `json:"createdAt,omitempty"`
	CreatedAtNEQ   *time.Time  `json:"createdAtNEQ,omitempty"`
	CreatedAtIn    []time.Time `json:"createdAtIn,omitempty"`
	CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"`
	CreatedAtGT    *time.Time  `json:"createdAtGT,omitempty"`
	CreatedAtGTE   *time.Time  `json:"createdAtGTE,omitempty"`
	CreatedAtLT    *time.Time  `json:"createdAtLT,omitempty"`
	CreatedAtLTE   *time.Time  `json:"createdAtLTE,omitempty"`

	// "updated_at" field predicates.
	UpdatedAt      *time.Time  `json:"updatedAt,omitempty"`
	UpdatedAtNEQ   *time.Time  `json:"updatedAtNEQ,omitempty"`
	UpdatedAtIn    []time.Time `json:"updatedAtIn,omitempty"`
	UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"`
	UpdatedAtGT    *time.Time  `json:"updatedAtGT,omitempty"`
	UpdatedAtGTE   *time.Time  `json:"updatedAtGTE,omitempty"`
	UpdatedAtLT    *time.Time  `json:"updatedAtLT,omitempty"`
	UpdatedAtLTE   *time.Time  `json:"updatedAtLTE,omitempty"`

	// "user" edge predicates.
	HasUser     *bool             `json:"hasUser,omitempty"`
	HasUserWith []*UserWhereInput `json:"hasUserWith,omitempty"`
}

PostWhereInput represents a where input for filtering Post queries.

func (*PostWhereInput) AddPredicates

func (i *PostWhereInput) AddPredicates(predicates ...predicate.Post)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*PostWhereInput) Filter

func (i *PostWhereInput) Filter(q *PostQuery) (*PostQuery, error)

Filter applies the PostWhereInput filter on the PostQuery builder.

func (*PostWhereInput) P

func (i *PostWhereInput) P() (predicate.Post, error)

P returns a predicate for filtering posts. An error is returned if the input is empty or invalid.

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 QueryResolver

type QueryResolver interface {
	Node(ctx context.Context, id uuid.UUID) (Noder, error)
	Nodes(ctx context.Context, ids []uuid.UUID) ([]Noder, error)
}

type ResolverRoot

type ResolverRoot interface {
	Query() QueryResolver
}

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 Setting

type Setting 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"`
	// contains filtered or unexported fields
}

Setting is the model entity for the Setting schema.

func (*Setting) IsNode

func (n *Setting) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*Setting) Node

func (s *Setting) Node(ctx context.Context) (node *Node, err error)

Node implements Noder interface

func (*Setting) String

func (s *Setting) String() string

String implements the fmt.Stringer.

func (*Setting) ToEdge

func (s *Setting) ToEdge(order *SettingOrder) *SettingEdge

ToEdge converts Setting into SettingEdge.

func (*Setting) Unwrap

func (s *Setting) Unwrap() *Setting

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

func (s *Setting) Update() *SettingUpdateOne

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

func (*Setting) Value

func (s *Setting) Value(name string) (ent.Value, error)

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

type SettingClient

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

SettingClient is a client for the Setting schema.

func NewSettingClient

func NewSettingClient(c config) *SettingClient

NewSettingClient returns a client for the Setting from the given config.

func (*SettingClient) Create

func (c *SettingClient) Create() *SettingCreate

Create returns a builder for creating a Setting entity.

func (*SettingClient) CreateBulk

func (c *SettingClient) CreateBulk(builders ...*SettingCreate) *SettingCreateBulk

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

func (*SettingClient) Delete

func (c *SettingClient) Delete() *SettingDelete

Delete returns a delete builder for Setting.

func (*SettingClient) DeleteOne

func (c *SettingClient) DeleteOne(s *Setting) *SettingDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SettingClient) DeleteOneID

func (c *SettingClient) DeleteOneID(id uuid.UUID) *SettingDeleteOne

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

func (*SettingClient) Get

func (c *SettingClient) Get(ctx context.Context, id uuid.UUID) (*Setting, error)

Get returns a Setting entity by its id.

func (*SettingClient) GetX

func (c *SettingClient) GetX(ctx context.Context, id uuid.UUID) *Setting

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

func (*SettingClient) Hooks

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

Hooks returns the client hooks.

func (*SettingClient) Intercept

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

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

func (*SettingClient) Interceptors

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

Interceptors returns the client interceptors.

func (*SettingClient) Query

func (c *SettingClient) Query() *SettingQuery

Query returns a query builder for Setting.

func (*SettingClient) Update

func (c *SettingClient) Update() *SettingUpdate

Update returns an update builder for Setting.

func (*SettingClient) UpdateOne

func (c *SettingClient) UpdateOne(s *Setting) *SettingUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SettingClient) UpdateOneID

func (c *SettingClient) UpdateOneID(id uuid.UUID) *SettingUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SettingClient) Use

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

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

type SettingConnection

type SettingConnection struct {
	Edges      []*SettingEdge `json:"edges"`
	PageInfo   PageInfo       `json:"pageInfo"`
	TotalCount int            `json:"totalCount"`
}

SettingConnection is the connection containing edges to Setting.

type SettingCreate

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

SettingCreate is the builder for creating a Setting entity.

func (*SettingCreate) Exec

func (sc *SettingCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SettingCreate) ExecX

func (sc *SettingCreate) ExecX(ctx context.Context)

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

func (*SettingCreate) Mutation

func (sc *SettingCreate) Mutation() *SettingMutation

Mutation returns the SettingMutation object of the builder.

func (*SettingCreate) Save

func (sc *SettingCreate) Save(ctx context.Context) (*Setting, error)

Save creates the Setting in the database.

func (*SettingCreate) SaveX

func (sc *SettingCreate) SaveX(ctx context.Context) *Setting

SaveX calls Save and panics if Save returns an error.

func (*SettingCreate) SetCreatedAt

func (sc *SettingCreate) SetCreatedAt(t time.Time) *SettingCreate

SetCreatedAt sets the "created_at" field.

func (*SettingCreate) SetID

func (sc *SettingCreate) SetID(u uuid.UUID) *SettingCreate

SetID sets the "id" field.

func (*SettingCreate) SetNillableCreatedAt

func (sc *SettingCreate) SetNillableCreatedAt(t *time.Time) *SettingCreate

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

func (*SettingCreate) SetNillableID

func (sc *SettingCreate) SetNillableID(u *uuid.UUID) *SettingCreate

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

func (*SettingCreate) SetNillableUpdatedAt

func (sc *SettingCreate) SetNillableUpdatedAt(t *time.Time) *SettingCreate

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

func (*SettingCreate) SetUpdatedAt

func (sc *SettingCreate) SetUpdatedAt(t time.Time) *SettingCreate

SetUpdatedAt sets the "updated_at" field.

type SettingCreateBulk

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

SettingCreateBulk is the builder for creating many Setting entities in bulk.

func (*SettingCreateBulk) Exec

func (scb *SettingCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SettingCreateBulk) ExecX

func (scb *SettingCreateBulk) ExecX(ctx context.Context)

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

func (*SettingCreateBulk) Save

func (scb *SettingCreateBulk) Save(ctx context.Context) ([]*Setting, error)

Save creates the Setting entities in the database.

func (*SettingCreateBulk) SaveX

func (scb *SettingCreateBulk) SaveX(ctx context.Context) []*Setting

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

type SettingDelete

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

SettingDelete is the builder for deleting a Setting entity.

func (*SettingDelete) Exec

func (sd *SettingDelete) Exec(ctx context.Context) (int, error)

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

func (*SettingDelete) ExecX

func (sd *SettingDelete) ExecX(ctx context.Context) int

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

func (*SettingDelete) Where

func (sd *SettingDelete) Where(ps ...predicate.Setting) *SettingDelete

Where appends a list predicates to the SettingDelete builder.

type SettingDeleteOne

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

SettingDeleteOne is the builder for deleting a single Setting entity.

func (*SettingDeleteOne) Exec

func (sdo *SettingDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SettingDeleteOne) ExecX

func (sdo *SettingDeleteOne) ExecX(ctx context.Context)

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

func (*SettingDeleteOne) Where

Where appends a list predicates to the SettingDelete builder.

type SettingEdge

type SettingEdge struct {
	Node   *Setting `json:"node"`
	Cursor Cursor   `json:"cursor"`
}

SettingEdge is the edge representation of Setting.

type SettingGroupBy

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

SettingGroupBy is the group-by builder for Setting entities.

func (*SettingGroupBy) Aggregate

func (sgb *SettingGroupBy) Aggregate(fns ...AggregateFunc) *SettingGroupBy

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

func (*SettingGroupBy) Bool

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

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

func (*SettingGroupBy) BoolX

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

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

func (*SettingGroupBy) Bools

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

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

func (*SettingGroupBy) BoolsX

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

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

func (*SettingGroupBy) Float64

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

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

func (*SettingGroupBy) Float64X

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

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

func (*SettingGroupBy) Float64s

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

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

func (*SettingGroupBy) Float64sX

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

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

func (*SettingGroupBy) Int

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

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

func (*SettingGroupBy) IntX

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

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

func (*SettingGroupBy) Ints

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

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

func (*SettingGroupBy) IntsX

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

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

func (*SettingGroupBy) Scan

func (sgb *SettingGroupBy) Scan(ctx context.Context, v any) error

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

func (*SettingGroupBy) ScanX

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

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

func (*SettingGroupBy) String

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

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

func (*SettingGroupBy) StringX

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

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

func (*SettingGroupBy) Strings

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

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

func (*SettingGroupBy) StringsX

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

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

type SettingMutation

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

SettingMutation represents an operation that mutates the Setting nodes in the graph.

func (*SettingMutation) AddField

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

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

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

func (*SettingMutation) AddedField

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

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

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

func (*SettingMutation) AddedIDs

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

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

func (*SettingMutation) ClearEdge

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

func (m *SettingMutation) 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 (*SettingMutation) ClearedEdges

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

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

func (*SettingMutation) ClearedFields

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

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

func (SettingMutation) Client

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

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

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

func (*SettingMutation) EdgeCleared

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

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

func (*SettingMutation) Field

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

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

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

func (*SettingMutation) Fields

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

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

func (m *SettingMutation) 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 (*SettingMutation) OldCreatedAt

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

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

func (m *SettingMutation) 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 (*SettingMutation) OldUpdatedAt

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

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

func (m *SettingMutation) Op() Op

Op returns the operation name.

func (*SettingMutation) RemovedEdges

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

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

func (*SettingMutation) RemovedIDs

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

func (m *SettingMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*SettingMutation) ResetEdge

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

func (m *SettingMutation) 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 (*SettingMutation) ResetUpdatedAt

func (m *SettingMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*SettingMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*SettingMutation) SetField

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

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

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

func (*SettingMutation) SetOp

func (m *SettingMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SettingMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (SettingMutation) Tx

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

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

func (*SettingMutation) Type

func (m *SettingMutation) Type() string

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

func (*SettingMutation) UpdatedAt

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

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

func (*SettingMutation) Where

func (m *SettingMutation) Where(ps ...predicate.Setting)

Where appends a list predicates to the SettingMutation builder.

func (*SettingMutation) WhereP

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

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

type SettingOrder

type SettingOrder struct {
	Direction OrderDirection     `json:"direction"`
	Field     *SettingOrderField `json:"field"`
}

SettingOrder defines the ordering of Setting.

type SettingOrderField

type SettingOrderField struct {
	// Value extracts the ordering value from the given Setting.
	Value func(*Setting) (ent.Value, error)
	// contains filtered or unexported fields
}

SettingOrderField defines the ordering field of Setting.

type SettingPaginateOption

type SettingPaginateOption func(*settingPager) error

SettingPaginateOption enables pagination customization.

func WithSettingFilter

func WithSettingFilter(filter func(*SettingQuery) (*SettingQuery, error)) SettingPaginateOption

WithSettingFilter configures pagination filter.

func WithSettingOrder

func WithSettingOrder(order *SettingOrder) SettingPaginateOption

WithSettingOrder configures pagination ordering.

type SettingQuery

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

SettingQuery is the builder for querying Setting entities.

func (*SettingQuery) Aggregate

func (sq *SettingQuery) Aggregate(fns ...AggregateFunc) *SettingSelect

Aggregate returns a SettingSelect configured with the given aggregations.

func (*SettingQuery) All

func (sq *SettingQuery) All(ctx context.Context) ([]*Setting, error)

All executes the query and returns a list of Settings.

func (*SettingQuery) AllX

func (sq *SettingQuery) AllX(ctx context.Context) []*Setting

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

func (*SettingQuery) Clone

func (sq *SettingQuery) Clone() *SettingQuery

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

func (*SettingQuery) CollectFields

func (s *SettingQuery) CollectFields(ctx context.Context, satisfies ...string) (*SettingQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*SettingQuery) Count

func (sq *SettingQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SettingQuery) CountX

func (sq *SettingQuery) CountX(ctx context.Context) int

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

func (*SettingQuery) Exist

func (sq *SettingQuery) Exist(ctx context.Context) (bool, error)

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

func (*SettingQuery) ExistX

func (sq *SettingQuery) ExistX(ctx context.Context) bool

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

func (*SettingQuery) First

func (sq *SettingQuery) First(ctx context.Context) (*Setting, error)

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

func (*SettingQuery) FirstID

func (sq *SettingQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*SettingQuery) FirstIDX

func (sq *SettingQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*SettingQuery) FirstX

func (sq *SettingQuery) FirstX(ctx context.Context) *Setting

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

func (*SettingQuery) GroupBy

func (sq *SettingQuery) GroupBy(field string, fields ...string) *SettingGroupBy

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.Setting.Query().
	GroupBy(setting.FieldCreatedAt).
	Aggregate(internal.Count()).
	Scan(ctx, &v)

func (*SettingQuery) IDs

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

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

func (*SettingQuery) IDsX

func (sq *SettingQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*SettingQuery) Limit

func (sq *SettingQuery) Limit(limit int) *SettingQuery

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

func (*SettingQuery) Offset

func (sq *SettingQuery) Offset(offset int) *SettingQuery

Offset to start from.

func (*SettingQuery) Only

func (sq *SettingQuery) Only(ctx context.Context) (*Setting, error)

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

func (*SettingQuery) OnlyID

func (sq *SettingQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*SettingQuery) OnlyIDX

func (sq *SettingQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*SettingQuery) OnlyX

func (sq *SettingQuery) OnlyX(ctx context.Context) *Setting

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

func (*SettingQuery) Order

func (sq *SettingQuery) Order(o ...setting.OrderOption) *SettingQuery

Order specifies how the records should be ordered.

func (*SettingQuery) Paginate

func (s *SettingQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...SettingPaginateOption,
) (*SettingConnection, error)

Paginate executes the query and returns a relay based cursor connection to Setting.

func (*SettingQuery) Select

func (sq *SettingQuery) Select(fields ...string) *SettingSelect

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.Setting.Query().
	Select(setting.FieldCreatedAt).
	Scan(ctx, &v)

func (*SettingQuery) Unique

func (sq *SettingQuery) Unique(unique bool) *SettingQuery

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

func (sq *SettingQuery) Where(ps ...predicate.Setting) *SettingQuery

Where adds a new predicate for the SettingQuery builder.

type SettingSelect

type SettingSelect struct {
	*SettingQuery
	// contains filtered or unexported fields
}

SettingSelect is the builder for selecting fields of Setting entities.

func (*SettingSelect) Aggregate

func (ss *SettingSelect) Aggregate(fns ...AggregateFunc) *SettingSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SettingSelect) Bool

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

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

func (*SettingSelect) BoolX

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

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

func (*SettingSelect) Bools

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

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

func (*SettingSelect) BoolsX

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

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

func (*SettingSelect) Float64

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

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

func (*SettingSelect) Float64X

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

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

func (*SettingSelect) Float64s

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

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

func (*SettingSelect) Float64sX

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

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

func (*SettingSelect) Int

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

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

func (*SettingSelect) IntX

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

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

func (*SettingSelect) Ints

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

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

func (*SettingSelect) IntsX

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

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

func (*SettingSelect) Scan

func (ss *SettingSelect) Scan(ctx context.Context, v any) error

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

func (*SettingSelect) ScanX

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

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

func (*SettingSelect) String

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

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

func (*SettingSelect) StringX

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

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

func (*SettingSelect) Strings

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

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

func (*SettingSelect) StringsX

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

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

type SettingUpdate

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

SettingUpdate is the builder for updating Setting entities.

func (*SettingUpdate) Exec

func (su *SettingUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SettingUpdate) ExecX

func (su *SettingUpdate) ExecX(ctx context.Context)

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

func (*SettingUpdate) Mutation

func (su *SettingUpdate) Mutation() *SettingMutation

Mutation returns the SettingMutation object of the builder.

func (*SettingUpdate) Save

func (su *SettingUpdate) Save(ctx context.Context) (int, error)

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

func (*SettingUpdate) SaveX

func (su *SettingUpdate) SaveX(ctx context.Context) int

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

func (*SettingUpdate) SetUpdatedAt

func (su *SettingUpdate) SetUpdatedAt(t time.Time) *SettingUpdate

SetUpdatedAt sets the "updated_at" field.

func (*SettingUpdate) Where

func (su *SettingUpdate) Where(ps ...predicate.Setting) *SettingUpdate

Where appends a list predicates to the SettingUpdate builder.

type SettingUpdateOne

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

SettingUpdateOne is the builder for updating a single Setting entity.

func (*SettingUpdateOne) Exec

func (suo *SettingUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SettingUpdateOne) ExecX

func (suo *SettingUpdateOne) ExecX(ctx context.Context)

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

func (*SettingUpdateOne) Mutation

func (suo *SettingUpdateOne) Mutation() *SettingMutation

Mutation returns the SettingMutation object of the builder.

func (*SettingUpdateOne) Save

func (suo *SettingUpdateOne) Save(ctx context.Context) (*Setting, error)

Save executes the query and returns the updated Setting entity.

func (*SettingUpdateOne) SaveX

func (suo *SettingUpdateOne) SaveX(ctx context.Context) *Setting

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

func (*SettingUpdateOne) Select

func (suo *SettingUpdateOne) Select(field string, fields ...string) *SettingUpdateOne

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

func (*SettingUpdateOne) SetUpdatedAt

func (suo *SettingUpdateOne) SetUpdatedAt(t time.Time) *SettingUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*SettingUpdateOne) Where

Where appends a list predicates to the SettingUpdate builder.

type SettingWhereInput

type SettingWhereInput struct {
	Predicates []predicate.Setting  `json:"-"`
	Not        *SettingWhereInput   `json:"not,omitempty"`
	Or         []*SettingWhereInput `json:"or,omitempty"`
	And        []*SettingWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *uuid.UUID  `json:"id,omitempty"`
	IDNEQ   *uuid.UUID  `json:"idNEQ,omitempty"`
	IDIn    []uuid.UUID `json:"idIn,omitempty"`
	IDNotIn []uuid.UUID `json:"idNotIn,omitempty"`
	IDGT    *uuid.UUID  `json:"idGT,omitempty"`
	IDGTE   *uuid.UUID  `json:"idGTE,omitempty"`
	IDLT    *uuid.UUID  `json:"idLT,omitempty"`
	IDLTE   *uuid.UUID  `json:"idLTE,omitempty"`

	// "created_at" field predicates.
	CreatedAt      *time.Time  `json:"createdAt,omitempty"`
	CreatedAtNEQ   *time.Time  `json:"createdAtNEQ,omitempty"`
	CreatedAtIn    []time.Time `json:"createdAtIn,omitempty"`
	CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"`
	CreatedAtGT    *time.Time  `json:"createdAtGT,omitempty"`
	CreatedAtGTE   *time.Time  `json:"createdAtGTE,omitempty"`
	CreatedAtLT    *time.Time  `json:"createdAtLT,omitempty"`
	CreatedAtLTE   *time.Time  `json:"createdAtLTE,omitempty"`

	// "updated_at" field predicates.
	UpdatedAt      *time.Time  `json:"updatedAt,omitempty"`
	UpdatedAtNEQ   *time.Time  `json:"updatedAtNEQ,omitempty"`
	UpdatedAtIn    []time.Time `json:"updatedAtIn,omitempty"`
	UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"`
	UpdatedAtGT    *time.Time  `json:"updatedAtGT,omitempty"`
	UpdatedAtGTE   *time.Time  `json:"updatedAtGTE,omitempty"`
	UpdatedAtLT    *time.Time  `json:"updatedAtLT,omitempty"`
	UpdatedAtLTE   *time.Time  `json:"updatedAtLTE,omitempty"`
}

SettingWhereInput represents a where input for filtering Setting queries.

func (*SettingWhereInput) AddPredicates

func (i *SettingWhereInput) AddPredicates(predicates ...predicate.Setting)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*SettingWhereInput) Filter

Filter applies the SettingWhereInput filter on the SettingQuery builder.

func (*SettingWhereInput) P

P returns a predicate for filtering settings. An error is returned if the input is empty or invalid.

type Settings

type Settings []*Setting

Settings is a parsable slice of Setting.

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 {

	// Group is the client for interacting with the Group builders.
	Group *GroupClient
	// Message is the client for interacting with the Message builders.
	Message *MessageClient
	// Notification is the client for interacting with the Notification builders.
	Notification *NotificationClient
	// Post is the client for interacting with the Post builders.
	Post *PostClient
	// Setting is the client for interacting with the Setting builders.
	Setting *SettingClient
	// 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"`
	// EmailAddress holds the value of the "email_address" field.
	EmailAddress string `json:"email_address,omitempty"`
	// AccountAddress holds the value of the "account_address" field.
	AccountAddress string `json:"account_address,omitempty"`
	// Alias holds the value of the "alias" field.
	Alias string `json:"alias,omitempty"`
	// Bio holds the value of the "bio" field.
	Bio string `json:"bio,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) Followers

func (u *User) Followers(
	ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, where *UserWhereInput,
) (*UserConnection, error)

func (*User) Following

func (u *User) Following(
	ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, where *UserWhereInput,
) (*UserConnection, error)

func (*User) Groups

func (u *User) Groups(
	ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, where *GroupWhereInput,
) (*GroupConnection, error)

func (*User) IsNode

func (n *User) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*User) NamedFollowers

func (u *User) NamedFollowers(name string) ([]*User, error)

NamedFollowers returns the Followers named value or an error if the edge was not loaded in eager-loading with this name.

func (*User) NamedFollowing

func (u *User) NamedFollowing(name string) ([]*User, error)

NamedFollowing returns the Following named value or an error if the edge was not loaded in eager-loading with this name.

func (*User) NamedGroups

func (u *User) NamedGroups(name string) ([]*Group, error)

NamedGroups returns the Groups named value or an error if the edge was not loaded in eager-loading with this name.

func (*User) NamedPosts

func (u *User) NamedPosts(name string) ([]*Post, error)

NamedPosts returns the Posts named value or an error if the edge was not loaded in eager-loading with this name.

func (*User) Node

func (u *User) Node(ctx context.Context) (node *Node, err error)

Node implements Noder interface

func (*User) Posts

func (u *User) Posts(
	ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, where *PostWhereInput,
) (*PostConnection, error)

func (*User) QueryFollowers

func (u *User) QueryFollowers() *UserQuery

QueryFollowers queries the "followers" edge of the User entity.

func (*User) QueryFollowing

func (u *User) QueryFollowing() *UserQuery

QueryFollowing queries the "following" edge of the User entity.

func (*User) QueryGroups

func (u *User) QueryGroups() *GroupQuery

QueryGroups queries the "groups" edge of the User entity.

func (*User) QueryPosts

func (u *User) QueryPosts() *PostQuery

QueryPosts queries the "posts" edge of the User entity.

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) ToEdge

func (u *User) ToEdge(order *UserOrder) *UserEdge

ToEdge converts User into UserEdge.

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

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryFollowers

func (c *UserClient) QueryFollowers(u *User) *UserQuery

QueryFollowers queries the followers edge of a User.

func (*UserClient) QueryFollowing

func (c *UserClient) QueryFollowing(u *User) *UserQuery

QueryFollowing queries the following edge of a User.

func (*UserClient) QueryGroups

func (c *UserClient) QueryGroups(u *User) *GroupQuery

QueryGroups queries the groups edge of a User.

func (*UserClient) QueryPosts

func (c *UserClient) QueryPosts(u *User) *PostQuery

QueryPosts queries the posts 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 UserConnection

type UserConnection struct {
	Edges      []*UserEdge `json:"edges"`
	PageInfo   PageInfo    `json:"pageInfo"`
	TotalCount int         `json:"totalCount"`
}

UserConnection is the connection containing edges to User.

type UserCreate

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

UserCreate is the builder for creating a User entity.

func (*UserCreate) AddFollowerIDs

func (uc *UserCreate) AddFollowerIDs(ids ...uuid.UUID) *UserCreate

AddFollowerIDs adds the "followers" edge to the User entity by IDs.

func (*UserCreate) AddFollowers

func (uc *UserCreate) AddFollowers(u ...*User) *UserCreate

AddFollowers adds the "followers" edges to the User entity.

func (*UserCreate) AddFollowing

func (uc *UserCreate) AddFollowing(u ...*User) *UserCreate

AddFollowing adds the "following" edges to the User entity.

func (*UserCreate) AddFollowingIDs

func (uc *UserCreate) AddFollowingIDs(ids ...uuid.UUID) *UserCreate

AddFollowingIDs adds the "following" edge to the User entity by IDs.

func (*UserCreate) AddGroupIDs

func (uc *UserCreate) AddGroupIDs(ids ...uuid.UUID) *UserCreate

AddGroupIDs adds the "groups" edge to the Group entity by IDs.

func (*UserCreate) AddGroups

func (uc *UserCreate) AddGroups(g ...*Group) *UserCreate

AddGroups adds the "groups" edges to the Group entity.

func (*UserCreate) 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) 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) SetAccountAddress

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

SetAccountAddress sets the "account_address" field.

func (*UserCreate) SetAlias

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

SetAlias sets the "alias" field.

func (*UserCreate) SetBio

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

SetBio sets the "bio" field.

func (*UserCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*UserCreate) SetEmailAddress

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

SetEmailAddress sets the "email_address" 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) SetLastName

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

SetLastName sets the "last_name" field.

func (*UserCreate) SetNillableBio

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

SetNillableBio sets the "bio" 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) SetNillableID

func (uc *UserCreate) SetNillableID(u *uuid.UUID) *UserCreate

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

func (*UserCreate) SetNillableUpdatedAt

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

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

func (*UserCreate) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

type UserCreateBulk

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

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec

func (ucb *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecX

func (ucb *UserCreateBulk) ExecX(ctx context.Context)

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

func (*UserCreateBulk) 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 UserEdge

type UserEdge struct {
	Node   *User  `json:"node"`
	Cursor Cursor `json:"cursor"`
}

UserEdge is the edge representation of User.

type UserEdges

type UserEdges struct {
	// Followers holds the value of the followers edge.
	Followers []*User `json:"followers,omitempty"`
	// Following holds the value of the following edge.
	Following []*User `json:"following,omitempty"`
	// Posts holds the value of the posts edge.
	Posts []*Post `json:"posts,omitempty"`
	// Groups holds the value of the groups edge.
	Groups []*Group `json:"groups,omitempty"`
	// contains filtered or unexported fields
}

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

func (UserEdges) FollowersOrErr

func (e UserEdges) FollowersOrErr() ([]*User, error)

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

func (UserEdges) FollowingOrErr

func (e UserEdges) FollowingOrErr() ([]*User, error)

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

func (UserEdges) GroupsOrErr

func (e UserEdges) GroupsOrErr() ([]*Group, error)

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

func (UserEdges) PostsOrErr

func (e UserEdges) PostsOrErr() ([]*Post, error)

PostsOrErr returns the Posts 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) AccountAddress

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

AccountAddress returns the value of the "account_address" field in the mutation.

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

func (m *UserMutation) AddFollowerIDs(ids ...uuid.UUID)

AddFollowerIDs adds the "followers" edge to the User entity by ids.

func (*UserMutation) AddFollowingIDs

func (m *UserMutation) AddFollowingIDs(ids ...uuid.UUID)

AddFollowingIDs adds the "following" edge to the User entity by ids.

func (*UserMutation) AddGroupIDs

func (m *UserMutation) AddGroupIDs(ids ...uuid.UUID)

AddGroupIDs adds the "groups" edge to the Group 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) 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) Alias

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

Alias returns the value of the "alias" field in the mutation.

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

func (m *UserMutation) ClearBio()

ClearBio clears the value of the "bio" 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) ClearFollowers

func (m *UserMutation) ClearFollowers()

ClearFollowers clears the "followers" edge to the User entity.

func (*UserMutation) ClearFollowing

func (m *UserMutation) ClearFollowing()

ClearFollowing clears the "following" edge to the User entity.

func (*UserMutation) ClearGroups

func (m *UserMutation) ClearGroups()

ClearGroups clears the "groups" edge to the Group entity.

func (*UserMutation) ClearPosts

func (m *UserMutation) ClearPosts()

ClearPosts clears the "posts" edge to the Post entity.

func (*UserMutation) ClearedEdges

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

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

func (*UserMutation) ClearedFields

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

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

func (UserMutation) Client

func (m UserMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*UserMutation) CreatedAt

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

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

func (*UserMutation) EdgeCleared

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

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

func (*UserMutation) EmailAddress

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

EmailAddress returns the value of the "email_address" 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) FollowersCleared

func (m *UserMutation) FollowersCleared() bool

FollowersCleared reports if the "followers" edge to the User entity was cleared.

func (*UserMutation) FollowersIDs

func (m *UserMutation) FollowersIDs() (ids []uuid.UUID)

FollowersIDs returns the "followers" edge IDs in the mutation.

func (*UserMutation) FollowingCleared

func (m *UserMutation) FollowingCleared() bool

FollowingCleared reports if the "following" edge to the User entity was cleared.

func (*UserMutation) FollowingIDs

func (m *UserMutation) FollowingIDs() (ids []uuid.UUID)

FollowingIDs returns the "following" edge IDs in the mutation.

func (*UserMutation) GroupsCleared

func (m *UserMutation) GroupsCleared() bool

GroupsCleared reports if the "groups" edge to the Group entity was cleared.

func (*UserMutation) GroupsIDs

func (m *UserMutation) GroupsIDs() (ids []uuid.UUID)

GroupsIDs returns the "groups" edge IDs 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) LastName

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

LastName returns the value of the "last_name" field in the mutation.

func (*UserMutation) OldAccountAddress

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

OldAccountAddress returns the old "account_address" 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) OldAlias

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

OldAlias returns the old "alias" 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) 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) OldEmailAddress

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

OldEmailAddress returns the old "email_address" 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) 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) OldUpdatedAt

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

OldUpdatedAt returns the old "updated_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) 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) RemoveFollowerIDs

func (m *UserMutation) RemoveFollowerIDs(ids ...uuid.UUID)

RemoveFollowerIDs removes the "followers" edge to the User entity by IDs.

func (*UserMutation) RemoveFollowingIDs

func (m *UserMutation) RemoveFollowingIDs(ids ...uuid.UUID)

RemoveFollowingIDs removes the "following" edge to the User entity by IDs.

func (*UserMutation) RemoveGroupIDs

func (m *UserMutation) RemoveGroupIDs(ids ...uuid.UUID)

RemoveGroupIDs removes the "groups" edge to the Group 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) RemovedEdges

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

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

func (*UserMutation) RemovedFollowersIDs

func (m *UserMutation) RemovedFollowersIDs() (ids []uuid.UUID)

RemovedFollowers returns the removed IDs of the "followers" edge to the User entity.

func (*UserMutation) RemovedFollowingIDs

func (m *UserMutation) RemovedFollowingIDs() (ids []uuid.UUID)

RemovedFollowing returns the removed IDs of the "following" edge to the User entity.

func (*UserMutation) RemovedGroupsIDs

func (m *UserMutation) RemovedGroupsIDs() (ids []uuid.UUID)

RemovedGroups returns the removed IDs of the "groups" edge to the Group entity.

func (*UserMutation) RemovedIDs

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

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

func (*UserMutation) RemovedPostsIDs

func (m *UserMutation) RemovedPostsIDs() (ids []uuid.UUID)

RemovedPosts returns the removed IDs of the "posts" edge to the Post entity.

func (*UserMutation) ResetAccountAddress

func (m *UserMutation) ResetAccountAddress()

ResetAccountAddress resets all changes to the "account_address" field.

func (*UserMutation) ResetAlias

func (m *UserMutation) ResetAlias()

ResetAlias resets all changes to the "alias" field.

func (*UserMutation) ResetBio

func (m *UserMutation) ResetBio()

ResetBio resets all changes to the "bio" field.

func (*UserMutation) ResetCreatedAt

func (m *UserMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserMutation) ResetEdge

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

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

func (*UserMutation) ResetEmailAddress

func (m *UserMutation) ResetEmailAddress()

ResetEmailAddress resets all changes to the "email_address" 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) ResetFollowers

func (m *UserMutation) ResetFollowers()

ResetFollowers resets all changes to the "followers" edge.

func (*UserMutation) ResetFollowing

func (m *UserMutation) ResetFollowing()

ResetFollowing resets all changes to the "following" edge.

func (*UserMutation) ResetGroups

func (m *UserMutation) ResetGroups()

ResetGroups resets all changes to the "groups" edge.

func (*UserMutation) ResetLastName

func (m *UserMutation) ResetLastName()

ResetLastName resets all changes to the "last_name" field.

func (*UserMutation) ResetPosts

func (m *UserMutation) ResetPosts()

ResetPosts resets all changes to the "posts" edge.

func (*UserMutation) ResetUpdatedAt

func (m *UserMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*UserMutation) SetAccountAddress

func (m *UserMutation) SetAccountAddress(s string)

SetAccountAddress sets the "account_address" field.

func (*UserMutation) SetAlias

func (m *UserMutation) SetAlias(s string)

SetAlias sets the "alias" field.

func (*UserMutation) SetBio

func (m *UserMutation) SetBio(s string)

SetBio sets the "bio" field.

func (*UserMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*UserMutation) SetEmailAddress

func (m *UserMutation) SetEmailAddress(s string)

SetEmailAddress sets the "email_address" 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) 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) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (UserMutation) Tx

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

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

func (*UserMutation) Type

func (m *UserMutation) Type() string

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

func (*UserMutation) UpdatedAt

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

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

func (*UserMutation) Where

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

Where appends a list predicates to the UserMutation builder.

func (*UserMutation) WhereP

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

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

type UserOrder

type UserOrder struct {
	Direction OrderDirection  `json:"direction"`
	Field     *UserOrderField `json:"field"`
}

UserOrder defines the ordering of User.

type UserOrderField

type UserOrderField struct {
	// Value extracts the ordering value from the given User.
	Value func(*User) (ent.Value, error)
	// contains filtered or unexported fields
}

UserOrderField defines the ordering field of User.

type UserPaginateOption

type UserPaginateOption func(*userPager) error

UserPaginateOption enables pagination customization.

func WithUserFilter

func WithUserFilter(filter func(*UserQuery) (*UserQuery, error)) UserPaginateOption

WithUserFilter configures pagination filter.

func WithUserOrder

func WithUserOrder(order *UserOrder) UserPaginateOption

WithUserOrder configures pagination ordering.

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

func (u *UserQuery) CollectFields(ctx context.Context, satisfies ...string) (*UserQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

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(internal.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) Paginate

func (u *UserQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...UserPaginateOption,
) (*UserConnection, error)

Paginate executes the query and returns a relay based cursor connection to User.

func (*UserQuery) QueryFollowers

func (uq *UserQuery) QueryFollowers() *UserQuery

QueryFollowers chains the current query on the "followers" edge.

func (*UserQuery) QueryFollowing

func (uq *UserQuery) QueryFollowing() *UserQuery

QueryFollowing chains the current query on the "following" edge.

func (*UserQuery) QueryGroups

func (uq *UserQuery) QueryGroups() *GroupQuery

QueryGroups chains the current query on the "groups" edge.

func (*UserQuery) QueryPosts

func (uq *UserQuery) QueryPosts() *PostQuery

QueryPosts chains the current query on the "posts" 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) WithFollowers

func (uq *UserQuery) WithFollowers(opts ...func(*UserQuery)) *UserQuery

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

func (*UserQuery) WithFollowing

func (uq *UserQuery) WithFollowing(opts ...func(*UserQuery)) *UserQuery

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

func (*UserQuery) WithGroups

func (uq *UserQuery) WithGroups(opts ...func(*GroupQuery)) *UserQuery

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

func (*UserQuery) WithNamedFollowers

func (uq *UserQuery) WithNamedFollowers(name string, opts ...func(*UserQuery)) *UserQuery

WithNamedFollowers tells the query-builder to eager-load the nodes that are connected to the "followers" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithNamedFollowing

func (uq *UserQuery) WithNamedFollowing(name string, opts ...func(*UserQuery)) *UserQuery

WithNamedFollowing tells the query-builder to eager-load the nodes that are connected to the "following" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithNamedGroups

func (uq *UserQuery) WithNamedGroups(name string, opts ...func(*GroupQuery)) *UserQuery

WithNamedGroups tells the query-builder to eager-load the nodes that are connected to the "groups" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithNamedPosts

func (uq *UserQuery) WithNamedPosts(name string, opts ...func(*PostQuery)) *UserQuery

WithNamedPosts tells the query-builder to eager-load the nodes that are connected to the "posts" edge with the given name. 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.

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

func (uu *UserUpdate) AddFollowerIDs(ids ...uuid.UUID) *UserUpdate

AddFollowerIDs adds the "followers" edge to the User entity by IDs.

func (*UserUpdate) AddFollowers

func (uu *UserUpdate) AddFollowers(u ...*User) *UserUpdate

AddFollowers adds the "followers" edges to the User entity.

func (*UserUpdate) AddFollowing

func (uu *UserUpdate) AddFollowing(u ...*User) *UserUpdate

AddFollowing adds the "following" edges to the User entity.

func (*UserUpdate) AddFollowingIDs

func (uu *UserUpdate) AddFollowingIDs(ids ...uuid.UUID) *UserUpdate

AddFollowingIDs adds the "following" edge to the User entity by IDs.

func (*UserUpdate) AddGroupIDs

func (uu *UserUpdate) AddGroupIDs(ids ...uuid.UUID) *UserUpdate

AddGroupIDs adds the "groups" edge to the Group entity by IDs.

func (*UserUpdate) AddGroups

func (uu *UserUpdate) AddGroups(g ...*Group) *UserUpdate

AddGroups adds the "groups" edges to the Group entity.

func (*UserUpdate) 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) ClearBio

func (uu *UserUpdate) ClearBio() *UserUpdate

ClearBio clears the value of the "bio" field.

func (*UserUpdate) ClearFollowers

func (uu *UserUpdate) ClearFollowers() *UserUpdate

ClearFollowers clears all "followers" edges to the User entity.

func (*UserUpdate) ClearFollowing

func (uu *UserUpdate) ClearFollowing() *UserUpdate

ClearFollowing clears all "following" edges to the User entity.

func (*UserUpdate) ClearGroups

func (uu *UserUpdate) ClearGroups() *UserUpdate

ClearGroups clears all "groups" edges to the Group entity.

func (*UserUpdate) ClearPosts

func (uu *UserUpdate) ClearPosts() *UserUpdate

ClearPosts clears all "posts" edges to the Post 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) RemoveFollowerIDs

func (uu *UserUpdate) RemoveFollowerIDs(ids ...uuid.UUID) *UserUpdate

RemoveFollowerIDs removes the "followers" edge to User entities by IDs.

func (*UserUpdate) RemoveFollowers

func (uu *UserUpdate) RemoveFollowers(u ...*User) *UserUpdate

RemoveFollowers removes "followers" edges to User entities.

func (*UserUpdate) RemoveFollowing

func (uu *UserUpdate) RemoveFollowing(u ...*User) *UserUpdate

RemoveFollowing removes "following" edges to User entities.

func (*UserUpdate) RemoveFollowingIDs

func (uu *UserUpdate) RemoveFollowingIDs(ids ...uuid.UUID) *UserUpdate

RemoveFollowingIDs removes the "following" edge to User entities by IDs.

func (*UserUpdate) RemoveGroupIDs

func (uu *UserUpdate) RemoveGroupIDs(ids ...uuid.UUID) *UserUpdate

RemoveGroupIDs removes the "groups" edge to Group entities by IDs.

func (*UserUpdate) RemoveGroups

func (uu *UserUpdate) RemoveGroups(g ...*Group) *UserUpdate

RemoveGroups removes "groups" edges to Group entities.

func (*UserUpdate) 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) 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) SetAccountAddress

func (uu *UserUpdate) SetAccountAddress(s string) *UserUpdate

SetAccountAddress sets the "account_address" field.

func (*UserUpdate) SetAlias

func (uu *UserUpdate) SetAlias(s string) *UserUpdate

SetAlias sets the "alias" field.

func (*UserUpdate) SetBio

func (uu *UserUpdate) SetBio(s string) *UserUpdate

SetBio sets the "bio" field.

func (*UserUpdate) SetEmailAddress

func (uu *UserUpdate) SetEmailAddress(s string) *UserUpdate

SetEmailAddress sets the "email_address" field.

func (*UserUpdate) SetFirstName

func (uu *UserUpdate) SetFirstName(s string) *UserUpdate

SetFirstName sets the "first_name" field.

func (*UserUpdate) SetLastName

func (uu *UserUpdate) SetLastName(s string) *UserUpdate

SetLastName sets the "last_name" field.

func (*UserUpdate) SetNillableBio

func (uu *UserUpdate) SetNillableBio(s *string) *UserUpdate

SetNillableBio sets the "bio" field if the given value is not nil.

func (*UserUpdate) SetUpdatedAt

func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdate) Where

func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to the UserUpdate builder.

type UserUpdateOne

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

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) AddFollowerIDs

func (uuo *UserUpdateOne) AddFollowerIDs(ids ...uuid.UUID) *UserUpdateOne

AddFollowerIDs adds the "followers" edge to the User entity by IDs.

func (*UserUpdateOne) AddFollowers

func (uuo *UserUpdateOne) AddFollowers(u ...*User) *UserUpdateOne

AddFollowers adds the "followers" edges to the User entity.

func (*UserUpdateOne) AddFollowing

func (uuo *UserUpdateOne) AddFollowing(u ...*User) *UserUpdateOne

AddFollowing adds the "following" edges to the User entity.

func (*UserUpdateOne) AddFollowingIDs

func (uuo *UserUpdateOne) AddFollowingIDs(ids ...uuid.UUID) *UserUpdateOne

AddFollowingIDs adds the "following" edge to the User entity by IDs.

func (*UserUpdateOne) AddGroupIDs

func (uuo *UserUpdateOne) AddGroupIDs(ids ...uuid.UUID) *UserUpdateOne

AddGroupIDs adds the "groups" edge to the Group entity by IDs.

func (*UserUpdateOne) AddGroups

func (uuo *UserUpdateOne) AddGroups(g ...*Group) *UserUpdateOne

AddGroups adds the "groups" edges to the Group entity.

func (*UserUpdateOne) 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) ClearBio

func (uuo *UserUpdateOne) ClearBio() *UserUpdateOne

ClearBio clears the value of the "bio" field.

func (*UserUpdateOne) ClearFollowers

func (uuo *UserUpdateOne) ClearFollowers() *UserUpdateOne

ClearFollowers clears all "followers" edges to the User entity.

func (*UserUpdateOne) ClearFollowing

func (uuo *UserUpdateOne) ClearFollowing() *UserUpdateOne

ClearFollowing clears all "following" edges to the User entity.

func (*UserUpdateOne) ClearGroups

func (uuo *UserUpdateOne) ClearGroups() *UserUpdateOne

ClearGroups clears all "groups" edges to the Group entity.

func (*UserUpdateOne) ClearPosts

func (uuo *UserUpdateOne) ClearPosts() *UserUpdateOne

ClearPosts clears all "posts" edges to the Post 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) RemoveFollowerIDs

func (uuo *UserUpdateOne) RemoveFollowerIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveFollowerIDs removes the "followers" edge to User entities by IDs.

func (*UserUpdateOne) RemoveFollowers

func (uuo *UserUpdateOne) RemoveFollowers(u ...*User) *UserUpdateOne

RemoveFollowers removes "followers" edges to User entities.

func (*UserUpdateOne) RemoveFollowing

func (uuo *UserUpdateOne) RemoveFollowing(u ...*User) *UserUpdateOne

RemoveFollowing removes "following" edges to User entities.

func (*UserUpdateOne) RemoveFollowingIDs

func (uuo *UserUpdateOne) RemoveFollowingIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveFollowingIDs removes the "following" edge to User entities by IDs.

func (*UserUpdateOne) RemoveGroupIDs

func (uuo *UserUpdateOne) RemoveGroupIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveGroupIDs removes the "groups" edge to Group entities by IDs.

func (*UserUpdateOne) RemoveGroups

func (uuo *UserUpdateOne) RemoveGroups(g ...*Group) *UserUpdateOne

RemoveGroups removes "groups" edges to Group entities.

func (*UserUpdateOne) 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) 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) SetAccountAddress

func (uuo *UserUpdateOne) SetAccountAddress(s string) *UserUpdateOne

SetAccountAddress sets the "account_address" field.

func (*UserUpdateOne) SetAlias

func (uuo *UserUpdateOne) SetAlias(s string) *UserUpdateOne

SetAlias sets the "alias" field.

func (*UserUpdateOne) SetBio

func (uuo *UserUpdateOne) SetBio(s string) *UserUpdateOne

SetBio sets the "bio" field.

func (*UserUpdateOne) SetEmailAddress

func (uuo *UserUpdateOne) SetEmailAddress(s string) *UserUpdateOne

SetEmailAddress sets the "email_address" field.

func (*UserUpdateOne) SetFirstName

func (uuo *UserUpdateOne) SetFirstName(s string) *UserUpdateOne

SetFirstName sets the "first_name" field.

func (*UserUpdateOne) SetLastName

func (uuo *UserUpdateOne) SetLastName(s string) *UserUpdateOne

SetLastName sets the "last_name" field.

func (*UserUpdateOne) SetNillableBio

func (uuo *UserUpdateOne) SetNillableBio(s *string) *UserUpdateOne

SetNillableBio sets the "bio" field if the given value is not nil.

func (*UserUpdateOne) SetUpdatedAt

func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdateOne) Where

func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne

Where appends a list predicates to the UserUpdate builder.

type UserWhereInput

type UserWhereInput struct {
	Predicates []predicate.User  `json:"-"`
	Not        *UserWhereInput   `json:"not,omitempty"`
	Or         []*UserWhereInput `json:"or,omitempty"`
	And        []*UserWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *uuid.UUID  `json:"id,omitempty"`
	IDNEQ   *uuid.UUID  `json:"idNEQ,omitempty"`
	IDIn    []uuid.UUID `json:"idIn,omitempty"`
	IDNotIn []uuid.UUID `json:"idNotIn,omitempty"`
	IDGT    *uuid.UUID  `json:"idGT,omitempty"`
	IDGTE   *uuid.UUID  `json:"idGTE,omitempty"`
	IDLT    *uuid.UUID  `json:"idLT,omitempty"`
	IDLTE   *uuid.UUID  `json:"idLTE,omitempty"`

	// "created_at" field predicates.
	CreatedAt      *time.Time  `json:"createdAt,omitempty"`
	CreatedAtNEQ   *time.Time  `json:"createdAtNEQ,omitempty"`
	CreatedAtIn    []time.Time `json:"createdAtIn,omitempty"`
	CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"`
	CreatedAtGT    *time.Time  `json:"createdAtGT,omitempty"`
	CreatedAtGTE   *time.Time  `json:"createdAtGTE,omitempty"`
	CreatedAtLT    *time.Time  `json:"createdAtLT,omitempty"`
	CreatedAtLTE   *time.Time  `json:"createdAtLTE,omitempty"`

	// "updated_at" field predicates.
	UpdatedAt      *time.Time  `json:"updatedAt,omitempty"`
	UpdatedAtNEQ   *time.Time  `json:"updatedAtNEQ,omitempty"`
	UpdatedAtIn    []time.Time `json:"updatedAtIn,omitempty"`
	UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"`
	UpdatedAtGT    *time.Time  `json:"updatedAtGT,omitempty"`
	UpdatedAtGTE   *time.Time  `json:"updatedAtGTE,omitempty"`
	UpdatedAtLT    *time.Time  `json:"updatedAtLT,omitempty"`
	UpdatedAtLTE   *time.Time  `json:"updatedAtLTE,omitempty"`

	// "first_name" field predicates.
	FirstName             *string  `json:"firstName,omitempty"`
	FirstNameNEQ          *string  `json:"firstNameNEQ,omitempty"`
	FirstNameIn           []string `json:"firstNameIn,omitempty"`
	FirstNameNotIn        []string `json:"firstNameNotIn,omitempty"`
	FirstNameGT           *string  `json:"firstNameGT,omitempty"`
	FirstNameGTE          *string  `json:"firstNameGTE,omitempty"`
	FirstNameLT           *string  `json:"firstNameLT,omitempty"`
	FirstNameLTE          *string  `json:"firstNameLTE,omitempty"`
	FirstNameContains     *string  `json:"firstNameContains,omitempty"`
	FirstNameHasPrefix    *string  `json:"firstNameHasPrefix,omitempty"`
	FirstNameHasSuffix    *string  `json:"firstNameHasSuffix,omitempty"`
	FirstNameEqualFold    *string  `json:"firstNameEqualFold,omitempty"`
	FirstNameContainsFold *string  `json:"firstNameContainsFold,omitempty"`

	// "last_name" field predicates.
	LastName             *string  `json:"lastName,omitempty"`
	LastNameNEQ          *string  `json:"lastNameNEQ,omitempty"`
	LastNameIn           []string `json:"lastNameIn,omitempty"`
	LastNameNotIn        []string `json:"lastNameNotIn,omitempty"`
	LastNameGT           *string  `json:"lastNameGT,omitempty"`
	LastNameGTE          *string  `json:"lastNameGTE,omitempty"`
	LastNameLT           *string  `json:"lastNameLT,omitempty"`
	LastNameLTE          *string  `json:"lastNameLTE,omitempty"`
	LastNameContains     *string  `json:"lastNameContains,omitempty"`
	LastNameHasPrefix    *string  `json:"lastNameHasPrefix,omitempty"`
	LastNameHasSuffix    *string  `json:"lastNameHasSuffix,omitempty"`
	LastNameEqualFold    *string  `json:"lastNameEqualFold,omitempty"`
	LastNameContainsFold *string  `json:"lastNameContainsFold,omitempty"`

	// "email_address" field predicates.
	EmailAddress             *string  `json:"emailAddress,omitempty"`
	EmailAddressNEQ          *string  `json:"emailAddressNEQ,omitempty"`
	EmailAddressIn           []string `json:"emailAddressIn,omitempty"`
	EmailAddressNotIn        []string `json:"emailAddressNotIn,omitempty"`
	EmailAddressGT           *string  `json:"emailAddressGT,omitempty"`
	EmailAddressGTE          *string  `json:"emailAddressGTE,omitempty"`
	EmailAddressLT           *string  `json:"emailAddressLT,omitempty"`
	EmailAddressLTE          *string  `json:"emailAddressLTE,omitempty"`
	EmailAddressContains     *string  `json:"emailAddressContains,omitempty"`
	EmailAddressHasPrefix    *string  `json:"emailAddressHasPrefix,omitempty"`
	EmailAddressHasSuffix    *string  `json:"emailAddressHasSuffix,omitempty"`
	EmailAddressEqualFold    *string  `json:"emailAddressEqualFold,omitempty"`
	EmailAddressContainsFold *string  `json:"emailAddressContainsFold,omitempty"`

	// "account_address" field predicates.
	AccountAddress             *string  `json:"accountAddress,omitempty"`
	AccountAddressNEQ          *string  `json:"accountAddressNEQ,omitempty"`
	AccountAddressIn           []string `json:"accountAddressIn,omitempty"`
	AccountAddressNotIn        []string `json:"accountAddressNotIn,omitempty"`
	AccountAddressGT           *string  `json:"accountAddressGT,omitempty"`
	AccountAddressGTE          *string  `json:"accountAddressGTE,omitempty"`
	AccountAddressLT           *string  `json:"accountAddressLT,omitempty"`
	AccountAddressLTE          *string  `json:"accountAddressLTE,omitempty"`
	AccountAddressContains     *string  `json:"accountAddressContains,omitempty"`
	AccountAddressHasPrefix    *string  `json:"accountAddressHasPrefix,omitempty"`
	AccountAddressHasSuffix    *string  `json:"accountAddressHasSuffix,omitempty"`
	AccountAddressEqualFold    *string  `json:"accountAddressEqualFold,omitempty"`
	AccountAddressContainsFold *string  `json:"accountAddressContainsFold,omitempty"`

	// "alias" field predicates.
	Alias             *string  `json:"alias,omitempty"`
	AliasNEQ          *string  `json:"aliasNEQ,omitempty"`
	AliasIn           []string `json:"aliasIn,omitempty"`
	AliasNotIn        []string `json:"aliasNotIn,omitempty"`
	AliasGT           *string  `json:"aliasGT,omitempty"`
	AliasGTE          *string  `json:"aliasGTE,omitempty"`
	AliasLT           *string  `json:"aliasLT,omitempty"`
	AliasLTE          *string  `json:"aliasLTE,omitempty"`
	AliasContains     *string  `json:"aliasContains,omitempty"`
	AliasHasPrefix    *string  `json:"aliasHasPrefix,omitempty"`
	AliasHasSuffix    *string  `json:"aliasHasSuffix,omitempty"`
	AliasEqualFold    *string  `json:"aliasEqualFold,omitempty"`
	AliasContainsFold *string  `json:"aliasContainsFold,omitempty"`

	// "bio" field predicates.
	Bio             *string  `json:"bio,omitempty"`
	BioNEQ          *string  `json:"bioNEQ,omitempty"`
	BioIn           []string `json:"bioIn,omitempty"`
	BioNotIn        []string `json:"bioNotIn,omitempty"`
	BioGT           *string  `json:"bioGT,omitempty"`
	BioGTE          *string  `json:"bioGTE,omitempty"`
	BioLT           *string  `json:"bioLT,omitempty"`
	BioLTE          *string  `json:"bioLTE,omitempty"`
	BioContains     *string  `json:"bioContains,omitempty"`
	BioHasPrefix    *string  `json:"bioHasPrefix,omitempty"`
	BioHasSuffix    *string  `json:"bioHasSuffix,omitempty"`
	BioIsNil        bool     `json:"bioIsNil,omitempty"`
	BioNotNil       bool     `json:"bioNotNil,omitempty"`
	BioEqualFold    *string  `json:"bioEqualFold,omitempty"`
	BioContainsFold *string  `json:"bioContainsFold,omitempty"`

	// "followers" edge predicates.
	HasFollowers     *bool             `json:"hasFollowers,omitempty"`
	HasFollowersWith []*UserWhereInput `json:"hasFollowersWith,omitempty"`

	// "following" edge predicates.
	HasFollowing     *bool             `json:"hasFollowing,omitempty"`
	HasFollowingWith []*UserWhereInput `json:"hasFollowingWith,omitempty"`

	// "posts" edge predicates.
	HasPosts     *bool             `json:"hasPosts,omitempty"`
	HasPostsWith []*PostWhereInput `json:"hasPostsWith,omitempty"`

	// "groups" edge predicates.
	HasGroups     *bool              `json:"hasGroups,omitempty"`
	HasGroupsWith []*GroupWhereInput `json:"hasGroupsWith,omitempty"`
}

UserWhereInput represents a where input for filtering User queries.

func (*UserWhereInput) AddPredicates

func (i *UserWhereInput) AddPredicates(predicates ...predicate.User)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*UserWhereInput) Filter

func (i *UserWhereInput) Filter(q *UserQuery) (*UserQuery, error)

Filter applies the UserWhereInput filter on the UserQuery builder.

func (*UserWhereInput) P

func (i *UserWhereInput) P() (predicate.User, error)

P returns a predicate for filtering users. An error is returned if the input is empty or invalid.

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

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

Directories

Path Synopsis
sql

Jump to

Keyboard shortcuts

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