ent

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: Apache-2.0 Imports: 43 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.
	TypeBillProduct = "BillProduct"
	TypeCategory    = "Category"
	TypeFriendship  = "Friendship"
	TypeGroup       = "Group"
	TypeOneToMany   = "OneToMany"
	TypeProject     = "Project"
	TypeTodo        = "Todo"
	TypeUser        = "User"
	TypeVerySecret  = "VerySecret"
	TypeWorkspace   = "Workspace"
)

Variables

View Source
var (
	// CategoryOrderFieldID orders Category by id.
	CategoryOrderFieldID = &CategoryOrderField{
		Value: func(c *Category) (ent.Value, error) {
			return c.ID, nil
		},
		column: category.FieldID,
		toTerm: category.ByID,
		toCursor: func(c *Category) Cursor {
			return Cursor{
				ID:    c.ID,
				Value: c.ID,
			}
		},
	}
	// CategoryOrderFieldText orders Category by text.
	CategoryOrderFieldText = &CategoryOrderField{
		Value: func(c *Category) (ent.Value, error) {
			return c.Text, nil
		},
		column: category.FieldText,
		toTerm: category.ByText,
		toCursor: func(c *Category) Cursor {
			return Cursor{
				ID:    c.ID,
				Value: c.Text,
			}
		},
	}
	// CategoryOrderFieldStatus orders Category by status.
	CategoryOrderFieldStatus = &CategoryOrderField{
		Value: func(c *Category) (ent.Value, error) {
			return c.Status, nil
		},
		column: category.FieldStatus,
		toTerm: category.ByStatus,
		toCursor: func(c *Category) Cursor {
			return Cursor{
				ID:    c.ID,
				Value: c.Status,
			}
		},
	}
	// CategoryOrderFieldDuration orders Category by duration.
	CategoryOrderFieldDuration = &CategoryOrderField{
		Value: func(c *Category) (ent.Value, error) {
			return c.Duration, nil
		},
		column: category.FieldDuration,
		toTerm: category.ByDuration,
		toCursor: func(c *Category) Cursor {
			return Cursor{
				ID:    c.ID,
				Value: c.Duration,
			}
		},
	}
	// CategoryOrderFieldCount orders Category by count.
	CategoryOrderFieldCount = &CategoryOrderField{
		Value: func(c *Category) (ent.Value, error) {
			return c.Count, nil
		},
		column: category.FieldCount,
		toTerm: category.ByCount,
		toCursor: func(c *Category) Cursor {
			return Cursor{
				ID:    c.ID,
				Value: c.Count,
			}
		},
	}
	// CategoryOrderFieldTodosCount orders by TODOS_COUNT.
	CategoryOrderFieldTodosCount = &CategoryOrderField{
		Value: func(c *Category) (ent.Value, error) {
			return c.Value("todos_count")
		},
		column: "todos_count",
		toTerm: func(opts ...sql.OrderTermOption) category.OrderOption {
			return category.ByTodosCount(
				append(opts, sql.OrderSelectAs("todos_count"))...,
			)
		},
		toCursor: func(c *Category) Cursor {
			cv, _ := c.Value("todos_count")
			return Cursor{
				ID:    c.ID,
				Value: cv,
			}
		},
	}
)
View Source
var (
	// TodoOrderFieldCreatedAt orders Todo by created_at.
	TodoOrderFieldCreatedAt = &TodoOrderField{
		Value: func(t *Todo) (ent.Value, error) {
			return t.CreatedAt, nil
		},
		column: todo.FieldCreatedAt,
		toTerm: todo.ByCreatedAt,
		toCursor: func(t *Todo) Cursor {
			return Cursor{
				ID:    t.ID,
				Value: t.CreatedAt,
			}
		},
	}
	// TodoOrderFieldStatus orders Todo by status.
	TodoOrderFieldStatus = &TodoOrderField{
		Value: func(t *Todo) (ent.Value, error) {
			return t.Status, nil
		},
		column: todo.FieldStatus,
		toTerm: todo.ByStatus,
		toCursor: func(t *Todo) Cursor {
			return Cursor{
				ID:    t.ID,
				Value: t.Status,
			}
		},
	}
	// TodoOrderFieldPriority orders Todo by priority.
	TodoOrderFieldPriority = &TodoOrderField{
		Value: func(t *Todo) (ent.Value, error) {
			return t.Priority, nil
		},
		column: todo.FieldPriority,
		toTerm: todo.ByPriority,
		toCursor: func(t *Todo) Cursor {
			return Cursor{
				ID:    t.ID,
				Value: t.Priority,
			}
		},
	}
	// TodoOrderFieldText orders Todo by text.
	TodoOrderFieldText = &TodoOrderField{
		Value: func(t *Todo) (ent.Value, error) {
			return t.Text, nil
		},
		column: todo.FieldText,
		toTerm: todo.ByText,
		toCursor: func(t *Todo) Cursor {
			return Cursor{
				ID:    t.ID,
				Value: t.Text,
			}
		},
	}
	// TodoOrderFieldParentStatus orders by PARENT_STATUS.
	TodoOrderFieldParentStatus = &TodoOrderField{
		Value: func(t *Todo) (ent.Value, error) {
			return t.Value("parent_status")
		},
		column: "parent_status",
		toTerm: func(opts ...sql.OrderTermOption) todo.OrderOption {
			return todo.ByParentField(
				todo.FieldStatus,
				append(opts, sql.OrderSelectAs("parent_status"))...,
			)
		},
		toCursor: func(t *Todo) Cursor {
			cv, _ := t.Value("parent_status")
			return Cursor{
				ID:    t.ID,
				Value: cv,
			}
		},
	}
	// TodoOrderFieldChildrenCount orders by CHILDREN_COUNT.
	TodoOrderFieldChildrenCount = &TodoOrderField{
		Value: func(t *Todo) (ent.Value, error) {
			return t.Value("children_count")
		},
		column: "children_count",
		toTerm: func(opts ...sql.OrderTermOption) todo.OrderOption {
			return todo.ByChildrenCount(
				append(opts, sql.OrderSelectAs("children_count"))...,
			)
		},
		toCursor: func(t *Todo) Cursor {
			cv, _ := t.Value("children_count")
			return Cursor{
				ID:    t.ID,
				Value: cv,
			}
		},
	}
	// CategoryOrderFieldCategoryText orders by CATEGORY_TEXT.
	CategoryOrderFieldCategoryText = &TodoOrderField{
		Value: func(t *Todo) (ent.Value, error) {
			return t.Value("category_text")
		},
		column: "category_text",
		toTerm: func(opts ...sql.OrderTermOption) todo.OrderOption {
			return todo.ByCategoryField(
				category.FieldText,
				append(opts, sql.OrderSelectAs("category_text"))...,
			)
		},
		toCursor: func(t *Todo) Cursor {
			cv, _ := t.Value("category_text")
			return Cursor{
				ID:    t.ID,
				Value: cv,
			}
		},
	}
)
View Source
var DefaultBillProductOrder = &BillProductOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &BillProductOrderField{
		Value: func(bp *BillProduct) (ent.Value, error) {
			return bp.ID, nil
		},
		column: billproduct.FieldID,
		toTerm: billproduct.ByID,
		toCursor: func(bp *BillProduct) Cursor {
			return Cursor{ID: bp.ID}
		},
	},
}

DefaultBillProductOrder is the default ordering of BillProduct.

View Source
var DefaultCategoryOrder = &CategoryOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &CategoryOrderField{
		Value: func(c *Category) (ent.Value, error) {
			return c.ID, nil
		},
		column: category.FieldID,
		toTerm: category.ByID,
		toCursor: func(c *Category) Cursor {
			return Cursor{ID: c.ID}
		},
	},
}

DefaultCategoryOrder is the default ordering of Category.

View Source
var DefaultFriendshipOrder = &FriendshipOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &FriendshipOrderField{
		Value: func(f *Friendship) (ent.Value, error) {
			return f.ID, nil
		},
		column: friendship.FieldID,
		toTerm: friendship.ByID,
		toCursor: func(f *Friendship) Cursor {
			return Cursor{ID: f.ID}
		},
	},
}

DefaultFriendshipOrder is the default ordering of Friendship.

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 DefaultOneToManyOrder = &OneToManyOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &OneToManyOrderField{
		Value: func(otm *OneToMany) (ent.Value, error) {
			return otm.ID, nil
		},
		column: onetomany.FieldID,
		toTerm: onetomany.ByID,
		toCursor: func(otm *OneToMany) Cursor {
			return Cursor{ID: otm.ID}
		},
	},
}

DefaultOneToManyOrder is the default ordering of OneToMany.

View Source
var DefaultOrganizationOrder = &OrganizationOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &OrganizationOrderField{
		Value: func(w *Organization) (ent.Value, error) {
			return w.ID, nil
		},
		column: workspace.FieldID,
		toTerm: workspace.ByID,
		toCursor: func(w *Organization) Cursor {
			return Cursor{ID: w.ID}
		},
	},
}

DefaultOrganizationOrder is the default ordering of Workspace.

View Source
var DefaultProjectOrder = &ProjectOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &ProjectOrderField{
		Value: func(pr *Project) (ent.Value, error) {
			return pr.ID, nil
		},
		column: project.FieldID,
		toTerm: project.ByID,
		toCursor: func(pr *Project) Cursor {
			return Cursor{ID: pr.ID}
		},
	},
}

DefaultProjectOrder is the default ordering of Project.

View Source
var DefaultTodoOrder = &TodoOrder{
	Direction: entgql.OrderDirectionAsc,
	Field: &TodoOrderField{
		Value: func(t *Todo) (ent.Value, error) {
			return t.ID, nil
		},
		column: todo.FieldID,
		toTerm: todo.ByID,
		toCursor: func(t *Todo) Cursor {
			return Cursor{ID: t.ID}
		},
	},
}

DefaultTodoOrder is the default ordering of Todo.

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 ErrEmptyBillProductWhereInput = errors.New("ent: empty predicate BillProductWhereInput")

ErrEmptyBillProductWhereInput is returned in case the BillProductWhereInput is empty.

View Source
var ErrEmptyCategoryWhereInput = errors.New("ent: empty predicate CategoryWhereInput")

ErrEmptyCategoryWhereInput is returned in case the CategoryWhereInput is empty.

View Source
var ErrEmptyFriendshipWhereInput = errors.New("ent: empty predicate FriendshipWhereInput")

ErrEmptyFriendshipWhereInput is returned in case the FriendshipWhereInput is empty.

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

ErrEmptyGroupWhereInput is returned in case the GroupWhereInput is empty.

View Source
var ErrEmptyOneToManyWhereInput = errors.New("ent: empty predicate OneToManyWhereInput")

ErrEmptyOneToManyWhereInput is returned in case the OneToManyWhereInput is empty.

View Source
var ErrEmptyOrganizationWhereInput = errors.New("ent: empty predicate OrganizationWhereInput")

ErrEmptyOrganizationWhereInput is returned in case the OrganizationWhereInput is empty.

View Source
var ErrEmptyProjectWhereInput = errors.New("ent: empty predicate ProjectWhereInput")

ErrEmptyProjectWhereInput is returned in case the ProjectWhereInput is empty.

View Source
var ErrEmptyTodoWhereInput = errors.New("ent: empty predicate TodoWhereInput")

ErrEmptyTodoWhereInput is returned in case the TodoWhereInput is empty.

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

ErrEmptyUserWhereInput is returned in case the UserWhereInput is empty.

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

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

View Source
var (
	// OneToManyOrderFieldName orders OneToMany by name.
	OneToManyOrderFieldName = &OneToManyOrderField{
		Value: func(otm *OneToMany) (ent.Value, error) {
			return otm.Name, nil
		},
		column: onetomany.FieldName,
		toTerm: onetomany.ByName,
		toCursor: func(otm *OneToMany) Cursor {
			return Cursor{
				ID:    otm.ID,
				Value: otm.Name,
			}
		},
	}
)
View Source
var (
	// UserOrderFieldGroupsCount orders by GROUPS_COUNT.
	UserOrderFieldGroupsCount = &UserOrderField{
		Value: func(u *User) (ent.Value, error) {
			return u.Value("groups_count")
		},
		column: "groups_count",
		toTerm: func(opts ...sql.OrderTermOption) user.OrderOption {
			return user.ByGroupsCount(
				append(opts, sql.OrderSelectAs("groups_count"))...,
			)
		},
		toCursor: func(u *User) Cursor {
			cv, _ := u.Value("groups_count")
			return Cursor{
				ID:    u.ID,
				Value: cv,
			}
		},
	}
)

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

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(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")).
Scan(ctx, &v)

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type BillProduct

type BillProduct struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Sku holds the value of the "sku" field.
	Sku string `json:"sku,omitempty"`
	// Quantity holds the value of the "quantity" field.
	Quantity uint64 `json:"quantity,omitempty"`
	// contains filtered or unexported fields
}

BillProduct is the model entity for the BillProduct schema.

func (*BillProduct) IsNode

func (*BillProduct) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*BillProduct) Node

func (bp *BillProduct) Node(ctx context.Context) (node *Node, err error)

Node implements Noder interface

func (*BillProduct) String

func (bp *BillProduct) String() string

String implements the fmt.Stringer.

func (*BillProduct) ToEdge

func (bp *BillProduct) ToEdge(order *BillProductOrder) *BillProductEdge

ToEdge converts BillProduct into BillProductEdge.

func (*BillProduct) Unwrap

func (bp *BillProduct) Unwrap() *BillProduct

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

func (bp *BillProduct) Update() *BillProductUpdateOne

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

func (*BillProduct) Value

func (bp *BillProduct) Value(name string) (ent.Value, error)

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

type BillProductClient

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

BillProductClient is a client for the BillProduct schema.

func NewBillProductClient

func NewBillProductClient(c config) *BillProductClient

NewBillProductClient returns a client for the BillProduct from the given config.

func (*BillProductClient) Create

func (c *BillProductClient) Create() *BillProductCreate

Create returns a builder for creating a BillProduct entity.

func (*BillProductClient) CreateBulk

func (c *BillProductClient) CreateBulk(builders ...*BillProductCreate) *BillProductCreateBulk

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

func (*BillProductClient) Delete

func (c *BillProductClient) Delete() *BillProductDelete

Delete returns a delete builder for BillProduct.

func (*BillProductClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*BillProductClient) DeleteOneID

func (c *BillProductClient) DeleteOneID(id int) *BillProductDeleteOne

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

func (*BillProductClient) Get

func (c *BillProductClient) Get(ctx context.Context, id int) (*BillProduct, error)

Get returns a BillProduct entity by its id.

func (*BillProductClient) GetX

func (c *BillProductClient) GetX(ctx context.Context, id int) *BillProduct

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

func (*BillProductClient) Hooks

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

Hooks returns the client hooks.

func (*BillProductClient) Intercept

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

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

func (*BillProductClient) Interceptors

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

Interceptors returns the client interceptors.

func (*BillProductClient) MapCreateBulk

func (c *BillProductClient) MapCreateBulk(slice any, setFunc func(*BillProductCreate, int)) *BillProductCreateBulk

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

func (*BillProductClient) Query

func (c *BillProductClient) Query() *BillProductQuery

Query returns a query builder for BillProduct.

func (*BillProductClient) Update

func (c *BillProductClient) Update() *BillProductUpdate

Update returns an update builder for BillProduct.

func (*BillProductClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*BillProductClient) UpdateOneID

func (c *BillProductClient) UpdateOneID(id int) *BillProductUpdateOne

UpdateOneID returns an update builder for the given id.

func (*BillProductClient) Use

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

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

type BillProductConnection

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

BillProductConnection is the connection containing edges to BillProduct.

type BillProductCreate

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

BillProductCreate is the builder for creating a BillProduct entity.

func (*BillProductCreate) Exec

func (bpc *BillProductCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*BillProductCreate) ExecX

func (bpc *BillProductCreate) ExecX(ctx context.Context)

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

func (*BillProductCreate) Mutation

func (bpc *BillProductCreate) Mutation() *BillProductMutation

Mutation returns the BillProductMutation object of the builder.

func (*BillProductCreate) Save

func (bpc *BillProductCreate) Save(ctx context.Context) (*BillProduct, error)

Save creates the BillProduct in the database.

func (*BillProductCreate) SaveX

func (bpc *BillProductCreate) SaveX(ctx context.Context) *BillProduct

SaveX calls Save and panics if Save returns an error.

func (*BillProductCreate) SetName

func (bpc *BillProductCreate) SetName(s string) *BillProductCreate

SetName sets the "name" field.

func (*BillProductCreate) SetQuantity

func (bpc *BillProductCreate) SetQuantity(u uint64) *BillProductCreate

SetQuantity sets the "quantity" field.

func (*BillProductCreate) SetSku

func (bpc *BillProductCreate) SetSku(s string) *BillProductCreate

SetSku sets the "sku" field.

type BillProductCreateBulk

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

BillProductCreateBulk is the builder for creating many BillProduct entities in bulk.

func (*BillProductCreateBulk) Exec

func (bpcb *BillProductCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*BillProductCreateBulk) ExecX

func (bpcb *BillProductCreateBulk) ExecX(ctx context.Context)

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

func (*BillProductCreateBulk) Save

func (bpcb *BillProductCreateBulk) Save(ctx context.Context) ([]*BillProduct, error)

Save creates the BillProduct entities in the database.

func (*BillProductCreateBulk) SaveX

func (bpcb *BillProductCreateBulk) SaveX(ctx context.Context) []*BillProduct

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

type BillProductDelete

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

BillProductDelete is the builder for deleting a BillProduct entity.

func (*BillProductDelete) Exec

func (bpd *BillProductDelete) Exec(ctx context.Context) (int, error)

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

func (*BillProductDelete) ExecX

func (bpd *BillProductDelete) ExecX(ctx context.Context) int

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

func (*BillProductDelete) Where

Where appends a list predicates to the BillProductDelete builder.

type BillProductDeleteOne

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

BillProductDeleteOne is the builder for deleting a single BillProduct entity.

func (*BillProductDeleteOne) Exec

func (bpdo *BillProductDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*BillProductDeleteOne) ExecX

func (bpdo *BillProductDeleteOne) ExecX(ctx context.Context)

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

func (*BillProductDeleteOne) Where

Where appends a list predicates to the BillProductDelete builder.

type BillProductEdge

type BillProductEdge struct {
	Node   *BillProduct `json:"node"`
	Cursor Cursor       `json:"cursor"`
}

BillProductEdge is the edge representation of BillProduct.

type BillProductGroupBy

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

BillProductGroupBy is the group-by builder for BillProduct entities.

func (*BillProductGroupBy) Aggregate

func (bpgb *BillProductGroupBy) Aggregate(fns ...AggregateFunc) *BillProductGroupBy

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

func (*BillProductGroupBy) Bool

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

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

func (*BillProductGroupBy) BoolX

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

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

func (*BillProductGroupBy) Bools

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

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

func (*BillProductGroupBy) BoolsX

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

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

func (*BillProductGroupBy) Float64

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

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

func (*BillProductGroupBy) Float64X

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

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

func (*BillProductGroupBy) Float64s

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

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

func (*BillProductGroupBy) Float64sX

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

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

func (*BillProductGroupBy) Int

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

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

func (*BillProductGroupBy) IntX

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

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

func (*BillProductGroupBy) Ints

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

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

func (*BillProductGroupBy) IntsX

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

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

func (*BillProductGroupBy) Scan

func (bpgb *BillProductGroupBy) Scan(ctx context.Context, v any) error

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

func (*BillProductGroupBy) ScanX

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

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

func (*BillProductGroupBy) String

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

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

func (*BillProductGroupBy) StringX

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

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

func (*BillProductGroupBy) Strings

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

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

func (*BillProductGroupBy) StringsX

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

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

type BillProductMutation

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

BillProductMutation represents an operation that mutates the BillProduct nodes in the graph.

func (*BillProductMutation) AddField

func (m *BillProductMutation) 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 (*BillProductMutation) AddQuantity

func (m *BillProductMutation) AddQuantity(u int64)

AddQuantity adds u to the "quantity" field.

func (*BillProductMutation) AddedEdges

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

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

func (*BillProductMutation) AddedField

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

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

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

func (*BillProductMutation) AddedIDs

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

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

func (*BillProductMutation) AddedQuantity

func (m *BillProductMutation) AddedQuantity() (r int64, exists bool)

AddedQuantity returns the value that was added to the "quantity" field in this mutation.

func (*BillProductMutation) ClearEdge

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

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

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

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

func (*BillProductMutation) ClearedFields

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

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

func (BillProductMutation) Client

func (m BillProductMutation) 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 (*BillProductMutation) EdgeCleared

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

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

func (*BillProductMutation) Field

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

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

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

func (*BillProductMutation) Fields

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

func (m *BillProductMutation) ID() (id int, exists bool)

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

func (*BillProductMutation) IDs

func (m *BillProductMutation) IDs(ctx context.Context) ([]int, error)

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

func (*BillProductMutation) Name

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

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

func (*BillProductMutation) OldField

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

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

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

func (m *BillProductMutation) OldQuantity(ctx context.Context) (v uint64, err error)

OldQuantity returns the old "quantity" field's value of the BillProduct entity. If the BillProduct 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 (*BillProductMutation) OldSku

func (m *BillProductMutation) OldSku(ctx context.Context) (v string, err error)

OldSku returns the old "sku" field's value of the BillProduct entity. If the BillProduct 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 (*BillProductMutation) Op

func (m *BillProductMutation) Op() Op

Op returns the operation name.

func (*BillProductMutation) Quantity

func (m *BillProductMutation) Quantity() (r uint64, exists bool)

Quantity returns the value of the "quantity" field in the mutation.

func (*BillProductMutation) RemovedEdges

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

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

func (*BillProductMutation) RemovedIDs

func (m *BillProductMutation) 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 (*BillProductMutation) ResetEdge

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

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

func (m *BillProductMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*BillProductMutation) ResetQuantity

func (m *BillProductMutation) ResetQuantity()

ResetQuantity resets all changes to the "quantity" field.

func (*BillProductMutation) ResetSku

func (m *BillProductMutation) ResetSku()

ResetSku resets all changes to the "sku" field.

func (*BillProductMutation) SetField

func (m *BillProductMutation) 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 (*BillProductMutation) SetName

func (m *BillProductMutation) SetName(s string)

SetName sets the "name" field.

func (*BillProductMutation) SetOp

func (m *BillProductMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*BillProductMutation) SetQuantity

func (m *BillProductMutation) SetQuantity(u uint64)

SetQuantity sets the "quantity" field.

func (*BillProductMutation) SetSku

func (m *BillProductMutation) SetSku(s string)

SetSku sets the "sku" field.

func (*BillProductMutation) Sku

func (m *BillProductMutation) Sku() (r string, exists bool)

Sku returns the value of the "sku" field in the mutation.

func (BillProductMutation) Tx

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

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

func (*BillProductMutation) Type

func (m *BillProductMutation) Type() string

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

func (*BillProductMutation) Where

func (m *BillProductMutation) Where(ps ...predicate.BillProduct)

Where appends a list predicates to the BillProductMutation builder.

func (*BillProductMutation) WhereP

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

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

type BillProductOrder

type BillProductOrder struct {
	Direction OrderDirection         `json:"direction"`
	Field     *BillProductOrderField `json:"field"`
}

BillProductOrder defines the ordering of BillProduct.

type BillProductOrderField

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

BillProductOrderField defines the ordering field of BillProduct.

type BillProductPaginateOption

type BillProductPaginateOption func(*billproductPager) error

BillProductPaginateOption enables pagination customization.

func WithBillProductFilter

func WithBillProductFilter(filter func(*BillProductQuery) (*BillProductQuery, error)) BillProductPaginateOption

WithBillProductFilter configures pagination filter.

func WithBillProductOrder

func WithBillProductOrder(order *BillProductOrder) BillProductPaginateOption

WithBillProductOrder configures pagination ordering.

type BillProductQuery

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

BillProductQuery is the builder for querying BillProduct entities.

func (*BillProductQuery) Aggregate

func (bpq *BillProductQuery) Aggregate(fns ...AggregateFunc) *BillProductSelect

Aggregate returns a BillProductSelect configured with the given aggregations.

func (*BillProductQuery) All

func (bpq *BillProductQuery) All(ctx context.Context) ([]*BillProduct, error)

All executes the query and returns a list of BillProducts.

func (*BillProductQuery) AllX

func (bpq *BillProductQuery) AllX(ctx context.Context) []*BillProduct

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

func (*BillProductQuery) Clone

func (bpq *BillProductQuery) Clone() *BillProductQuery

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

func (*BillProductQuery) CollectFields

func (bp *BillProductQuery) CollectFields(ctx context.Context, satisfies ...string) (*BillProductQuery, error)

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

func (*BillProductQuery) Count

func (bpq *BillProductQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*BillProductQuery) CountX

func (bpq *BillProductQuery) CountX(ctx context.Context) int

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

func (*BillProductQuery) Exist

func (bpq *BillProductQuery) Exist(ctx context.Context) (bool, error)

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

func (*BillProductQuery) ExistX

func (bpq *BillProductQuery) ExistX(ctx context.Context) bool

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

func (*BillProductQuery) First

func (bpq *BillProductQuery) First(ctx context.Context) (*BillProduct, error)

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

func (*BillProductQuery) FirstID

func (bpq *BillProductQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*BillProductQuery) FirstIDX

func (bpq *BillProductQuery) FirstIDX(ctx context.Context) int

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

func (*BillProductQuery) FirstX

func (bpq *BillProductQuery) FirstX(ctx context.Context) *BillProduct

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

func (*BillProductQuery) GroupBy

func (bpq *BillProductQuery) GroupBy(field string, fields ...string) *BillProductGroupBy

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

Example:

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

client.BillProduct.Query().
	GroupBy(billproduct.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*BillProductQuery) IDs

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

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

func (*BillProductQuery) IDsX

func (bpq *BillProductQuery) IDsX(ctx context.Context) []int

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

func (*BillProductQuery) Limit

func (bpq *BillProductQuery) Limit(limit int) *BillProductQuery

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

func (*BillProductQuery) Modify

func (bpq *BillProductQuery) Modify(modifiers ...func(s *sql.Selector)) *BillProductSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*BillProductQuery) Offset

func (bpq *BillProductQuery) Offset(offset int) *BillProductQuery

Offset to start from.

func (*BillProductQuery) Only

func (bpq *BillProductQuery) Only(ctx context.Context) (*BillProduct, error)

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

func (*BillProductQuery) OnlyID

func (bpq *BillProductQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*BillProductQuery) OnlyIDX

func (bpq *BillProductQuery) OnlyIDX(ctx context.Context) int

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

func (*BillProductQuery) OnlyX

func (bpq *BillProductQuery) OnlyX(ctx context.Context) *BillProduct

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

func (*BillProductQuery) Order

Order specifies how the records should be ordered.

func (*BillProductQuery) Paginate

func (bp *BillProductQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...BillProductPaginateOption,
) (*BillProductConnection, error)

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

func (*BillProductQuery) Select

func (bpq *BillProductQuery) Select(fields ...string) *BillProductSelect

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

Example:

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

client.BillProduct.Query().
	Select(billproduct.FieldName).
	Scan(ctx, &v)

func (*BillProductQuery) Unique

func (bpq *BillProductQuery) Unique(unique bool) *BillProductQuery

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

Where adds a new predicate for the BillProductQuery builder.

type BillProductSelect

type BillProductSelect struct {
	*BillProductQuery
	// contains filtered or unexported fields
}

BillProductSelect is the builder for selecting fields of BillProduct entities.

func (*BillProductSelect) Aggregate

func (bps *BillProductSelect) Aggregate(fns ...AggregateFunc) *BillProductSelect

Aggregate adds the given aggregation functions to the selector query.

func (*BillProductSelect) Bool

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

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

func (*BillProductSelect) BoolX

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

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

func (*BillProductSelect) Bools

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

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

func (*BillProductSelect) BoolsX

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

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

func (*BillProductSelect) Float64

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

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

func (*BillProductSelect) Float64X

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

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

func (*BillProductSelect) Float64s

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

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

func (*BillProductSelect) Float64sX

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

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

func (*BillProductSelect) Int

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

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

func (*BillProductSelect) IntX

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

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

func (*BillProductSelect) Ints

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

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

func (*BillProductSelect) IntsX

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

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

func (*BillProductSelect) Modify

func (bps *BillProductSelect) Modify(modifiers ...func(s *sql.Selector)) *BillProductSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*BillProductSelect) Scan

func (bps *BillProductSelect) Scan(ctx context.Context, v any) error

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

func (*BillProductSelect) ScanX

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

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

func (*BillProductSelect) String

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

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

func (*BillProductSelect) StringX

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

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

func (*BillProductSelect) Strings

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

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

func (*BillProductSelect) StringsX

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

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

type BillProductUpdate

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

BillProductUpdate is the builder for updating BillProduct entities.

func (*BillProductUpdate) AddQuantity

func (bpu *BillProductUpdate) AddQuantity(u int64) *BillProductUpdate

AddQuantity adds u to the "quantity" field.

func (*BillProductUpdate) Exec

func (bpu *BillProductUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*BillProductUpdate) ExecX

func (bpu *BillProductUpdate) ExecX(ctx context.Context)

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

func (*BillProductUpdate) Modify

func (bpu *BillProductUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *BillProductUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*BillProductUpdate) Mutation

func (bpu *BillProductUpdate) Mutation() *BillProductMutation

Mutation returns the BillProductMutation object of the builder.

func (*BillProductUpdate) Save

func (bpu *BillProductUpdate) Save(ctx context.Context) (int, error)

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

func (*BillProductUpdate) SaveX

func (bpu *BillProductUpdate) SaveX(ctx context.Context) int

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

func (*BillProductUpdate) SetName

func (bpu *BillProductUpdate) SetName(s string) *BillProductUpdate

SetName sets the "name" field.

func (*BillProductUpdate) SetNillableName

func (bpu *BillProductUpdate) SetNillableName(s *string) *BillProductUpdate

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

func (*BillProductUpdate) SetNillableQuantity

func (bpu *BillProductUpdate) SetNillableQuantity(u *uint64) *BillProductUpdate

SetNillableQuantity sets the "quantity" field if the given value is not nil.

func (*BillProductUpdate) SetNillableSku

func (bpu *BillProductUpdate) SetNillableSku(s *string) *BillProductUpdate

SetNillableSku sets the "sku" field if the given value is not nil.

func (*BillProductUpdate) SetQuantity

func (bpu *BillProductUpdate) SetQuantity(u uint64) *BillProductUpdate

SetQuantity sets the "quantity" field.

func (*BillProductUpdate) SetSku

func (bpu *BillProductUpdate) SetSku(s string) *BillProductUpdate

SetSku sets the "sku" field.

func (*BillProductUpdate) Where

Where appends a list predicates to the BillProductUpdate builder.

type BillProductUpdateOne

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

BillProductUpdateOne is the builder for updating a single BillProduct entity.

func (*BillProductUpdateOne) AddQuantity

func (bpuo *BillProductUpdateOne) AddQuantity(u int64) *BillProductUpdateOne

AddQuantity adds u to the "quantity" field.

func (*BillProductUpdateOne) Exec

func (bpuo *BillProductUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*BillProductUpdateOne) ExecX

func (bpuo *BillProductUpdateOne) ExecX(ctx context.Context)

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

func (*BillProductUpdateOne) Modify

func (bpuo *BillProductUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *BillProductUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*BillProductUpdateOne) Mutation

func (bpuo *BillProductUpdateOne) Mutation() *BillProductMutation

Mutation returns the BillProductMutation object of the builder.

func (*BillProductUpdateOne) Save

Save executes the query and returns the updated BillProduct entity.

func (*BillProductUpdateOne) SaveX

func (bpuo *BillProductUpdateOne) SaveX(ctx context.Context) *BillProduct

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

func (*BillProductUpdateOne) Select

func (bpuo *BillProductUpdateOne) Select(field string, fields ...string) *BillProductUpdateOne

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

func (*BillProductUpdateOne) SetName

SetName sets the "name" field.

func (*BillProductUpdateOne) SetNillableName

func (bpuo *BillProductUpdateOne) SetNillableName(s *string) *BillProductUpdateOne

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

func (*BillProductUpdateOne) SetNillableQuantity

func (bpuo *BillProductUpdateOne) SetNillableQuantity(u *uint64) *BillProductUpdateOne

SetNillableQuantity sets the "quantity" field if the given value is not nil.

func (*BillProductUpdateOne) SetNillableSku

func (bpuo *BillProductUpdateOne) SetNillableSku(s *string) *BillProductUpdateOne

SetNillableSku sets the "sku" field if the given value is not nil.

func (*BillProductUpdateOne) SetQuantity

func (bpuo *BillProductUpdateOne) SetQuantity(u uint64) *BillProductUpdateOne

SetQuantity sets the "quantity" field.

func (*BillProductUpdateOne) SetSku

SetSku sets the "sku" field.

func (*BillProductUpdateOne) Where

Where appends a list predicates to the BillProductUpdate builder.

type BillProductWhereInput

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

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

	// "name" field predicates.
	Name             *string  `json:"name,omitempty"`
	NameNEQ          *string  `json:"nameNEQ,omitempty"`
	NameIn           []string `json:"nameIn,omitempty"`
	NameNotIn        []string `json:"nameNotIn,omitempty"`
	NameGT           *string  `json:"nameGT,omitempty"`
	NameGTE          *string  `json:"nameGTE,omitempty"`
	NameLT           *string  `json:"nameLT,omitempty"`
	NameLTE          *string  `json:"nameLTE,omitempty"`
	NameContains     *string  `json:"nameContains,omitempty"`
	NameHasPrefix    *string  `json:"nameHasPrefix,omitempty"`
	NameHasSuffix    *string  `json:"nameHasSuffix,omitempty"`
	NameEqualFold    *string  `json:"nameEqualFold,omitempty"`
	NameContainsFold *string  `json:"nameContainsFold,omitempty"`

	// "sku" field predicates.
	Sku             *string  `json:"sku,omitempty"`
	SkuNEQ          *string  `json:"skuNEQ,omitempty"`
	SkuIn           []string `json:"skuIn,omitempty"`
	SkuNotIn        []string `json:"skuNotIn,omitempty"`
	SkuGT           *string  `json:"skuGT,omitempty"`
	SkuGTE          *string  `json:"skuGTE,omitempty"`
	SkuLT           *string  `json:"skuLT,omitempty"`
	SkuLTE          *string  `json:"skuLTE,omitempty"`
	SkuContains     *string  `json:"skuContains,omitempty"`
	SkuHasPrefix    *string  `json:"skuHasPrefix,omitempty"`
	SkuHasSuffix    *string  `json:"skuHasSuffix,omitempty"`
	SkuEqualFold    *string  `json:"skuEqualFold,omitempty"`
	SkuContainsFold *string  `json:"skuContainsFold,omitempty"`

	// "quantity" field predicates.
	Quantity      *uint64  `json:"quantity,omitempty"`
	QuantityNEQ   *uint64  `json:"quantityNEQ,omitempty"`
	QuantityIn    []uint64 `json:"quantityIn,omitempty"`
	QuantityNotIn []uint64 `json:"quantityNotIn,omitempty"`
	QuantityGT    *uint64  `json:"quantityGT,omitempty"`
	QuantityGTE   *uint64  `json:"quantityGTE,omitempty"`
	QuantityLT    *uint64  `json:"quantityLT,omitempty"`
	QuantityLTE   *uint64  `json:"quantityLTE,omitempty"`
}

BillProductWhereInput represents a where input for filtering BillProduct queries.

func (*BillProductWhereInput) AddPredicates

func (i *BillProductWhereInput) AddPredicates(predicates ...predicate.BillProduct)

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

func (*BillProductWhereInput) Filter

Filter applies the BillProductWhereInput filter on the BillProductQuery builder.

func (*BillProductWhereInput) P

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

type BillProducts

type BillProducts []*BillProduct

BillProducts is a parsable slice of BillProduct.

type Categories

type Categories []*Category

Categories is a parsable slice of Category.

type Category

type Category struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Text holds the value of the "text" field.
	Text string `json:"text,omitempty"`
	// Status holds the value of the "status" field.
	Status category.Status `json:"status,omitempty"`
	// Config holds the value of the "config" field.
	Config *schematype.CategoryConfig `json:"config,omitempty"`
	// Types holds the value of the "types" field.
	Types *schematype.CategoryTypes `json:"types,omitempty"`
	// Duration holds the value of the "duration" field.
	Duration time.Duration `json:"duration,omitempty"`
	// Count holds the value of the "count" field.
	Count uint64 `json:"count,omitempty"`
	// Strings holds the value of the "strings" field.
	Strings []string `json:"strings,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the CategoryQuery when eager-loading is set.
	Edges CategoryEdges `json:"edges"`
	// contains filtered or unexported fields
}

Category is the model entity for the Category schema.

func (*Category) IsNode

func (*Category) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*Category) NamedSubCategories

func (c *Category) NamedSubCategories(name string) ([]*Category, error)

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

func (*Category) NamedTodos

func (c *Category) NamedTodos(name string) ([]*Todo, error)

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

func (*Category) Node

func (c *Category) Node(ctx context.Context) (node *Node, err error)

Node implements Noder interface

func (*Category) QuerySubCategories

func (c *Category) QuerySubCategories() *CategoryQuery

QuerySubCategories queries the "sub_categories" edge of the Category entity.

func (*Category) QueryTodos

func (c *Category) QueryTodos() *TodoQuery

QueryTodos queries the "todos" edge of the Category entity.

func (*Category) String

func (c *Category) String() string

String implements the fmt.Stringer.

func (*Category) SubCategories

func (c *Category) SubCategories(
	ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, orderBy []*CategoryOrder, where *CategoryWhereInput,
) (*CategoryConnection, error)

func (*Category) ToEdge

func (c *Category) ToEdge(order *CategoryOrder) *CategoryEdge

ToEdge converts Category into CategoryEdge.

func (*Category) Todos

func (c *Category) Todos(
	ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, orderBy []*TodoOrder, where *TodoWhereInput,
) (*TodoConnection, error)

func (*Category) Unwrap

func (c *Category) Unwrap() *Category

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

func (c *Category) Update() *CategoryUpdateOne

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

func (*Category) Value

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

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

type CategoryClient

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

CategoryClient is a client for the Category schema.

func NewCategoryClient

func NewCategoryClient(c config) *CategoryClient

NewCategoryClient returns a client for the Category from the given config.

func (*CategoryClient) Create

func (c *CategoryClient) Create() *CategoryCreate

Create returns a builder for creating a Category entity.

func (*CategoryClient) CreateBulk

func (c *CategoryClient) CreateBulk(builders ...*CategoryCreate) *CategoryCreateBulk

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

func (*CategoryClient) Delete

func (c *CategoryClient) Delete() *CategoryDelete

Delete returns a delete builder for Category.

func (*CategoryClient) DeleteOne

func (c *CategoryClient) DeleteOne(ca *Category) *CategoryDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CategoryClient) DeleteOneID

func (c *CategoryClient) DeleteOneID(id int) *CategoryDeleteOne

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

func (*CategoryClient) Get

func (c *CategoryClient) Get(ctx context.Context, id int) (*Category, error)

Get returns a Category entity by its id.

func (*CategoryClient) GetX

func (c *CategoryClient) GetX(ctx context.Context, id int) *Category

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

func (*CategoryClient) Hooks

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

Hooks returns the client hooks.

func (*CategoryClient) Intercept

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

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

func (*CategoryClient) Interceptors

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

Interceptors returns the client interceptors.

func (*CategoryClient) MapCreateBulk

func (c *CategoryClient) MapCreateBulk(slice any, setFunc func(*CategoryCreate, int)) *CategoryCreateBulk

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

func (*CategoryClient) Query

func (c *CategoryClient) Query() *CategoryQuery

Query returns a query builder for Category.

func (*CategoryClient) QuerySubCategories

func (c *CategoryClient) QuerySubCategories(ca *Category) *CategoryQuery

QuerySubCategories queries the sub_categories edge of a Category.

func (*CategoryClient) QueryTodos

func (c *CategoryClient) QueryTodos(ca *Category) *TodoQuery

QueryTodos queries the todos edge of a Category.

func (*CategoryClient) Update

func (c *CategoryClient) Update() *CategoryUpdate

Update returns an update builder for Category.

func (*CategoryClient) UpdateOne

func (c *CategoryClient) UpdateOne(ca *Category) *CategoryUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CategoryClient) UpdateOneID

func (c *CategoryClient) UpdateOneID(id int) *CategoryUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CategoryClient) Use

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

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

type CategoryConnection

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

CategoryConnection is the connection containing edges to Category.

type CategoryCreate

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

CategoryCreate is the builder for creating a Category entity.

func (*CategoryCreate) AddSubCategories

func (cc *CategoryCreate) AddSubCategories(c ...*Category) *CategoryCreate

AddSubCategories adds the "sub_categories" edges to the Category entity.

func (*CategoryCreate) AddSubCategoryIDs

func (cc *CategoryCreate) AddSubCategoryIDs(ids ...int) *CategoryCreate

AddSubCategoryIDs adds the "sub_categories" edge to the Category entity by IDs.

func (*CategoryCreate) AddTodoIDs

func (cc *CategoryCreate) AddTodoIDs(ids ...int) *CategoryCreate

AddTodoIDs adds the "todos" edge to the Todo entity by IDs.

func (*CategoryCreate) AddTodos

func (cc *CategoryCreate) AddTodos(t ...*Todo) *CategoryCreate

AddTodos adds the "todos" edges to the Todo entity.

func (*CategoryCreate) Exec

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

Exec executes the query.

func (*CategoryCreate) ExecX

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

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

func (*CategoryCreate) Mutation

func (cc *CategoryCreate) Mutation() *CategoryMutation

Mutation returns the CategoryMutation object of the builder.

func (*CategoryCreate) Save

func (cc *CategoryCreate) Save(ctx context.Context) (*Category, error)

Save creates the Category in the database.

func (*CategoryCreate) SaveX

func (cc *CategoryCreate) SaveX(ctx context.Context) *Category

SaveX calls Save and panics if Save returns an error.

func (*CategoryCreate) SetConfig

SetConfig sets the "config" field.

func (*CategoryCreate) SetCount

func (cc *CategoryCreate) SetCount(u uint64) *CategoryCreate

SetCount sets the "count" field.

func (*CategoryCreate) SetDuration

func (cc *CategoryCreate) SetDuration(t time.Duration) *CategoryCreate

SetDuration sets the "duration" field.

func (*CategoryCreate) SetID

func (cc *CategoryCreate) SetID(i int) *CategoryCreate

SetID sets the "id" field.

func (*CategoryCreate) SetInput

SetInput applies the change-set in the CreateCategoryInput on the CategoryCreate builder.

func (*CategoryCreate) SetNillableCount

func (cc *CategoryCreate) SetNillableCount(u *uint64) *CategoryCreate

SetNillableCount sets the "count" field if the given value is not nil.

func (*CategoryCreate) SetNillableDuration

func (cc *CategoryCreate) SetNillableDuration(t *time.Duration) *CategoryCreate

SetNillableDuration sets the "duration" field if the given value is not nil.

func (*CategoryCreate) SetStatus

func (cc *CategoryCreate) SetStatus(c category.Status) *CategoryCreate

SetStatus sets the "status" field.

func (*CategoryCreate) SetStrings

func (cc *CategoryCreate) SetStrings(s []string) *CategoryCreate

SetStrings sets the "strings" field.

func (*CategoryCreate) SetText

func (cc *CategoryCreate) SetText(s string) *CategoryCreate

SetText sets the "text" field.

func (*CategoryCreate) SetTypes

SetTypes sets the "types" field.

type CategoryCreateBulk

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

CategoryCreateBulk is the builder for creating many Category entities in bulk.

func (*CategoryCreateBulk) Exec

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

Exec executes the query.

func (*CategoryCreateBulk) ExecX

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

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

func (*CategoryCreateBulk) Save

func (ccb *CategoryCreateBulk) Save(ctx context.Context) ([]*Category, error)

Save creates the Category entities in the database.

func (*CategoryCreateBulk) SaveX

func (ccb *CategoryCreateBulk) SaveX(ctx context.Context) []*Category

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

type CategoryDelete

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

CategoryDelete is the builder for deleting a Category entity.

func (*CategoryDelete) Exec

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

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

func (*CategoryDelete) ExecX

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

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

func (*CategoryDelete) Where

func (cd *CategoryDelete) Where(ps ...predicate.Category) *CategoryDelete

Where appends a list predicates to the CategoryDelete builder.

type CategoryDeleteOne

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

CategoryDeleteOne is the builder for deleting a single Category entity.

func (*CategoryDeleteOne) Exec

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

Exec executes the deletion query.

func (*CategoryDeleteOne) ExecX

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

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

func (*CategoryDeleteOne) Where

Where appends a list predicates to the CategoryDelete builder.

type CategoryEdge

type CategoryEdge struct {
	Node   *Category `json:"node"`
	Cursor Cursor    `json:"cursor"`
}

CategoryEdge is the edge representation of Category.

type CategoryEdges

type CategoryEdges struct {
	// Todos holds the value of the todos edge.
	Todos []*Todo `json:"todos,omitempty"`
	// SubCategories holds the value of the sub_categories edge.
	SubCategories []*Category `json:"sub_categories,omitempty"`
	// contains filtered or unexported fields
}

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

func (CategoryEdges) SubCategoriesOrErr

func (e CategoryEdges) SubCategoriesOrErr() ([]*Category, error)

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

func (CategoryEdges) TodosOrErr

func (e CategoryEdges) TodosOrErr() ([]*Todo, error)

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

type CategoryGroupBy

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

CategoryGroupBy is the group-by builder for Category entities.

func (*CategoryGroupBy) Aggregate

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

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

func (*CategoryGroupBy) Bool

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

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

func (*CategoryGroupBy) BoolX

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

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

func (*CategoryGroupBy) Bools

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

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

func (*CategoryGroupBy) BoolsX

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

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

func (*CategoryGroupBy) Float64

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

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

func (*CategoryGroupBy) Float64X

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

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

func (*CategoryGroupBy) Float64s

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

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

func (*CategoryGroupBy) Float64sX

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

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

func (*CategoryGroupBy) Int

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

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

func (*CategoryGroupBy) IntX

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

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

func (*CategoryGroupBy) Ints

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

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

func (*CategoryGroupBy) IntsX

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

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

func (*CategoryGroupBy) Scan

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

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

func (*CategoryGroupBy) ScanX

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

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

func (*CategoryGroupBy) String

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

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

func (*CategoryGroupBy) StringX

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

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

func (*CategoryGroupBy) Strings

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

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

func (*CategoryGroupBy) StringsX

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

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

type CategoryMutation

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

CategoryMutation represents an operation that mutates the Category nodes in the graph.

func (*CategoryMutation) AddCount

func (m *CategoryMutation) AddCount(u int64)

AddCount adds u to the "count" field.

func (*CategoryMutation) AddDuration

func (m *CategoryMutation) AddDuration(t time.Duration)

AddDuration adds t to the "duration" field.

func (*CategoryMutation) AddField

func (m *CategoryMutation) 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 (*CategoryMutation) AddSubCategoryIDs

func (m *CategoryMutation) AddSubCategoryIDs(ids ...int)

AddSubCategoryIDs adds the "sub_categories" edge to the Category entity by ids.

func (*CategoryMutation) AddTodoIDs

func (m *CategoryMutation) AddTodoIDs(ids ...int)

AddTodoIDs adds the "todos" edge to the Todo entity by ids.

func (*CategoryMutation) AddedCount

func (m *CategoryMutation) AddedCount() (r int64, exists bool)

AddedCount returns the value that was added to the "count" field in this mutation.

func (*CategoryMutation) AddedDuration

func (m *CategoryMutation) AddedDuration() (r time.Duration, exists bool)

AddedDuration returns the value that was added to the "duration" field in this mutation.

func (*CategoryMutation) AddedEdges

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

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

func (*CategoryMutation) AddedField

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

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

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

func (*CategoryMutation) AddedIDs

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

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

func (*CategoryMutation) AppendStrings

func (m *CategoryMutation) AppendStrings(s []string)

AppendStrings adds s to the "strings" field.

func (*CategoryMutation) AppendedStrings

func (m *CategoryMutation) AppendedStrings() ([]string, bool)

AppendedStrings returns the list of values that were appended to the "strings" field in this mutation.

func (*CategoryMutation) ClearConfig

func (m *CategoryMutation) ClearConfig()

ClearConfig clears the value of the "config" field.

func (*CategoryMutation) ClearCount

func (m *CategoryMutation) ClearCount()

ClearCount clears the value of the "count" field.

func (*CategoryMutation) ClearDuration

func (m *CategoryMutation) ClearDuration()

ClearDuration clears the value of the "duration" field.

func (*CategoryMutation) ClearEdge

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

func (m *CategoryMutation) 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 (*CategoryMutation) ClearStrings

func (m *CategoryMutation) ClearStrings()

ClearStrings clears the value of the "strings" field.

func (*CategoryMutation) ClearSubCategories

func (m *CategoryMutation) ClearSubCategories()

ClearSubCategories clears the "sub_categories" edge to the Category entity.

func (*CategoryMutation) ClearTodos

func (m *CategoryMutation) ClearTodos()

ClearTodos clears the "todos" edge to the Todo entity.

func (*CategoryMutation) ClearTypes

func (m *CategoryMutation) ClearTypes()

ClearTypes clears the value of the "types" field.

func (*CategoryMutation) ClearedEdges

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

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

func (*CategoryMutation) ClearedFields

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

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

func (CategoryMutation) Client

func (m CategoryMutation) 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 (*CategoryMutation) Config

func (m *CategoryMutation) Config() (r *schematype.CategoryConfig, exists bool)

Config returns the value of the "config" field in the mutation.

func (*CategoryMutation) ConfigCleared

func (m *CategoryMutation) ConfigCleared() bool

ConfigCleared returns if the "config" field was cleared in this mutation.

func (*CategoryMutation) Count

func (m *CategoryMutation) Count() (r uint64, exists bool)

Count returns the value of the "count" field in the mutation.

func (*CategoryMutation) CountCleared

func (m *CategoryMutation) CountCleared() bool

CountCleared returns if the "count" field was cleared in this mutation.

func (*CategoryMutation) Duration

func (m *CategoryMutation) Duration() (r time.Duration, exists bool)

Duration returns the value of the "duration" field in the mutation.

func (*CategoryMutation) DurationCleared

func (m *CategoryMutation) DurationCleared() bool

DurationCleared returns if the "duration" field was cleared in this mutation.

func (*CategoryMutation) EdgeCleared

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

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

func (*CategoryMutation) Field

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

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

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

func (*CategoryMutation) Fields

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

func (m *CategoryMutation) ID() (id int, exists bool)

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

func (*CategoryMutation) IDs

func (m *CategoryMutation) IDs(ctx context.Context) ([]int, error)

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

func (*CategoryMutation) OldConfig

func (m *CategoryMutation) OldConfig(ctx context.Context) (v *schematype.CategoryConfig, err error)

OldConfig returns the old "config" field's value of the Category entity. If the Category 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 (*CategoryMutation) OldCount

func (m *CategoryMutation) OldCount(ctx context.Context) (v uint64, err error)

OldCount returns the old "count" field's value of the Category entity. If the Category 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 (*CategoryMutation) OldDuration

func (m *CategoryMutation) OldDuration(ctx context.Context) (v time.Duration, err error)

OldDuration returns the old "duration" field's value of the Category entity. If the Category 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 (*CategoryMutation) OldField

func (m *CategoryMutation) 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 (*CategoryMutation) OldStatus

func (m *CategoryMutation) OldStatus(ctx context.Context) (v category.Status, err error)

OldStatus returns the old "status" field's value of the Category entity. If the Category 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 (*CategoryMutation) OldStrings

func (m *CategoryMutation) OldStrings(ctx context.Context) (v []string, err error)

OldStrings returns the old "strings" field's value of the Category entity. If the Category 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 (*CategoryMutation) OldText

func (m *CategoryMutation) OldText(ctx context.Context) (v string, err error)

OldText returns the old "text" field's value of the Category entity. If the Category 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 (*CategoryMutation) OldTypes

func (m *CategoryMutation) OldTypes(ctx context.Context) (v *schematype.CategoryTypes, err error)

OldTypes returns the old "types" field's value of the Category entity. If the Category 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 (*CategoryMutation) Op

func (m *CategoryMutation) Op() Op

Op returns the operation name.

func (*CategoryMutation) RemoveSubCategoryIDs

func (m *CategoryMutation) RemoveSubCategoryIDs(ids ...int)

RemoveSubCategoryIDs removes the "sub_categories" edge to the Category entity by IDs.

func (*CategoryMutation) RemoveTodoIDs

func (m *CategoryMutation) RemoveTodoIDs(ids ...int)

RemoveTodoIDs removes the "todos" edge to the Todo entity by IDs.

func (*CategoryMutation) RemovedEdges

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

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

func (*CategoryMutation) RemovedIDs

func (m *CategoryMutation) 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 (*CategoryMutation) RemovedSubCategoriesIDs

func (m *CategoryMutation) RemovedSubCategoriesIDs() (ids []int)

RemovedSubCategories returns the removed IDs of the "sub_categories" edge to the Category entity.

func (*CategoryMutation) RemovedTodosIDs

func (m *CategoryMutation) RemovedTodosIDs() (ids []int)

RemovedTodos returns the removed IDs of the "todos" edge to the Todo entity.

func (*CategoryMutation) ResetConfig

func (m *CategoryMutation) ResetConfig()

ResetConfig resets all changes to the "config" field.

func (*CategoryMutation) ResetCount

func (m *CategoryMutation) ResetCount()

ResetCount resets all changes to the "count" field.

func (*CategoryMutation) ResetDuration

func (m *CategoryMutation) ResetDuration()

ResetDuration resets all changes to the "duration" field.

func (*CategoryMutation) ResetEdge

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

func (m *CategoryMutation) 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 (*CategoryMutation) ResetStatus

func (m *CategoryMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*CategoryMutation) ResetStrings

func (m *CategoryMutation) ResetStrings()

ResetStrings resets all changes to the "strings" field.

func (*CategoryMutation) ResetSubCategories

func (m *CategoryMutation) ResetSubCategories()

ResetSubCategories resets all changes to the "sub_categories" edge.

func (*CategoryMutation) ResetText

func (m *CategoryMutation) ResetText()

ResetText resets all changes to the "text" field.

func (*CategoryMutation) ResetTodos

func (m *CategoryMutation) ResetTodos()

ResetTodos resets all changes to the "todos" edge.

func (*CategoryMutation) ResetTypes

func (m *CategoryMutation) ResetTypes()

ResetTypes resets all changes to the "types" field.

func (*CategoryMutation) SetConfig

func (m *CategoryMutation) SetConfig(sc *schematype.CategoryConfig)

SetConfig sets the "config" field.

func (*CategoryMutation) SetCount

func (m *CategoryMutation) SetCount(u uint64)

SetCount sets the "count" field.

func (*CategoryMutation) SetDuration

func (m *CategoryMutation) SetDuration(t time.Duration)

SetDuration sets the "duration" field.

func (*CategoryMutation) SetField

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

func (m *CategoryMutation) SetID(id int)

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

func (*CategoryMutation) SetOp

func (m *CategoryMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CategoryMutation) SetStatus

func (m *CategoryMutation) SetStatus(c category.Status)

SetStatus sets the "status" field.

func (*CategoryMutation) SetStrings

func (m *CategoryMutation) SetStrings(s []string)

SetStrings sets the "strings" field.

func (*CategoryMutation) SetText

func (m *CategoryMutation) SetText(s string)

SetText sets the "text" field.

func (*CategoryMutation) SetTypes

func (m *CategoryMutation) SetTypes(st *schematype.CategoryTypes)

SetTypes sets the "types" field.

func (*CategoryMutation) Status

func (m *CategoryMutation) Status() (r category.Status, exists bool)

Status returns the value of the "status" field in the mutation.

func (*CategoryMutation) Strings

func (m *CategoryMutation) Strings() (r []string, exists bool)

Strings returns the value of the "strings" field in the mutation.

func (*CategoryMutation) StringsCleared

func (m *CategoryMutation) StringsCleared() bool

StringsCleared returns if the "strings" field was cleared in this mutation.

func (*CategoryMutation) SubCategoriesCleared

func (m *CategoryMutation) SubCategoriesCleared() bool

SubCategoriesCleared reports if the "sub_categories" edge to the Category entity was cleared.

func (*CategoryMutation) SubCategoriesIDs

func (m *CategoryMutation) SubCategoriesIDs() (ids []int)

SubCategoriesIDs returns the "sub_categories" edge IDs in the mutation.

func (*CategoryMutation) Text

func (m *CategoryMutation) Text() (r string, exists bool)

Text returns the value of the "text" field in the mutation.

func (*CategoryMutation) TodosCleared

func (m *CategoryMutation) TodosCleared() bool

TodosCleared reports if the "todos" edge to the Todo entity was cleared.

func (*CategoryMutation) TodosIDs

func (m *CategoryMutation) TodosIDs() (ids []int)

TodosIDs returns the "todos" edge IDs in the mutation.

func (CategoryMutation) Tx

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

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

func (*CategoryMutation) Type

func (m *CategoryMutation) Type() string

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

func (*CategoryMutation) Types

func (m *CategoryMutation) Types() (r *schematype.CategoryTypes, exists bool)

Types returns the value of the "types" field in the mutation.

func (*CategoryMutation) TypesCleared

func (m *CategoryMutation) TypesCleared() bool

TypesCleared returns if the "types" field was cleared in this mutation.

func (*CategoryMutation) Where

func (m *CategoryMutation) Where(ps ...predicate.Category)

Where appends a list predicates to the CategoryMutation builder.

func (*CategoryMutation) WhereP

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

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

type CategoryOrder

type CategoryOrder struct {
	Direction OrderDirection      `json:"direction"`
	Field     *CategoryOrderField `json:"field"`
}

CategoryOrder defines the ordering of Category.

type CategoryOrderField

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

CategoryOrderField defines the ordering field of Category.

func (CategoryOrderField) MarshalGQL

func (f CategoryOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (CategoryOrderField) String

func (f CategoryOrderField) String() string

String implement fmt.Stringer interface.

func (*CategoryOrderField) UnmarshalGQL

func (f *CategoryOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type CategoryPaginateOption

type CategoryPaginateOption func(*categoryPager) error

CategoryPaginateOption enables pagination customization.

func WithCategoryFilter

func WithCategoryFilter(filter func(*CategoryQuery) (*CategoryQuery, error)) CategoryPaginateOption

WithCategoryFilter configures pagination filter.

func WithCategoryOrder

func WithCategoryOrder(order []*CategoryOrder) CategoryPaginateOption

WithCategoryOrder configures pagination ordering.

type CategoryQuery

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

CategoryQuery is the builder for querying Category entities.

func (*CategoryQuery) Aggregate

func (cq *CategoryQuery) Aggregate(fns ...AggregateFunc) *CategorySelect

Aggregate returns a CategorySelect configured with the given aggregations.

func (*CategoryQuery) All

func (cq *CategoryQuery) All(ctx context.Context) ([]*Category, error)

All executes the query and returns a list of Categories.

func (*CategoryQuery) AllX

func (cq *CategoryQuery) AllX(ctx context.Context) []*Category

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

func (*CategoryQuery) Clone

func (cq *CategoryQuery) Clone() *CategoryQuery

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

func (*CategoryQuery) CollectFields

func (c *CategoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*CategoryQuery, error)

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

func (*CategoryQuery) Count

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

Count returns the count of the given query.

func (*CategoryQuery) CountX

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

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

func (*CategoryQuery) Exist

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

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

func (*CategoryQuery) ExistX

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

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

func (*CategoryQuery) First

func (cq *CategoryQuery) First(ctx context.Context) (*Category, error)

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

func (*CategoryQuery) FirstID

func (cq *CategoryQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*CategoryQuery) FirstIDX

func (cq *CategoryQuery) FirstIDX(ctx context.Context) int

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

func (*CategoryQuery) FirstX

func (cq *CategoryQuery) FirstX(ctx context.Context) *Category

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

func (*CategoryQuery) GroupBy

func (cq *CategoryQuery) GroupBy(field string, fields ...string) *CategoryGroupBy

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 {
	Text string `json:"text,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Category.Query().
	GroupBy(category.FieldText).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CategoryQuery) IDs

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

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

func (*CategoryQuery) IDsX

func (cq *CategoryQuery) IDsX(ctx context.Context) []int

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

func (*CategoryQuery) Limit

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

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

func (*CategoryQuery) Modify

func (cq *CategoryQuery) Modify(modifiers ...func(s *sql.Selector)) *CategorySelect

Modify adds a query modifier for attaching custom logic to queries.

func (*CategoryQuery) Offset

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

Offset to start from.

func (*CategoryQuery) Only

func (cq *CategoryQuery) Only(ctx context.Context) (*Category, error)

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

func (*CategoryQuery) OnlyID

func (cq *CategoryQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*CategoryQuery) OnlyIDX

func (cq *CategoryQuery) OnlyIDX(ctx context.Context) int

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

func (*CategoryQuery) OnlyX

func (cq *CategoryQuery) OnlyX(ctx context.Context) *Category

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

func (*CategoryQuery) Order

Order specifies how the records should be ordered.

func (*CategoryQuery) Paginate

func (c *CategoryQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...CategoryPaginateOption,
) (*CategoryConnection, error)

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

func (*CategoryQuery) QuerySubCategories

func (cq *CategoryQuery) QuerySubCategories() *CategoryQuery

QuerySubCategories chains the current query on the "sub_categories" edge.

func (*CategoryQuery) QueryTodos

func (cq *CategoryQuery) QueryTodos() *TodoQuery

QueryTodos chains the current query on the "todos" edge.

func (*CategoryQuery) Select

func (cq *CategoryQuery) Select(fields ...string) *CategorySelect

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 {
	Text string `json:"text,omitempty"`
}

client.Category.Query().
	Select(category.FieldText).
	Scan(ctx, &v)

func (*CategoryQuery) Unique

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

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

func (cq *CategoryQuery) Where(ps ...predicate.Category) *CategoryQuery

Where adds a new predicate for the CategoryQuery builder.

func (*CategoryQuery) WithNamedSubCategories

func (cq *CategoryQuery) WithNamedSubCategories(name string, opts ...func(*CategoryQuery)) *CategoryQuery

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

func (*CategoryQuery) WithNamedTodos

func (cq *CategoryQuery) WithNamedTodos(name string, opts ...func(*TodoQuery)) *CategoryQuery

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

func (*CategoryQuery) WithSubCategories

func (cq *CategoryQuery) WithSubCategories(opts ...func(*CategoryQuery)) *CategoryQuery

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

func (*CategoryQuery) WithTodos

func (cq *CategoryQuery) WithTodos(opts ...func(*TodoQuery)) *CategoryQuery

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

type CategorySelect

type CategorySelect struct {
	*CategoryQuery
	// contains filtered or unexported fields
}

CategorySelect is the builder for selecting fields of Category entities.

func (*CategorySelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*CategorySelect) Bool

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

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

func (*CategorySelect) BoolX

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

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

func (*CategorySelect) Bools

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

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

func (*CategorySelect) BoolsX

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

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

func (*CategorySelect) Float64

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

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

func (*CategorySelect) Float64X

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

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

func (*CategorySelect) Float64s

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

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

func (*CategorySelect) Float64sX

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

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

func (*CategorySelect) Int

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

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

func (*CategorySelect) IntX

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

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

func (*CategorySelect) Ints

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

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

func (*CategorySelect) IntsX

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

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

func (*CategorySelect) Modify

func (cs *CategorySelect) Modify(modifiers ...func(s *sql.Selector)) *CategorySelect

Modify adds a query modifier for attaching custom logic to queries.

func (*CategorySelect) Scan

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

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

func (*CategorySelect) ScanX

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

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

func (*CategorySelect) String

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

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

func (*CategorySelect) StringX

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

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

func (*CategorySelect) Strings

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

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

func (*CategorySelect) StringsX

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

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

type CategoryUpdate

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

CategoryUpdate is the builder for updating Category entities.

func (*CategoryUpdate) AddCount

func (cu *CategoryUpdate) AddCount(u int64) *CategoryUpdate

AddCount adds u to the "count" field.

func (*CategoryUpdate) AddDuration

func (cu *CategoryUpdate) AddDuration(t time.Duration) *CategoryUpdate

AddDuration adds t to the "duration" field.

func (*CategoryUpdate) AddSubCategories

func (cu *CategoryUpdate) AddSubCategories(c ...*Category) *CategoryUpdate

AddSubCategories adds the "sub_categories" edges to the Category entity.

func (*CategoryUpdate) AddSubCategoryIDs

func (cu *CategoryUpdate) AddSubCategoryIDs(ids ...int) *CategoryUpdate

AddSubCategoryIDs adds the "sub_categories" edge to the Category entity by IDs.

func (*CategoryUpdate) AddTodoIDs

func (cu *CategoryUpdate) AddTodoIDs(ids ...int) *CategoryUpdate

AddTodoIDs adds the "todos" edge to the Todo entity by IDs.

func (*CategoryUpdate) AddTodos

func (cu *CategoryUpdate) AddTodos(t ...*Todo) *CategoryUpdate

AddTodos adds the "todos" edges to the Todo entity.

func (*CategoryUpdate) AppendStrings

func (cu *CategoryUpdate) AppendStrings(s []string) *CategoryUpdate

AppendStrings appends s to the "strings" field.

func (*CategoryUpdate) ClearConfig

func (cu *CategoryUpdate) ClearConfig() *CategoryUpdate

ClearConfig clears the value of the "config" field.

func (*CategoryUpdate) ClearCount

func (cu *CategoryUpdate) ClearCount() *CategoryUpdate

ClearCount clears the value of the "count" field.

func (*CategoryUpdate) ClearDuration

func (cu *CategoryUpdate) ClearDuration() *CategoryUpdate

ClearDuration clears the value of the "duration" field.

func (*CategoryUpdate) ClearStrings

func (cu *CategoryUpdate) ClearStrings() *CategoryUpdate

ClearStrings clears the value of the "strings" field.

func (*CategoryUpdate) ClearSubCategories

func (cu *CategoryUpdate) ClearSubCategories() *CategoryUpdate

ClearSubCategories clears all "sub_categories" edges to the Category entity.

func (*CategoryUpdate) ClearTodos

func (cu *CategoryUpdate) ClearTodos() *CategoryUpdate

ClearTodos clears all "todos" edges to the Todo entity.

func (*CategoryUpdate) ClearTypes

func (cu *CategoryUpdate) ClearTypes() *CategoryUpdate

ClearTypes clears the value of the "types" field.

func (*CategoryUpdate) Exec

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

Exec executes the query.

func (*CategoryUpdate) ExecX

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

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

func (*CategoryUpdate) Modify

func (cu *CategoryUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *CategoryUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*CategoryUpdate) Mutation

func (cu *CategoryUpdate) Mutation() *CategoryMutation

Mutation returns the CategoryMutation object of the builder.

func (*CategoryUpdate) RemoveSubCategories

func (cu *CategoryUpdate) RemoveSubCategories(c ...*Category) *CategoryUpdate

RemoveSubCategories removes "sub_categories" edges to Category entities.

func (*CategoryUpdate) RemoveSubCategoryIDs

func (cu *CategoryUpdate) RemoveSubCategoryIDs(ids ...int) *CategoryUpdate

RemoveSubCategoryIDs removes the "sub_categories" edge to Category entities by IDs.

func (*CategoryUpdate) RemoveTodoIDs

func (cu *CategoryUpdate) RemoveTodoIDs(ids ...int) *CategoryUpdate

RemoveTodoIDs removes the "todos" edge to Todo entities by IDs.

func (*CategoryUpdate) RemoveTodos

func (cu *CategoryUpdate) RemoveTodos(t ...*Todo) *CategoryUpdate

RemoveTodos removes "todos" edges to Todo entities.

func (*CategoryUpdate) Save

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

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

func (*CategoryUpdate) SaveX

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

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

func (*CategoryUpdate) SetConfig

SetConfig sets the "config" field.

func (*CategoryUpdate) SetCount

func (cu *CategoryUpdate) SetCount(u uint64) *CategoryUpdate

SetCount sets the "count" field.

func (*CategoryUpdate) SetDuration

func (cu *CategoryUpdate) SetDuration(t time.Duration) *CategoryUpdate

SetDuration sets the "duration" field.

func (*CategoryUpdate) SetInput

SetInput applies the change-set in the UpdateCategoryInput on the CategoryUpdate builder.

func (*CategoryUpdate) SetNillableCount

func (cu *CategoryUpdate) SetNillableCount(u *uint64) *CategoryUpdate

SetNillableCount sets the "count" field if the given value is not nil.

func (*CategoryUpdate) SetNillableDuration

func (cu *CategoryUpdate) SetNillableDuration(t *time.Duration) *CategoryUpdate

SetNillableDuration sets the "duration" field if the given value is not nil.

func (*CategoryUpdate) SetNillableStatus

func (cu *CategoryUpdate) SetNillableStatus(c *category.Status) *CategoryUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*CategoryUpdate) SetNillableText

func (cu *CategoryUpdate) SetNillableText(s *string) *CategoryUpdate

SetNillableText sets the "text" field if the given value is not nil.

func (*CategoryUpdate) SetStatus

func (cu *CategoryUpdate) SetStatus(c category.Status) *CategoryUpdate

SetStatus sets the "status" field.

func (*CategoryUpdate) SetStrings

func (cu *CategoryUpdate) SetStrings(s []string) *CategoryUpdate

SetStrings sets the "strings" field.

func (*CategoryUpdate) SetText

func (cu *CategoryUpdate) SetText(s string) *CategoryUpdate

SetText sets the "text" field.

func (*CategoryUpdate) SetTypes

SetTypes sets the "types" field.

func (*CategoryUpdate) Where

func (cu *CategoryUpdate) Where(ps ...predicate.Category) *CategoryUpdate

Where appends a list predicates to the CategoryUpdate builder.

type CategoryUpdateOne

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

CategoryUpdateOne is the builder for updating a single Category entity.

func (*CategoryUpdateOne) AddCount

func (cuo *CategoryUpdateOne) AddCount(u int64) *CategoryUpdateOne

AddCount adds u to the "count" field.

func (*CategoryUpdateOne) AddDuration

func (cuo *CategoryUpdateOne) AddDuration(t time.Duration) *CategoryUpdateOne

AddDuration adds t to the "duration" field.

func (*CategoryUpdateOne) AddSubCategories

func (cuo *CategoryUpdateOne) AddSubCategories(c ...*Category) *CategoryUpdateOne

AddSubCategories adds the "sub_categories" edges to the Category entity.

func (*CategoryUpdateOne) AddSubCategoryIDs

func (cuo *CategoryUpdateOne) AddSubCategoryIDs(ids ...int) *CategoryUpdateOne

AddSubCategoryIDs adds the "sub_categories" edge to the Category entity by IDs.

func (*CategoryUpdateOne) AddTodoIDs

func (cuo *CategoryUpdateOne) AddTodoIDs(ids ...int) *CategoryUpdateOne

AddTodoIDs adds the "todos" edge to the Todo entity by IDs.

func (*CategoryUpdateOne) AddTodos

func (cuo *CategoryUpdateOne) AddTodos(t ...*Todo) *CategoryUpdateOne

AddTodos adds the "todos" edges to the Todo entity.

func (*CategoryUpdateOne) AppendStrings

func (cuo *CategoryUpdateOne) AppendStrings(s []string) *CategoryUpdateOne

AppendStrings appends s to the "strings" field.

func (*CategoryUpdateOne) ClearConfig

func (cuo *CategoryUpdateOne) ClearConfig() *CategoryUpdateOne

ClearConfig clears the value of the "config" field.

func (*CategoryUpdateOne) ClearCount

func (cuo *CategoryUpdateOne) ClearCount() *CategoryUpdateOne

ClearCount clears the value of the "count" field.

func (*CategoryUpdateOne) ClearDuration

func (cuo *CategoryUpdateOne) ClearDuration() *CategoryUpdateOne

ClearDuration clears the value of the "duration" field.

func (*CategoryUpdateOne) ClearStrings

func (cuo *CategoryUpdateOne) ClearStrings() *CategoryUpdateOne

ClearStrings clears the value of the "strings" field.

func (*CategoryUpdateOne) ClearSubCategories

func (cuo *CategoryUpdateOne) ClearSubCategories() *CategoryUpdateOne

ClearSubCategories clears all "sub_categories" edges to the Category entity.

func (*CategoryUpdateOne) ClearTodos

func (cuo *CategoryUpdateOne) ClearTodos() *CategoryUpdateOne

ClearTodos clears all "todos" edges to the Todo entity.

func (*CategoryUpdateOne) ClearTypes

func (cuo *CategoryUpdateOne) ClearTypes() *CategoryUpdateOne

ClearTypes clears the value of the "types" field.

func (*CategoryUpdateOne) Exec

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

Exec executes the query on the entity.

func (*CategoryUpdateOne) ExecX

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

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

func (*CategoryUpdateOne) Modify

func (cuo *CategoryUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *CategoryUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*CategoryUpdateOne) Mutation

func (cuo *CategoryUpdateOne) Mutation() *CategoryMutation

Mutation returns the CategoryMutation object of the builder.

func (*CategoryUpdateOne) RemoveSubCategories

func (cuo *CategoryUpdateOne) RemoveSubCategories(c ...*Category) *CategoryUpdateOne

RemoveSubCategories removes "sub_categories" edges to Category entities.

func (*CategoryUpdateOne) RemoveSubCategoryIDs

func (cuo *CategoryUpdateOne) RemoveSubCategoryIDs(ids ...int) *CategoryUpdateOne

RemoveSubCategoryIDs removes the "sub_categories" edge to Category entities by IDs.

func (*CategoryUpdateOne) RemoveTodoIDs

func (cuo *CategoryUpdateOne) RemoveTodoIDs(ids ...int) *CategoryUpdateOne

RemoveTodoIDs removes the "todos" edge to Todo entities by IDs.

func (*CategoryUpdateOne) RemoveTodos

func (cuo *CategoryUpdateOne) RemoveTodos(t ...*Todo) *CategoryUpdateOne

RemoveTodos removes "todos" edges to Todo entities.

func (*CategoryUpdateOne) Save

func (cuo *CategoryUpdateOne) Save(ctx context.Context) (*Category, error)

Save executes the query and returns the updated Category entity.

func (*CategoryUpdateOne) SaveX

func (cuo *CategoryUpdateOne) SaveX(ctx context.Context) *Category

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

func (*CategoryUpdateOne) Select

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

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

func (*CategoryUpdateOne) SetConfig

SetConfig sets the "config" field.

func (*CategoryUpdateOne) SetCount

func (cuo *CategoryUpdateOne) SetCount(u uint64) *CategoryUpdateOne

SetCount sets the "count" field.

func (*CategoryUpdateOne) SetDuration

func (cuo *CategoryUpdateOne) SetDuration(t time.Duration) *CategoryUpdateOne

SetDuration sets the "duration" field.

func (*CategoryUpdateOne) SetInput

SetInput applies the change-set in the UpdateCategoryInput on the CategoryUpdateOne builder.

func (*CategoryUpdateOne) SetNillableCount

func (cuo *CategoryUpdateOne) SetNillableCount(u *uint64) *CategoryUpdateOne

SetNillableCount sets the "count" field if the given value is not nil.

func (*CategoryUpdateOne) SetNillableDuration

func (cuo *CategoryUpdateOne) SetNillableDuration(t *time.Duration) *CategoryUpdateOne

SetNillableDuration sets the "duration" field if the given value is not nil.

func (*CategoryUpdateOne) SetNillableStatus

func (cuo *CategoryUpdateOne) SetNillableStatus(c *category.Status) *CategoryUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*CategoryUpdateOne) SetNillableText

func (cuo *CategoryUpdateOne) SetNillableText(s *string) *CategoryUpdateOne

SetNillableText sets the "text" field if the given value is not nil.

func (*CategoryUpdateOne) SetStatus

SetStatus sets the "status" field.

func (*CategoryUpdateOne) SetStrings

func (cuo *CategoryUpdateOne) SetStrings(s []string) *CategoryUpdateOne

SetStrings sets the "strings" field.

func (*CategoryUpdateOne) SetText

func (cuo *CategoryUpdateOne) SetText(s string) *CategoryUpdateOne

SetText sets the "text" field.

func (*CategoryUpdateOne) SetTypes

SetTypes sets the "types" field.

func (*CategoryUpdateOne) Where

Where appends a list predicates to the CategoryUpdate builder.

type CategoryWhereInput

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

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

	// "text" field predicates.
	Text             *string  `json:"text,omitempty"`
	TextNEQ          *string  `json:"textNEQ,omitempty"`
	TextIn           []string `json:"textIn,omitempty"`
	TextNotIn        []string `json:"textNotIn,omitempty"`
	TextGT           *string  `json:"textGT,omitempty"`
	TextGTE          *string  `json:"textGTE,omitempty"`
	TextLT           *string  `json:"textLT,omitempty"`
	TextLTE          *string  `json:"textLTE,omitempty"`
	TextContains     *string  `json:"textContains,omitempty"`
	TextHasPrefix    *string  `json:"textHasPrefix,omitempty"`
	TextHasSuffix    *string  `json:"textHasSuffix,omitempty"`
	TextEqualFold    *string  `json:"textEqualFold,omitempty"`
	TextContainsFold *string  `json:"textContainsFold,omitempty"`

	// "status" field predicates.
	Status      *category.Status  `json:"status,omitempty"`
	StatusNEQ   *category.Status  `json:"statusNEQ,omitempty"`
	StatusIn    []category.Status `json:"statusIn,omitempty"`
	StatusNotIn []category.Status `json:"statusNotIn,omitempty"`

	// "config" field predicates.
	Config       *schematype.CategoryConfig   `json:"config,omitempty"`
	ConfigNEQ    *schematype.CategoryConfig   `json:"configNEQ,omitempty"`
	ConfigIn     []*schematype.CategoryConfig `json:"configIn,omitempty"`
	ConfigNotIn  []*schematype.CategoryConfig `json:"configNotIn,omitempty"`
	ConfigGT     *schematype.CategoryConfig   `json:"configGT,omitempty"`
	ConfigGTE    *schematype.CategoryConfig   `json:"configGTE,omitempty"`
	ConfigLT     *schematype.CategoryConfig   `json:"configLT,omitempty"`
	ConfigLTE    *schematype.CategoryConfig   `json:"configLTE,omitempty"`
	ConfigIsNil  bool                         `json:"configIsNil,omitempty"`
	ConfigNotNil bool                         `json:"configNotNil,omitempty"`

	// "duration" field predicates.
	Duration       *time.Duration  `json:"duration,omitempty"`
	DurationNEQ    *time.Duration  `json:"durationNEQ,omitempty"`
	DurationIn     []time.Duration `json:"durationIn,omitempty"`
	DurationNotIn  []time.Duration `json:"durationNotIn,omitempty"`
	DurationGT     *time.Duration  `json:"durationGT,omitempty"`
	DurationGTE    *time.Duration  `json:"durationGTE,omitempty"`
	DurationLT     *time.Duration  `json:"durationLT,omitempty"`
	DurationLTE    *time.Duration  `json:"durationLTE,omitempty"`
	DurationIsNil  bool            `json:"durationIsNil,omitempty"`
	DurationNotNil bool            `json:"durationNotNil,omitempty"`

	// "count" field predicates.
	Count       *uint64  `json:"count,omitempty"`
	CountNEQ    *uint64  `json:"countNEQ,omitempty"`
	CountIn     []uint64 `json:"countIn,omitempty"`
	CountNotIn  []uint64 `json:"countNotIn,omitempty"`
	CountGT     *uint64  `json:"countGT,omitempty"`
	CountGTE    *uint64  `json:"countGTE,omitempty"`
	CountLT     *uint64  `json:"countLT,omitempty"`
	CountLTE    *uint64  `json:"countLTE,omitempty"`
	CountIsNil  bool     `json:"countIsNil,omitempty"`
	CountNotNil bool     `json:"countNotNil,omitempty"`

	// "todos" edge predicates.
	HasTodos     *bool             `json:"hasTodos,omitempty"`
	HasTodosWith []*TodoWhereInput `json:"hasTodosWith,omitempty"`

	// "sub_categories" edge predicates.
	HasSubCategories     *bool                 `json:"hasSubCategories,omitempty"`
	HasSubCategoriesWith []*CategoryWhereInput `json:"hasSubCategoriesWith,omitempty"`
}

CategoryWhereInput represents a where input for filtering Category queries.

func (*CategoryWhereInput) AddPredicates

func (i *CategoryWhereInput) AddPredicates(predicates ...predicate.Category)

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

func (*CategoryWhereInput) Filter

Filter applies the CategoryWhereInput filter on the CategoryQuery builder.

func (*CategoryWhereInput) P

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// BillProduct is the client for interacting with the BillProduct builders.
	BillProduct *BillProductClient
	// Category is the client for interacting with the Category builders.
	Category *CategoryClient
	// Friendship is the client for interacting with the Friendship builders.
	Friendship *FriendshipClient
	// Group is the client for interacting with the Group builders.
	Group *GroupClient
	// OneToMany is the client for interacting with the OneToMany builders.
	OneToMany *OneToManyClient
	// Project is the client for interacting with the Project builders.
	Project *ProjectClient
	// Todo is the client for interacting with the Todo builders.
	Todo *TodoClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// VerySecret is the client for interacting with the VerySecret builders.
	VerySecret *VerySecretClient
	// Workspace is the client for interacting with the Workspace builders.
	Workspace *WorkspaceClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

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

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

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

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

func (*Client) BeginTx

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

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

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

func (*Client) Debug

func (c *Client) Debug() *Client

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

client.Debug().
	BillProduct.
	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 int) (*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 int, 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 []int, 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 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 CreateCategoryInput

type CreateCategoryInput struct {
	Text           string
	Status         category.Status
	Config         *schematype.CategoryConfig
	Types          *schematype.CategoryTypes
	Duration       *time.Duration
	Count          *uint64
	Strings        []string
	TodoIDs        []int
	SubCategoryIDs []int
}

CreateCategoryInput represents a mutation input for creating categories.

func (*CreateCategoryInput) Mutate

func (i *CreateCategoryInput) Mutate(m *CategoryMutation)

Mutate applies the CreateCategoryInput on the CategoryMutation builder.

type CreateTodoInput

type CreateTodoInput struct {
	Status     todo.Status
	Priority   *int
	Text       string
	Init       map[string]interface{}
	ParentID   *int
	ChildIDs   []int
	CategoryID *int
	SecretID   *int
}

CreateTodoInput represents a mutation input for creating todos.

func (*CreateTodoInput) Mutate

func (i *CreateTodoInput) Mutate(m *TodoMutation)

Mutate applies the CreateTodoInput on the TodoMutation builder.

type CreateUserInput

type CreateUserInput struct {
	Name             *string
	Username         *uuid.UUID
	Password         *string
	RequiredMetadata map[string]interface{}
	Metadata         map[string]interface{}
	GroupIDs         []int
	FriendIDs        []int
}

CreateUserInput represents a mutation input for creating users.

func (*CreateUserInput) Mutate

func (i *CreateUserInput) Mutate(m *UserMutation)

Mutate applies the CreateUserInput on the UserMutation builder.

type Cursor

type Cursor = entgql.Cursor[int]

Common entgql types.

type Edge

type Edge struct {
	Type string `json:"type,omitempty"` // edge type.
	Name string `json:"name,omitempty"` // edge name.
	IDs  []int  `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 Friendship

type Friendship struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID int `json:"user_id,omitempty"`
	// FriendID holds the value of the "friend_id" field.
	FriendID int `json:"friend_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the FriendshipQuery when eager-loading is set.
	Edges FriendshipEdges `json:"edges"`
	// contains filtered or unexported fields
}

Friendship is the model entity for the Friendship schema.

func (*Friendship) Friend

func (f *Friendship) Friend(ctx context.Context) (*User, error)

func (*Friendship) IsNode

func (*Friendship) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*Friendship) Node

func (f *Friendship) Node(ctx context.Context) (node *Node, err error)

Node implements Noder interface

func (*Friendship) QueryFriend

func (f *Friendship) QueryFriend() *UserQuery

QueryFriend queries the "friend" edge of the Friendship entity.

func (*Friendship) QueryUser

func (f *Friendship) QueryUser() *UserQuery

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

func (*Friendship) String

func (f *Friendship) String() string

String implements the fmt.Stringer.

func (*Friendship) ToEdge

func (f *Friendship) ToEdge(order *FriendshipOrder) *FriendshipEdge

ToEdge converts Friendship into FriendshipEdge.

func (*Friendship) Unwrap

func (f *Friendship) Unwrap() *Friendship

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

func (f *Friendship) Update() *FriendshipUpdateOne

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

func (*Friendship) User

func (f *Friendship) User(ctx context.Context) (*User, error)

func (*Friendship) Value

func (f *Friendship) Value(name string) (ent.Value, error)

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

type FriendshipClient

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

FriendshipClient is a client for the Friendship schema.

func NewFriendshipClient

func NewFriendshipClient(c config) *FriendshipClient

NewFriendshipClient returns a client for the Friendship from the given config.

func (*FriendshipClient) Create

func (c *FriendshipClient) Create() *FriendshipCreate

Create returns a builder for creating a Friendship entity.

func (*FriendshipClient) CreateBulk

func (c *FriendshipClient) CreateBulk(builders ...*FriendshipCreate) *FriendshipCreateBulk

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

func (*FriendshipClient) Delete

func (c *FriendshipClient) Delete() *FriendshipDelete

Delete returns a delete builder for Friendship.

func (*FriendshipClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*FriendshipClient) DeleteOneID

func (c *FriendshipClient) DeleteOneID(id int) *FriendshipDeleteOne

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

func (*FriendshipClient) Get

func (c *FriendshipClient) Get(ctx context.Context, id int) (*Friendship, error)

Get returns a Friendship entity by its id.

func (*FriendshipClient) GetX

func (c *FriendshipClient) GetX(ctx context.Context, id int) *Friendship

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

func (*FriendshipClient) Hooks

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

Hooks returns the client hooks.

func (*FriendshipClient) Intercept

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

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

func (*FriendshipClient) Interceptors

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

Interceptors returns the client interceptors.

func (*FriendshipClient) MapCreateBulk

func (c *FriendshipClient) MapCreateBulk(slice any, setFunc func(*FriendshipCreate, int)) *FriendshipCreateBulk

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

func (*FriendshipClient) Query

func (c *FriendshipClient) Query() *FriendshipQuery

Query returns a query builder for Friendship.

func (*FriendshipClient) QueryFriend

func (c *FriendshipClient) QueryFriend(f *Friendship) *UserQuery

QueryFriend queries the friend edge of a Friendship.

func (*FriendshipClient) QueryUser

func (c *FriendshipClient) QueryUser(f *Friendship) *UserQuery

QueryUser queries the user edge of a Friendship.

func (*FriendshipClient) Update

func (c *FriendshipClient) Update() *FriendshipUpdate

Update returns an update builder for Friendship.

func (*FriendshipClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*FriendshipClient) UpdateOneID

func (c *FriendshipClient) UpdateOneID(id int) *FriendshipUpdateOne

UpdateOneID returns an update builder for the given id.

func (*FriendshipClient) Use

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

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

type FriendshipConnection

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

FriendshipConnection is the connection containing edges to Friendship.

type FriendshipCreate

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

FriendshipCreate is the builder for creating a Friendship entity.

func (*FriendshipCreate) Exec

func (fc *FriendshipCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*FriendshipCreate) ExecX

func (fc *FriendshipCreate) ExecX(ctx context.Context)

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

func (*FriendshipCreate) Mutation

func (fc *FriendshipCreate) Mutation() *FriendshipMutation

Mutation returns the FriendshipMutation object of the builder.

func (*FriendshipCreate) Save

func (fc *FriendshipCreate) Save(ctx context.Context) (*Friendship, error)

Save creates the Friendship in the database.

func (*FriendshipCreate) SaveX

func (fc *FriendshipCreate) SaveX(ctx context.Context) *Friendship

SaveX calls Save and panics if Save returns an error.

func (*FriendshipCreate) SetCreatedAt

func (fc *FriendshipCreate) SetCreatedAt(t time.Time) *FriendshipCreate

SetCreatedAt sets the "created_at" field.

func (*FriendshipCreate) SetFriend

func (fc *FriendshipCreate) SetFriend(u *User) *FriendshipCreate

SetFriend sets the "friend" edge to the User entity.

func (*FriendshipCreate) SetFriendID

func (fc *FriendshipCreate) SetFriendID(i int) *FriendshipCreate

SetFriendID sets the "friend_id" field.

func (*FriendshipCreate) SetNillableCreatedAt

func (fc *FriendshipCreate) SetNillableCreatedAt(t *time.Time) *FriendshipCreate

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

func (*FriendshipCreate) SetUser

func (fc *FriendshipCreate) SetUser(u *User) *FriendshipCreate

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

func (*FriendshipCreate) SetUserID

func (fc *FriendshipCreate) SetUserID(i int) *FriendshipCreate

SetUserID sets the "user_id" field.

type FriendshipCreateBulk

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

FriendshipCreateBulk is the builder for creating many Friendship entities in bulk.

func (*FriendshipCreateBulk) Exec

func (fcb *FriendshipCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*FriendshipCreateBulk) ExecX

func (fcb *FriendshipCreateBulk) ExecX(ctx context.Context)

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

func (*FriendshipCreateBulk) Save

func (fcb *FriendshipCreateBulk) Save(ctx context.Context) ([]*Friendship, error)

Save creates the Friendship entities in the database.

func (*FriendshipCreateBulk) SaveX

func (fcb *FriendshipCreateBulk) SaveX(ctx context.Context) []*Friendship

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

type FriendshipDelete

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

FriendshipDelete is the builder for deleting a Friendship entity.

func (*FriendshipDelete) Exec

func (fd *FriendshipDelete) Exec(ctx context.Context) (int, error)

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

func (*FriendshipDelete) ExecX

func (fd *FriendshipDelete) ExecX(ctx context.Context) int

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

func (*FriendshipDelete) Where

Where appends a list predicates to the FriendshipDelete builder.

type FriendshipDeleteOne

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

FriendshipDeleteOne is the builder for deleting a single Friendship entity.

func (*FriendshipDeleteOne) Exec

func (fdo *FriendshipDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*FriendshipDeleteOne) ExecX

func (fdo *FriendshipDeleteOne) ExecX(ctx context.Context)

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

func (*FriendshipDeleteOne) Where

Where appends a list predicates to the FriendshipDelete builder.

type FriendshipEdge

type FriendshipEdge struct {
	Node   *Friendship `json:"node"`
	Cursor Cursor      `json:"cursor"`
}

FriendshipEdge is the edge representation of Friendship.

type FriendshipEdges

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

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

func (FriendshipEdges) FriendOrErr

func (e FriendshipEdges) FriendOrErr() (*User, error)

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

func (FriendshipEdges) UserOrErr

func (e FriendshipEdges) 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 FriendshipGroupBy

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

FriendshipGroupBy is the group-by builder for Friendship entities.

func (*FriendshipGroupBy) Aggregate

func (fgb *FriendshipGroupBy) Aggregate(fns ...AggregateFunc) *FriendshipGroupBy

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

func (*FriendshipGroupBy) Bool

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

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

func (*FriendshipGroupBy) BoolX

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

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

func (*FriendshipGroupBy) Bools

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

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

func (*FriendshipGroupBy) BoolsX

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

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

func (*FriendshipGroupBy) Float64

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

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

func (*FriendshipGroupBy) Float64X

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

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

func (*FriendshipGroupBy) Float64s

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

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

func (*FriendshipGroupBy) Float64sX

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

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

func (*FriendshipGroupBy) Int

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

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

func (*FriendshipGroupBy) IntX

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

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

func (*FriendshipGroupBy) Ints

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

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

func (*FriendshipGroupBy) IntsX

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

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

func (*FriendshipGroupBy) Scan

func (fgb *FriendshipGroupBy) Scan(ctx context.Context, v any) error

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

func (*FriendshipGroupBy) ScanX

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

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

func (*FriendshipGroupBy) String

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

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

func (*FriendshipGroupBy) StringX

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

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

func (*FriendshipGroupBy) Strings

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

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

func (*FriendshipGroupBy) StringsX

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

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

type FriendshipMutation

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

FriendshipMutation represents an operation that mutates the Friendship nodes in the graph.

func (*FriendshipMutation) AddField

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

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

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

func (*FriendshipMutation) AddedField

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

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

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

func (*FriendshipMutation) AddedIDs

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

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

func (*FriendshipMutation) ClearEdge

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

func (m *FriendshipMutation) 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 (*FriendshipMutation) ClearFriend

func (m *FriendshipMutation) ClearFriend()

ClearFriend clears the "friend" edge to the User entity.

func (*FriendshipMutation) ClearUser

func (m *FriendshipMutation) ClearUser()

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

func (*FriendshipMutation) ClearedEdges

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

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

func (*FriendshipMutation) ClearedFields

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

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

func (FriendshipMutation) Client

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

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

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

func (*FriendshipMutation) EdgeCleared

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

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

func (*FriendshipMutation) Field

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

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

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

func (*FriendshipMutation) Fields

func (m *FriendshipMutation) 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 (*FriendshipMutation) FriendCleared

func (m *FriendshipMutation) FriendCleared() bool

FriendCleared reports if the "friend" edge to the User entity was cleared.

func (*FriendshipMutation) FriendID

func (m *FriendshipMutation) FriendID() (r int, exists bool)

FriendID returns the value of the "friend_id" field in the mutation.

func (*FriendshipMutation) FriendIDs

func (m *FriendshipMutation) FriendIDs() (ids []int)

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

func (*FriendshipMutation) ID

func (m *FriendshipMutation) ID() (id int, exists bool)

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

func (*FriendshipMutation) IDs

func (m *FriendshipMutation) IDs(ctx context.Context) ([]int, error)

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

func (*FriendshipMutation) OldCreatedAt

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

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

func (m *FriendshipMutation) 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 (*FriendshipMutation) OldFriendID

func (m *FriendshipMutation) OldFriendID(ctx context.Context) (v int, err error)

OldFriendID returns the old "friend_id" field's value of the Friendship entity. If the Friendship 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 (*FriendshipMutation) OldUserID

func (m *FriendshipMutation) OldUserID(ctx context.Context) (v int, err error)

OldUserID returns the old "user_id" field's value of the Friendship entity. If the Friendship 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 (*FriendshipMutation) Op

func (m *FriendshipMutation) Op() Op

Op returns the operation name.

func (*FriendshipMutation) RemovedEdges

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

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

func (*FriendshipMutation) RemovedIDs

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

func (m *FriendshipMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*FriendshipMutation) ResetEdge

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

func (m *FriendshipMutation) 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 (*FriendshipMutation) ResetFriend

func (m *FriendshipMutation) ResetFriend()

ResetFriend resets all changes to the "friend" edge.

func (*FriendshipMutation) ResetFriendID

func (m *FriendshipMutation) ResetFriendID()

ResetFriendID resets all changes to the "friend_id" field.

func (*FriendshipMutation) ResetUser

func (m *FriendshipMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*FriendshipMutation) ResetUserID

func (m *FriendshipMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*FriendshipMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*FriendshipMutation) SetField

func (m *FriendshipMutation) 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 (*FriendshipMutation) SetFriendID

func (m *FriendshipMutation) SetFriendID(i int)

SetFriendID sets the "friend_id" field.

func (*FriendshipMutation) SetOp

func (m *FriendshipMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*FriendshipMutation) SetUserID

func (m *FriendshipMutation) SetUserID(i int)

SetUserID sets the "user_id" field.

func (FriendshipMutation) Tx

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

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

func (*FriendshipMutation) Type

func (m *FriendshipMutation) Type() string

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

func (*FriendshipMutation) UserCleared

func (m *FriendshipMutation) UserCleared() bool

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

func (*FriendshipMutation) UserID

func (m *FriendshipMutation) UserID() (r int, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*FriendshipMutation) UserIDs

func (m *FriendshipMutation) UserIDs() (ids []int)

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

func (*FriendshipMutation) Where

func (m *FriendshipMutation) Where(ps ...predicate.Friendship)

Where appends a list predicates to the FriendshipMutation builder.

func (*FriendshipMutation) WhereP

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

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

type FriendshipOrder

type FriendshipOrder struct {
	Direction OrderDirection        `json:"direction"`
	Field     *FriendshipOrderField `json:"field"`
}

FriendshipOrder defines the ordering of Friendship.

type FriendshipOrderField

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

FriendshipOrderField defines the ordering field of Friendship.

type FriendshipPaginateOption

type FriendshipPaginateOption func(*friendshipPager) error

FriendshipPaginateOption enables pagination customization.

func WithFriendshipFilter

func WithFriendshipFilter(filter func(*FriendshipQuery) (*FriendshipQuery, error)) FriendshipPaginateOption

WithFriendshipFilter configures pagination filter.

func WithFriendshipOrder

func WithFriendshipOrder(order *FriendshipOrder) FriendshipPaginateOption

WithFriendshipOrder configures pagination ordering.

type FriendshipQuery

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

FriendshipQuery is the builder for querying Friendship entities.

func (*FriendshipQuery) Aggregate

func (fq *FriendshipQuery) Aggregate(fns ...AggregateFunc) *FriendshipSelect

Aggregate returns a FriendshipSelect configured with the given aggregations.

func (*FriendshipQuery) All

func (fq *FriendshipQuery) All(ctx context.Context) ([]*Friendship, error)

All executes the query and returns a list of Friendships.

func (*FriendshipQuery) AllX

func (fq *FriendshipQuery) AllX(ctx context.Context) []*Friendship

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

func (*FriendshipQuery) Clone

func (fq *FriendshipQuery) Clone() *FriendshipQuery

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

func (*FriendshipQuery) CollectFields

func (f *FriendshipQuery) CollectFields(ctx context.Context, satisfies ...string) (*FriendshipQuery, error)

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

func (*FriendshipQuery) Count

func (fq *FriendshipQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*FriendshipQuery) CountX

func (fq *FriendshipQuery) CountX(ctx context.Context) int

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

func (*FriendshipQuery) Exist

func (fq *FriendshipQuery) Exist(ctx context.Context) (bool, error)

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

func (*FriendshipQuery) ExistX

func (fq *FriendshipQuery) ExistX(ctx context.Context) bool

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

func (*FriendshipQuery) First

func (fq *FriendshipQuery) First(ctx context.Context) (*Friendship, error)

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

func (*FriendshipQuery) FirstID

func (fq *FriendshipQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*FriendshipQuery) FirstIDX

func (fq *FriendshipQuery) FirstIDX(ctx context.Context) int

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

func (*FriendshipQuery) FirstX

func (fq *FriendshipQuery) FirstX(ctx context.Context) *Friendship

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

func (*FriendshipQuery) GroupBy

func (fq *FriendshipQuery) GroupBy(field string, fields ...string) *FriendshipGroupBy

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.Friendship.Query().
	GroupBy(friendship.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*FriendshipQuery) IDs

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

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

func (*FriendshipQuery) IDsX

func (fq *FriendshipQuery) IDsX(ctx context.Context) []int

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

func (*FriendshipQuery) Limit

func (fq *FriendshipQuery) Limit(limit int) *FriendshipQuery

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

func (*FriendshipQuery) Modify

func (fq *FriendshipQuery) Modify(modifiers ...func(s *sql.Selector)) *FriendshipSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*FriendshipQuery) Offset

func (fq *FriendshipQuery) Offset(offset int) *FriendshipQuery

Offset to start from.

func (*FriendshipQuery) Only

func (fq *FriendshipQuery) Only(ctx context.Context) (*Friendship, error)

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

func (*FriendshipQuery) OnlyID

func (fq *FriendshipQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*FriendshipQuery) OnlyIDX

func (fq *FriendshipQuery) OnlyIDX(ctx context.Context) int

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

func (*FriendshipQuery) OnlyX

func (fq *FriendshipQuery) OnlyX(ctx context.Context) *Friendship

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

func (*FriendshipQuery) Order

Order specifies how the records should be ordered.

func (*FriendshipQuery) Paginate

func (f *FriendshipQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...FriendshipPaginateOption,
) (*FriendshipConnection, error)

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

func (*FriendshipQuery) QueryFriend

func (fq *FriendshipQuery) QueryFriend() *UserQuery

QueryFriend chains the current query on the "friend" edge.

func (*FriendshipQuery) QueryUser

func (fq *FriendshipQuery) QueryUser() *UserQuery

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

func (*FriendshipQuery) Select

func (fq *FriendshipQuery) Select(fields ...string) *FriendshipSelect

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.Friendship.Query().
	Select(friendship.FieldCreatedAt).
	Scan(ctx, &v)

func (*FriendshipQuery) Unique

func (fq *FriendshipQuery) Unique(unique bool) *FriendshipQuery

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

Where adds a new predicate for the FriendshipQuery builder.

func (*FriendshipQuery) WithFriend

func (fq *FriendshipQuery) WithFriend(opts ...func(*UserQuery)) *FriendshipQuery

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

func (*FriendshipQuery) WithUser

func (fq *FriendshipQuery) WithUser(opts ...func(*UserQuery)) *FriendshipQuery

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 FriendshipSelect

type FriendshipSelect struct {
	*FriendshipQuery
	// contains filtered or unexported fields
}

FriendshipSelect is the builder for selecting fields of Friendship entities.

func (*FriendshipSelect) Aggregate

func (fs *FriendshipSelect) Aggregate(fns ...AggregateFunc) *FriendshipSelect

Aggregate adds the given aggregation functions to the selector query.

func (*FriendshipSelect) Bool

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

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

func (*FriendshipSelect) BoolX

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

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

func (*FriendshipSelect) Bools

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

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

func (*FriendshipSelect) BoolsX

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

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

func (*FriendshipSelect) Float64

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

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

func (*FriendshipSelect) Float64X

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

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

func (*FriendshipSelect) Float64s

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

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

func (*FriendshipSelect) Float64sX

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

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

func (*FriendshipSelect) Int

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

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

func (*FriendshipSelect) IntX

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

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

func (*FriendshipSelect) Ints

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

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

func (*FriendshipSelect) IntsX

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

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

func (*FriendshipSelect) Modify

func (fs *FriendshipSelect) Modify(modifiers ...func(s *sql.Selector)) *FriendshipSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*FriendshipSelect) Scan

func (fs *FriendshipSelect) Scan(ctx context.Context, v any) error

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

func (*FriendshipSelect) ScanX

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

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

func (*FriendshipSelect) String

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

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

func (*FriendshipSelect) StringX

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

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

func (*FriendshipSelect) Strings

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

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

func (*FriendshipSelect) StringsX

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

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

type FriendshipUpdate

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

FriendshipUpdate is the builder for updating Friendship entities.

func (*FriendshipUpdate) ClearFriend

func (fu *FriendshipUpdate) ClearFriend() *FriendshipUpdate

ClearFriend clears the "friend" edge to the User entity.

func (*FriendshipUpdate) ClearUser

func (fu *FriendshipUpdate) ClearUser() *FriendshipUpdate

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

func (*FriendshipUpdate) Exec

func (fu *FriendshipUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*FriendshipUpdate) ExecX

func (fu *FriendshipUpdate) ExecX(ctx context.Context)

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

func (*FriendshipUpdate) Modify

func (fu *FriendshipUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *FriendshipUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*FriendshipUpdate) Mutation

func (fu *FriendshipUpdate) Mutation() *FriendshipMutation

Mutation returns the FriendshipMutation object of the builder.

func (*FriendshipUpdate) Save

func (fu *FriendshipUpdate) Save(ctx context.Context) (int, error)

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

func (*FriendshipUpdate) SaveX

func (fu *FriendshipUpdate) SaveX(ctx context.Context) int

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

func (*FriendshipUpdate) SetCreatedAt

func (fu *FriendshipUpdate) SetCreatedAt(t time.Time) *FriendshipUpdate

SetCreatedAt sets the "created_at" field.

func (*FriendshipUpdate) SetFriend

func (fu *FriendshipUpdate) SetFriend(u *User) *FriendshipUpdate

SetFriend sets the "friend" edge to the User entity.

func (*FriendshipUpdate) SetFriendID

func (fu *FriendshipUpdate) SetFriendID(i int) *FriendshipUpdate

SetFriendID sets the "friend_id" field.

func (*FriendshipUpdate) SetInput

SetInput applies the change-set in the UpdateFriendshipInput on the FriendshipUpdate builder.

func (*FriendshipUpdate) SetNillableCreatedAt

func (fu *FriendshipUpdate) SetNillableCreatedAt(t *time.Time) *FriendshipUpdate

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

func (*FriendshipUpdate) SetNillableFriendID

func (fu *FriendshipUpdate) SetNillableFriendID(i *int) *FriendshipUpdate

SetNillableFriendID sets the "friend_id" field if the given value is not nil.

func (*FriendshipUpdate) SetNillableUserID

func (fu *FriendshipUpdate) SetNillableUserID(i *int) *FriendshipUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*FriendshipUpdate) SetUser

func (fu *FriendshipUpdate) SetUser(u *User) *FriendshipUpdate

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

func (*FriendshipUpdate) SetUserID

func (fu *FriendshipUpdate) SetUserID(i int) *FriendshipUpdate

SetUserID sets the "user_id" field.

func (*FriendshipUpdate) Where

Where appends a list predicates to the FriendshipUpdate builder.

type FriendshipUpdateOne

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

FriendshipUpdateOne is the builder for updating a single Friendship entity.

func (*FriendshipUpdateOne) ClearFriend

func (fuo *FriendshipUpdateOne) ClearFriend() *FriendshipUpdateOne

ClearFriend clears the "friend" edge to the User entity.

func (*FriendshipUpdateOne) ClearUser

func (fuo *FriendshipUpdateOne) ClearUser() *FriendshipUpdateOne

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

func (*FriendshipUpdateOne) Exec

func (fuo *FriendshipUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*FriendshipUpdateOne) ExecX

func (fuo *FriendshipUpdateOne) ExecX(ctx context.Context)

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

func (*FriendshipUpdateOne) Modify

func (fuo *FriendshipUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *FriendshipUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*FriendshipUpdateOne) Mutation

func (fuo *FriendshipUpdateOne) Mutation() *FriendshipMutation

Mutation returns the FriendshipMutation object of the builder.

func (*FriendshipUpdateOne) Save

func (fuo *FriendshipUpdateOne) Save(ctx context.Context) (*Friendship, error)

Save executes the query and returns the updated Friendship entity.

func (*FriendshipUpdateOne) SaveX

func (fuo *FriendshipUpdateOne) SaveX(ctx context.Context) *Friendship

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

func (*FriendshipUpdateOne) Select

func (fuo *FriendshipUpdateOne) Select(field string, fields ...string) *FriendshipUpdateOne

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

func (*FriendshipUpdateOne) SetCreatedAt

func (fuo *FriendshipUpdateOne) SetCreatedAt(t time.Time) *FriendshipUpdateOne

SetCreatedAt sets the "created_at" field.

func (*FriendshipUpdateOne) SetFriend

func (fuo *FriendshipUpdateOne) SetFriend(u *User) *FriendshipUpdateOne

SetFriend sets the "friend" edge to the User entity.

func (*FriendshipUpdateOne) SetFriendID

func (fuo *FriendshipUpdateOne) SetFriendID(i int) *FriendshipUpdateOne

SetFriendID sets the "friend_id" field.

func (*FriendshipUpdateOne) SetInput

SetInput applies the change-set in the UpdateFriendshipInput on the FriendshipUpdateOne builder.

func (*FriendshipUpdateOne) SetNillableCreatedAt

func (fuo *FriendshipUpdateOne) SetNillableCreatedAt(t *time.Time) *FriendshipUpdateOne

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

func (*FriendshipUpdateOne) SetNillableFriendID

func (fuo *FriendshipUpdateOne) SetNillableFriendID(i *int) *FriendshipUpdateOne

SetNillableFriendID sets the "friend_id" field if the given value is not nil.

func (*FriendshipUpdateOne) SetNillableUserID

func (fuo *FriendshipUpdateOne) SetNillableUserID(i *int) *FriendshipUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*FriendshipUpdateOne) SetUser

func (fuo *FriendshipUpdateOne) SetUser(u *User) *FriendshipUpdateOne

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

func (*FriendshipUpdateOne) SetUserID

func (fuo *FriendshipUpdateOne) SetUserID(i int) *FriendshipUpdateOne

SetUserID sets the "user_id" field.

func (*FriendshipUpdateOne) Where

Where appends a list predicates to the FriendshipUpdate builder.

type FriendshipWhereInput

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

	// "id" field predicates.
	ID      *int  `json:"id,omitempty"`
	IDNEQ   *int  `json:"idNEQ,omitempty"`
	IDIn    []int `json:"idIn,omitempty"`
	IDNotIn []int `json:"idNotIn,omitempty"`
	IDGT    *int  `json:"idGT,omitempty"`
	IDGTE   *int  `json:"idGTE,omitempty"`
	IDLT    *int  `json:"idLT,omitempty"`
	IDLTE   *int  `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"`

	// "user_id" field predicates.
	UserID      *int  `json:"userID,omitempty"`
	UserIDNEQ   *int  `json:"userIDNEQ,omitempty"`
	UserIDIn    []int `json:"userIDIn,omitempty"`
	UserIDNotIn []int `json:"userIDNotIn,omitempty"`

	// "friend_id" field predicates.
	FriendID      *int  `json:"friendID,omitempty"`
	FriendIDNEQ   *int  `json:"friendIDNEQ,omitempty"`
	FriendIDIn    []int `json:"friendIDIn,omitempty"`
	FriendIDNotIn []int `json:"friendIDNotIn,omitempty"`

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

	// "friend" edge predicates.
	HasFriend     *bool             `json:"hasFriend,omitempty"`
	HasFriendWith []*UserWhereInput `json:"hasFriendWith,omitempty"`
}

FriendshipWhereInput represents a where input for filtering Friendship queries.

func (*FriendshipWhereInput) AddPredicates

func (i *FriendshipWhereInput) AddPredicates(predicates ...predicate.Friendship)

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

func (*FriendshipWhereInput) Filter

Filter applies the FriendshipWhereInput filter on the FriendshipQuery builder.

func (*FriendshipWhereInput) P

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

type Friendships

type Friendships []*Friendship

Friendships is a parsable slice of Friendship.

type Group

type Group struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the 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) IsNamedNode

func (*Group) IsNamedNode()

IsNamedNode implements the NamedNode interface check for GQLGen.

func (*Group) IsNode

func (*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, orderBy *UserOrder, 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 int) *GroupDeleteOne

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

func (*GroupClient) Get

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

Get returns a Group entity by its id.

func (*GroupClient) GetX

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

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

func (*GroupClient) Hooks

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

Hooks returns the client hooks.

func (*GroupClient) Intercept

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

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

func (*GroupClient) Interceptors

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

Interceptors returns the client interceptors.

func (*GroupClient) MapCreateBulk

func (c *GroupClient) MapCreateBulk(slice any, setFunc func(*GroupCreate, int)) *GroupCreateBulk

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

func (*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 int) *GroupUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GroupClient) Use

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

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `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 ...int) *GroupCreate

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

func (*GroupCreate) AddUsers

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

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

func (*GroupCreate) Exec

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

Exec executes the query.

func (*GroupCreate) ExecX

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

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

func (*GroupCreate) Mutation

func (gc *GroupCreate) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupCreate) 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) SetName

func (gc *GroupCreate) SetName(s string) *GroupCreate

SetName sets the "name" field.

func (*GroupCreate) SetNillableName

func (gc *GroupCreate) SetNillableName(s *string) *GroupCreate

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

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 ...int)

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

func (*GroupMutation) AddedEdges

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

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

func (*GroupMutation) AddedField

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

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

func (*GroupMutation) AddedFields

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

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

func (*GroupMutation) AddedIDs

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

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

func (*GroupMutation) 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) 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 int, exists bool)

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

func (*GroupMutation) IDs

func (m *GroupMutation) IDs(ctx context.Context) ([]int, error)

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

func (*GroupMutation) Name

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

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

func (*GroupMutation) OldField

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

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

func (*GroupMutation) OldName

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

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

func (*GroupMutation) Op

func (m *GroupMutation) Op() Op

Op returns the operation name.

func (*GroupMutation) RemoveUserIDs

func (m *GroupMutation) RemoveUserIDs(ids ...int)

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 []int)

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

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

func (m *GroupMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*GroupMutation) ResetUsers

func (m *GroupMutation) ResetUsers()

ResetUsers resets all changes to the "users" edge.

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

func (m *GroupMutation) SetName(s string)

SetName sets the "name" field.

func (*GroupMutation) SetOp

func (m *GroupMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (GroupMutation) Tx

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

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

func (*GroupMutation) Type

func (m *GroupMutation) Type() string

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

func (*GroupMutation) UsersCleared

func (m *GroupMutation) UsersCleared() bool

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

func (*GroupMutation) UsersIDs

func (m *GroupMutation) UsersIDs() (ids []int)

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

func (*GroupMutation) Where

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

Where appends a list predicates to the GroupMutation builder.

func (*GroupMutation) WhereP

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

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

type 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 int, err error)

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

func (*GroupQuery) FirstIDX

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

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

func (*GroupQuery) FirstX

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

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

func (*GroupQuery) GroupBy

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

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

Example:

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

client.Group.Query().
	GroupBy(group.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*GroupQuery) IDs

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

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

func (*GroupQuery) IDsX

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

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

func (*GroupQuery) Limit

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

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

func (*GroupQuery) Modify

func (gq *GroupQuery) Modify(modifiers ...func(s *sql.Selector)) *GroupSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*GroupQuery) Offset

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

Offset to start from.

func (*GroupQuery) Only

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

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

func (*GroupQuery) OnlyID

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

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

func (*GroupQuery) OnlyIDX

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

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

func (*GroupQuery) OnlyX

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

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

func (*GroupQuery) Order

func (gq *GroupQuery) Order(o ...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 {
	Name string `json:"name,omitempty"`
}

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

func (*GroupQuery) Unique

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

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

func (*GroupQuery) Where

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

Where adds a new predicate for the GroupQuery builder.

func (*GroupQuery) 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) Modify

func (gs *GroupSelect) Modify(modifiers ...func(s *sql.Selector)) *GroupSelect

Modify adds a query modifier for attaching custom logic to queries.

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 ...int) *GroupUpdate

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

func (*GroupUpdate) AddUsers

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

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

func (*GroupUpdate) 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) Modify

func (gu *GroupUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *GroupUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*GroupUpdate) Mutation

func (gu *GroupUpdate) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupUpdate) RemoveUserIDs

func (gu *GroupUpdate) RemoveUserIDs(ids ...int) *GroupUpdate

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

func (*GroupUpdate) RemoveUsers

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

RemoveUsers removes "users" edges to User entities.

func (*GroupUpdate) Save

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

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

func (*GroupUpdate) SaveX

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

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

func (*GroupUpdate) SetName

func (gu *GroupUpdate) SetName(s string) *GroupUpdate

SetName sets the "name" field.

func (*GroupUpdate) SetNillableName

func (gu *GroupUpdate) SetNillableName(s *string) *GroupUpdate

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

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 ...int) *GroupUpdateOne

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

func (*GroupUpdateOne) AddUsers

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

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

func (*GroupUpdateOne) 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) Modify

func (guo *GroupUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *GroupUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*GroupUpdateOne) Mutation

func (guo *GroupUpdateOne) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupUpdateOne) RemoveUserIDs

func (guo *GroupUpdateOne) RemoveUserIDs(ids ...int) *GroupUpdateOne

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

func (*GroupUpdateOne) RemoveUsers

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

RemoveUsers removes "users" edges to User entities.

func (*GroupUpdateOne) Save

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

Save executes the query and returns the updated Group entity.

func (*GroupUpdateOne) SaveX

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

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

func (*GroupUpdateOne) Select

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

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

func (*GroupUpdateOne) SetName

func (guo *GroupUpdateOne) SetName(s string) *GroupUpdateOne

SetName sets the "name" field.

func (*GroupUpdateOne) SetNillableName

func (guo *GroupUpdateOne) SetNillableName(s *string) *GroupUpdateOne

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

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      *int  `json:"id,omitempty"`
	IDNEQ   *int  `json:"idNEQ,omitempty"`
	IDIn    []int `json:"idIn,omitempty"`
	IDNotIn []int `json:"idNotIn,omitempty"`
	IDGT    *int  `json:"idGT,omitempty"`
	IDGTE   *int  `json:"idGTE,omitempty"`
	IDLT    *int  `json:"idLT,omitempty"`
	IDLTE   *int  `json:"idLTE,omitempty"`

	// "name" field predicates.
	Name             *string  `json:"name,omitempty"`
	NameNEQ          *string  `json:"nameNEQ,omitempty"`
	NameIn           []string `json:"nameIn,omitempty"`
	NameNotIn        []string `json:"nameNotIn,omitempty"`
	NameGT           *string  `json:"nameGT,omitempty"`
	NameGTE          *string  `json:"nameGTE,omitempty"`
	NameLT           *string  `json:"nameLT,omitempty"`
	NameLTE          *string  `json:"nameLTE,omitempty"`
	NameContains     *string  `json:"nameContains,omitempty"`
	NameHasPrefix    *string  `json:"nameHasPrefix,omitempty"`
	NameHasSuffix    *string  `json:"nameHasSuffix,omitempty"`
	NameEqualFold    *string  `json:"nameEqualFold,omitempty"`
	NameContainsFold *string  `json:"nameContainsFold,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 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     int      `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, int) (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 OneToManies

type OneToManies []*OneToMany

OneToManies is a parsable slice of OneToMany.

type OneToMany

type OneToMany struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Field2 holds the value of the "field2" field.
	Field2 string `json:"field2,omitempty"`
	// ParentID holds the value of the "parent_id" field.
	ParentID int `json:"parent_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the OneToManyQuery when eager-loading is set.
	Edges OneToManyEdges `json:"edges"`
	// contains filtered or unexported fields
}

OneToMany is the model entity for the OneToMany schema.

func (*OneToMany) Children

func (otm *OneToMany) Children(ctx context.Context) (result []*OneToMany, err error)

func (*OneToMany) IsNode

func (*OneToMany) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*OneToMany) NamedChildren

func (otm *OneToMany) NamedChildren(name string) ([]*OneToMany, error)

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

func (*OneToMany) Node

func (otm *OneToMany) Node(ctx context.Context) (node *Node, err error)

Node implements Noder interface

func (*OneToMany) Parent

func (otm *OneToMany) Parent(ctx context.Context) (*OneToMany, error)

func (*OneToMany) QueryChildren

func (otm *OneToMany) QueryChildren() *OneToManyQuery

QueryChildren queries the "children" edge of the OneToMany entity.

func (*OneToMany) QueryParent

func (otm *OneToMany) QueryParent() *OneToManyQuery

QueryParent queries the "parent" edge of the OneToMany entity.

func (*OneToMany) String

func (otm *OneToMany) String() string

String implements the fmt.Stringer.

func (*OneToMany) ToEdge

func (otm *OneToMany) ToEdge(order *OneToManyOrder) *OneToManyEdge

ToEdge converts OneToMany into OneToManyEdge.

func (*OneToMany) Unwrap

func (otm *OneToMany) Unwrap() *OneToMany

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

func (otm *OneToMany) Update() *OneToManyUpdateOne

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

func (*OneToMany) Value

func (otm *OneToMany) Value(name string) (ent.Value, error)

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

type OneToManyClient

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

OneToManyClient is a client for the OneToMany schema.

func NewOneToManyClient

func NewOneToManyClient(c config) *OneToManyClient

NewOneToManyClient returns a client for the OneToMany from the given config.

func (*OneToManyClient) Create

func (c *OneToManyClient) Create() *OneToManyCreate

Create returns a builder for creating a OneToMany entity.

func (*OneToManyClient) CreateBulk

func (c *OneToManyClient) CreateBulk(builders ...*OneToManyCreate) *OneToManyCreateBulk

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

func (*OneToManyClient) Delete

func (c *OneToManyClient) Delete() *OneToManyDelete

Delete returns a delete builder for OneToMany.

func (*OneToManyClient) DeleteOne

func (c *OneToManyClient) DeleteOne(otm *OneToMany) *OneToManyDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*OneToManyClient) DeleteOneID

func (c *OneToManyClient) DeleteOneID(id int) *OneToManyDeleteOne

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

func (*OneToManyClient) Get

func (c *OneToManyClient) Get(ctx context.Context, id int) (*OneToMany, error)

Get returns a OneToMany entity by its id.

func (*OneToManyClient) GetX

func (c *OneToManyClient) GetX(ctx context.Context, id int) *OneToMany

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

func (*OneToManyClient) Hooks

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

Hooks returns the client hooks.

func (*OneToManyClient) Intercept

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

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

func (*OneToManyClient) Interceptors

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

Interceptors returns the client interceptors.

func (*OneToManyClient) MapCreateBulk

func (c *OneToManyClient) MapCreateBulk(slice any, setFunc func(*OneToManyCreate, int)) *OneToManyCreateBulk

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

func (*OneToManyClient) Query

func (c *OneToManyClient) Query() *OneToManyQuery

Query returns a query builder for OneToMany.

func (*OneToManyClient) QueryChildren

func (c *OneToManyClient) QueryChildren(otm *OneToMany) *OneToManyQuery

QueryChildren queries the children edge of a OneToMany.

func (*OneToManyClient) QueryParent

func (c *OneToManyClient) QueryParent(otm *OneToMany) *OneToManyQuery

QueryParent queries the parent edge of a OneToMany.

func (*OneToManyClient) Update

func (c *OneToManyClient) Update() *OneToManyUpdate

Update returns an update builder for OneToMany.

func (*OneToManyClient) UpdateOne

func (c *OneToManyClient) UpdateOne(otm *OneToMany) *OneToManyUpdateOne

UpdateOne returns an update builder for the given entity.

func (*OneToManyClient) UpdateOneID

func (c *OneToManyClient) UpdateOneID(id int) *OneToManyUpdateOne

UpdateOneID returns an update builder for the given id.

func (*OneToManyClient) Use

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

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

type OneToManyConnection

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

OneToManyConnection is the connection containing edges to OneToMany.

type OneToManyCreate

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

OneToManyCreate is the builder for creating a OneToMany entity.

func (*OneToManyCreate) AddChildIDs

func (otmc *OneToManyCreate) AddChildIDs(ids ...int) *OneToManyCreate

AddChildIDs adds the "children" edge to the OneToMany entity by IDs.

func (*OneToManyCreate) AddChildren

func (otmc *OneToManyCreate) AddChildren(o ...*OneToMany) *OneToManyCreate

AddChildren adds the "children" edges to the OneToMany entity.

func (*OneToManyCreate) Exec

func (otmc *OneToManyCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*OneToManyCreate) ExecX

func (otmc *OneToManyCreate) ExecX(ctx context.Context)

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

func (*OneToManyCreate) Mutation

func (otmc *OneToManyCreate) Mutation() *OneToManyMutation

Mutation returns the OneToManyMutation object of the builder.

func (*OneToManyCreate) Save

func (otmc *OneToManyCreate) Save(ctx context.Context) (*OneToMany, error)

Save creates the OneToMany in the database.

func (*OneToManyCreate) SaveX

func (otmc *OneToManyCreate) SaveX(ctx context.Context) *OneToMany

SaveX calls Save and panics if Save returns an error.

func (*OneToManyCreate) SetField2

func (otmc *OneToManyCreate) SetField2(s string) *OneToManyCreate

SetField2 sets the "field2" field.

func (*OneToManyCreate) SetName

func (otmc *OneToManyCreate) SetName(s string) *OneToManyCreate

SetName sets the "name" field.

func (*OneToManyCreate) SetNillableField2

func (otmc *OneToManyCreate) SetNillableField2(s *string) *OneToManyCreate

SetNillableField2 sets the "field2" field if the given value is not nil.

func (*OneToManyCreate) SetNillableParentID

func (otmc *OneToManyCreate) SetNillableParentID(i *int) *OneToManyCreate

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (*OneToManyCreate) SetParent

func (otmc *OneToManyCreate) SetParent(o *OneToMany) *OneToManyCreate

SetParent sets the "parent" edge to the OneToMany entity.

func (*OneToManyCreate) SetParentID

func (otmc *OneToManyCreate) SetParentID(i int) *OneToManyCreate

SetParentID sets the "parent_id" field.

type OneToManyCreateBulk

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

OneToManyCreateBulk is the builder for creating many OneToMany entities in bulk.

func (*OneToManyCreateBulk) Exec

func (otmcb *OneToManyCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*OneToManyCreateBulk) ExecX

func (otmcb *OneToManyCreateBulk) ExecX(ctx context.Context)

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

func (*OneToManyCreateBulk) Save

func (otmcb *OneToManyCreateBulk) Save(ctx context.Context) ([]*OneToMany, error)

Save creates the OneToMany entities in the database.

func (*OneToManyCreateBulk) SaveX

func (otmcb *OneToManyCreateBulk) SaveX(ctx context.Context) []*OneToMany

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

type OneToManyDelete

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

OneToManyDelete is the builder for deleting a OneToMany entity.

func (*OneToManyDelete) Exec

func (otmd *OneToManyDelete) Exec(ctx context.Context) (int, error)

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

func (*OneToManyDelete) ExecX

func (otmd *OneToManyDelete) ExecX(ctx context.Context) int

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

func (*OneToManyDelete) Where

func (otmd *OneToManyDelete) Where(ps ...predicate.OneToMany) *OneToManyDelete

Where appends a list predicates to the OneToManyDelete builder.

type OneToManyDeleteOne

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

OneToManyDeleteOne is the builder for deleting a single OneToMany entity.

func (*OneToManyDeleteOne) Exec

func (otmdo *OneToManyDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*OneToManyDeleteOne) ExecX

func (otmdo *OneToManyDeleteOne) ExecX(ctx context.Context)

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

func (*OneToManyDeleteOne) Where

Where appends a list predicates to the OneToManyDelete builder.

type OneToManyEdge

type OneToManyEdge struct {
	Node   *OneToMany `json:"node"`
	Cursor Cursor     `json:"cursor"`
}

OneToManyEdge is the edge representation of OneToMany.

type OneToManyEdges

type OneToManyEdges struct {
	// Parent holds the value of the parent edge.
	Parent *OneToMany `json:"parent,omitempty"`
	// Children holds the value of the children edge.
	Children []*OneToMany `json:"children,omitempty"`
	// contains filtered or unexported fields
}

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

func (OneToManyEdges) ChildrenOrErr

func (e OneToManyEdges) ChildrenOrErr() ([]*OneToMany, error)

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

func (OneToManyEdges) ParentOrErr

func (e OneToManyEdges) ParentOrErr() (*OneToMany, error)

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

type OneToManyGroupBy

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

OneToManyGroupBy is the group-by builder for OneToMany entities.

func (*OneToManyGroupBy) Aggregate

func (otmgb *OneToManyGroupBy) Aggregate(fns ...AggregateFunc) *OneToManyGroupBy

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

func (*OneToManyGroupBy) Bool

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

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

func (*OneToManyGroupBy) BoolX

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

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

func (*OneToManyGroupBy) Bools

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

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

func (*OneToManyGroupBy) BoolsX

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

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

func (*OneToManyGroupBy) Float64

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

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

func (*OneToManyGroupBy) Float64X

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

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

func (*OneToManyGroupBy) Float64s

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

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

func (*OneToManyGroupBy) Float64sX

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

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

func (*OneToManyGroupBy) Int

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

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

func (*OneToManyGroupBy) IntX

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

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

func (*OneToManyGroupBy) Ints

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

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

func (*OneToManyGroupBy) IntsX

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

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

func (*OneToManyGroupBy) Scan

func (otmgb *OneToManyGroupBy) Scan(ctx context.Context, v any) error

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

func (*OneToManyGroupBy) ScanX

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

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

func (*OneToManyGroupBy) String

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

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

func (*OneToManyGroupBy) StringX

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

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

func (*OneToManyGroupBy) Strings

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

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

func (*OneToManyGroupBy) StringsX

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

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

type OneToManyMutation

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

OneToManyMutation represents an operation that mutates the OneToMany nodes in the graph.

func (*OneToManyMutation) AddChildIDs

func (m *OneToManyMutation) AddChildIDs(ids ...int)

AddChildIDs adds the "children" edge to the OneToMany entity by ids.

func (*OneToManyMutation) AddField

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

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

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

func (*OneToManyMutation) AddedField

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

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

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

func (*OneToManyMutation) AddedIDs

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

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

func (*OneToManyMutation) ChildrenCleared

func (m *OneToManyMutation) ChildrenCleared() bool

ChildrenCleared reports if the "children" edge to the OneToMany entity was cleared.

func (*OneToManyMutation) ChildrenIDs

func (m *OneToManyMutation) ChildrenIDs() (ids []int)

ChildrenIDs returns the "children" edge IDs in the mutation.

func (*OneToManyMutation) ClearChildren

func (m *OneToManyMutation) ClearChildren()

ClearChildren clears the "children" edge to the OneToMany entity.

func (*OneToManyMutation) ClearEdge

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

func (m *OneToManyMutation) 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 (*OneToManyMutation) ClearField2

func (m *OneToManyMutation) ClearField2()

ClearField2 clears the value of the "field2" field.

func (*OneToManyMutation) ClearParent

func (m *OneToManyMutation) ClearParent()

ClearParent clears the "parent" edge to the OneToMany entity.

func (*OneToManyMutation) ClearParentID

func (m *OneToManyMutation) ClearParentID()

ClearParentID clears the value of the "parent_id" field.

func (*OneToManyMutation) ClearedEdges

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

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

func (*OneToManyMutation) ClearedFields

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

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

func (OneToManyMutation) Client

func (m OneToManyMutation) 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 (*OneToManyMutation) EdgeCleared

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

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

func (*OneToManyMutation) Field

func (m *OneToManyMutation) 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 (*OneToManyMutation) Field2

func (m *OneToManyMutation) Field2() (r string, exists bool)

Field2 returns the value of the "field2" field in the mutation.

func (*OneToManyMutation) Field2Cleared

func (m *OneToManyMutation) Field2Cleared() bool

Field2Cleared returns if the "field2" field was cleared in this mutation.

func (*OneToManyMutation) FieldCleared

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

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

func (*OneToManyMutation) Fields

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

func (m *OneToManyMutation) ID() (id int, exists bool)

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

func (*OneToManyMutation) IDs

func (m *OneToManyMutation) IDs(ctx context.Context) ([]int, error)

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

func (*OneToManyMutation) Name

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

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

func (*OneToManyMutation) OldField

func (m *OneToManyMutation) 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 (*OneToManyMutation) OldField2

func (m *OneToManyMutation) OldField2(ctx context.Context) (v string, err error)

OldField2 returns the old "field2" field's value of the OneToMany entity. If the OneToMany 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 (*OneToManyMutation) OldName

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

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

func (m *OneToManyMutation) OldParentID(ctx context.Context) (v int, err error)

OldParentID returns the old "parent_id" field's value of the OneToMany entity. If the OneToMany 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 (*OneToManyMutation) Op

func (m *OneToManyMutation) Op() Op

Op returns the operation name.

func (*OneToManyMutation) ParentCleared

func (m *OneToManyMutation) ParentCleared() bool

ParentCleared reports if the "parent" edge to the OneToMany entity was cleared.

func (*OneToManyMutation) ParentID

func (m *OneToManyMutation) ParentID() (r int, exists bool)

ParentID returns the value of the "parent_id" field in the mutation.

func (*OneToManyMutation) ParentIDCleared

func (m *OneToManyMutation) ParentIDCleared() bool

ParentIDCleared returns if the "parent_id" field was cleared in this mutation.

func (*OneToManyMutation) ParentIDs

func (m *OneToManyMutation) ParentIDs() (ids []int)

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

func (*OneToManyMutation) RemoveChildIDs

func (m *OneToManyMutation) RemoveChildIDs(ids ...int)

RemoveChildIDs removes the "children" edge to the OneToMany entity by IDs.

func (*OneToManyMutation) RemovedChildrenIDs

func (m *OneToManyMutation) RemovedChildrenIDs() (ids []int)

RemovedChildren returns the removed IDs of the "children" edge to the OneToMany entity.

func (*OneToManyMutation) RemovedEdges

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

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

func (*OneToManyMutation) RemovedIDs

func (m *OneToManyMutation) 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 (*OneToManyMutation) ResetChildren

func (m *OneToManyMutation) ResetChildren()

ResetChildren resets all changes to the "children" edge.

func (*OneToManyMutation) ResetEdge

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

func (m *OneToManyMutation) 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 (*OneToManyMutation) ResetField2

func (m *OneToManyMutation) ResetField2()

ResetField2 resets all changes to the "field2" field.

func (*OneToManyMutation) ResetName

func (m *OneToManyMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*OneToManyMutation) ResetParent

func (m *OneToManyMutation) ResetParent()

ResetParent resets all changes to the "parent" edge.

func (*OneToManyMutation) ResetParentID

func (m *OneToManyMutation) ResetParentID()

ResetParentID resets all changes to the "parent_id" field.

func (*OneToManyMutation) SetField

func (m *OneToManyMutation) 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 (*OneToManyMutation) SetField2

func (m *OneToManyMutation) SetField2(s string)

SetField2 sets the "field2" field.

func (*OneToManyMutation) SetName

func (m *OneToManyMutation) SetName(s string)

SetName sets the "name" field.

func (*OneToManyMutation) SetOp

func (m *OneToManyMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*OneToManyMutation) SetParentID

func (m *OneToManyMutation) SetParentID(i int)

SetParentID sets the "parent_id" field.

func (OneToManyMutation) Tx

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

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

func (*OneToManyMutation) Type

func (m *OneToManyMutation) Type() string

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

func (*OneToManyMutation) Where

func (m *OneToManyMutation) Where(ps ...predicate.OneToMany)

Where appends a list predicates to the OneToManyMutation builder.

func (*OneToManyMutation) WhereP

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

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

type OneToManyOrder

type OneToManyOrder struct {
	Direction OrderDirection       `json:"direction"`
	Field     *OneToManyOrderField `json:"field"`
}

OneToManyOrder defines the ordering of OneToMany.

type OneToManyOrderField

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

OneToManyOrderField defines the ordering field of OneToMany.

func (OneToManyOrderField) MarshalGQL

func (f OneToManyOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (OneToManyOrderField) String

func (f OneToManyOrderField) String() string

String implement fmt.Stringer interface.

func (*OneToManyOrderField) UnmarshalGQL

func (f *OneToManyOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type OneToManyPaginateOption

type OneToManyPaginateOption func(*onetomanyPager) error

OneToManyPaginateOption enables pagination customization.

func WithOneToManyFilter

func WithOneToManyFilter(filter func(*OneToManyQuery) (*OneToManyQuery, error)) OneToManyPaginateOption

WithOneToManyFilter configures pagination filter.

func WithOneToManyOrder

func WithOneToManyOrder(order *OneToManyOrder) OneToManyPaginateOption

WithOneToManyOrder configures pagination ordering.

type OneToManyQuery

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

OneToManyQuery is the builder for querying OneToMany entities.

func (*OneToManyQuery) Aggregate

func (otmq *OneToManyQuery) Aggregate(fns ...AggregateFunc) *OneToManySelect

Aggregate returns a OneToManySelect configured with the given aggregations.

func (*OneToManyQuery) All

func (otmq *OneToManyQuery) All(ctx context.Context) ([]*OneToMany, error)

All executes the query and returns a list of OneToManies.

func (*OneToManyQuery) AllX

func (otmq *OneToManyQuery) AllX(ctx context.Context) []*OneToMany

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

func (*OneToManyQuery) Clone

func (otmq *OneToManyQuery) Clone() *OneToManyQuery

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

func (*OneToManyQuery) CollectFields

func (otm *OneToManyQuery) CollectFields(ctx context.Context, satisfies ...string) (*OneToManyQuery, error)

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

func (*OneToManyQuery) Count

func (otmq *OneToManyQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*OneToManyQuery) CountX

func (otmq *OneToManyQuery) CountX(ctx context.Context) int

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

func (*OneToManyQuery) Exist

func (otmq *OneToManyQuery) Exist(ctx context.Context) (bool, error)

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

func (*OneToManyQuery) ExistX

func (otmq *OneToManyQuery) ExistX(ctx context.Context) bool

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

func (*OneToManyQuery) First

func (otmq *OneToManyQuery) First(ctx context.Context) (*OneToMany, error)

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

func (*OneToManyQuery) FirstID

func (otmq *OneToManyQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*OneToManyQuery) FirstIDX

func (otmq *OneToManyQuery) FirstIDX(ctx context.Context) int

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

func (*OneToManyQuery) FirstX

func (otmq *OneToManyQuery) FirstX(ctx context.Context) *OneToMany

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

func (*OneToManyQuery) GroupBy

func (otmq *OneToManyQuery) GroupBy(field string, fields ...string) *OneToManyGroupBy

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

Example:

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

client.OneToMany.Query().
	GroupBy(onetomany.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*OneToManyQuery) IDs

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

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

func (*OneToManyQuery) IDsX

func (otmq *OneToManyQuery) IDsX(ctx context.Context) []int

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

func (*OneToManyQuery) Limit

func (otmq *OneToManyQuery) Limit(limit int) *OneToManyQuery

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

func (*OneToManyQuery) Modify

func (otmq *OneToManyQuery) Modify(modifiers ...func(s *sql.Selector)) *OneToManySelect

Modify adds a query modifier for attaching custom logic to queries.

func (*OneToManyQuery) Offset

func (otmq *OneToManyQuery) Offset(offset int) *OneToManyQuery

Offset to start from.

func (*OneToManyQuery) Only

func (otmq *OneToManyQuery) Only(ctx context.Context) (*OneToMany, error)

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

func (*OneToManyQuery) OnlyID

func (otmq *OneToManyQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*OneToManyQuery) OnlyIDX

func (otmq *OneToManyQuery) OnlyIDX(ctx context.Context) int

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

func (*OneToManyQuery) OnlyX

func (otmq *OneToManyQuery) OnlyX(ctx context.Context) *OneToMany

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

func (*OneToManyQuery) Order

Order specifies how the records should be ordered.

func (*OneToManyQuery) Paginate

func (otm *OneToManyQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...OneToManyPaginateOption,
) (*OneToManyConnection, error)

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

func (*OneToManyQuery) QueryChildren

func (otmq *OneToManyQuery) QueryChildren() *OneToManyQuery

QueryChildren chains the current query on the "children" edge.

func (*OneToManyQuery) QueryParent

func (otmq *OneToManyQuery) QueryParent() *OneToManyQuery

QueryParent chains the current query on the "parent" edge.

func (*OneToManyQuery) Select

func (otmq *OneToManyQuery) Select(fields ...string) *OneToManySelect

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

Example:

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

client.OneToMany.Query().
	Select(onetomany.FieldName).
	Scan(ctx, &v)

func (*OneToManyQuery) Unique

func (otmq *OneToManyQuery) Unique(unique bool) *OneToManyQuery

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

func (otmq *OneToManyQuery) Where(ps ...predicate.OneToMany) *OneToManyQuery

Where adds a new predicate for the OneToManyQuery builder.

func (*OneToManyQuery) WithChildren

func (otmq *OneToManyQuery) WithChildren(opts ...func(*OneToManyQuery)) *OneToManyQuery

WithChildren tells the query-builder to eager-load the nodes that are connected to the "children" edge. The optional arguments are used to configure the query builder of the edge.

func (*OneToManyQuery) WithNamedChildren

func (otmq *OneToManyQuery) WithNamedChildren(name string, opts ...func(*OneToManyQuery)) *OneToManyQuery

WithNamedChildren tells the query-builder to eager-load the nodes that are connected to the "children" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*OneToManyQuery) WithParent

func (otmq *OneToManyQuery) WithParent(opts ...func(*OneToManyQuery)) *OneToManyQuery

WithParent tells the query-builder to eager-load the nodes that are connected to the "parent" edge. The optional arguments are used to configure the query builder of the edge.

type OneToManySelect

type OneToManySelect struct {
	*OneToManyQuery
	// contains filtered or unexported fields
}

OneToManySelect is the builder for selecting fields of OneToMany entities.

func (*OneToManySelect) Aggregate

func (otms *OneToManySelect) Aggregate(fns ...AggregateFunc) *OneToManySelect

Aggregate adds the given aggregation functions to the selector query.

func (*OneToManySelect) Bool

func (s *OneToManySelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*OneToManySelect) BoolX

func (s *OneToManySelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OneToManySelect) Bools

func (s *OneToManySelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*OneToManySelect) BoolsX

func (s *OneToManySelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OneToManySelect) Float64

func (s *OneToManySelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*OneToManySelect) Float64X

func (s *OneToManySelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OneToManySelect) Float64s

func (s *OneToManySelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*OneToManySelect) Float64sX

func (s *OneToManySelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OneToManySelect) Int

func (s *OneToManySelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*OneToManySelect) IntX

func (s *OneToManySelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OneToManySelect) Ints

func (s *OneToManySelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*OneToManySelect) IntsX

func (s *OneToManySelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*OneToManySelect) Modify

func (otms *OneToManySelect) Modify(modifiers ...func(s *sql.Selector)) *OneToManySelect

Modify adds a query modifier for attaching custom logic to queries.

func (*OneToManySelect) Scan

func (otms *OneToManySelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*OneToManySelect) ScanX

func (s *OneToManySelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*OneToManySelect) String

func (s *OneToManySelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*OneToManySelect) StringX

func (s *OneToManySelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OneToManySelect) Strings

func (s *OneToManySelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*OneToManySelect) StringsX

func (s *OneToManySelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type OneToManyUpdate

type OneToManyUpdate struct {
	// contains filtered or unexported fields
}

OneToManyUpdate is the builder for updating OneToMany entities.

func (*OneToManyUpdate) AddChildIDs

func (otmu *OneToManyUpdate) AddChildIDs(ids ...int) *OneToManyUpdate

AddChildIDs adds the "children" edge to the OneToMany entity by IDs.

func (*OneToManyUpdate) AddChildren

func (otmu *OneToManyUpdate) AddChildren(o ...*OneToMany) *OneToManyUpdate

AddChildren adds the "children" edges to the OneToMany entity.

func (*OneToManyUpdate) ClearChildren

func (otmu *OneToManyUpdate) ClearChildren() *OneToManyUpdate

ClearChildren clears all "children" edges to the OneToMany entity.

func (*OneToManyUpdate) ClearField2

func (otmu *OneToManyUpdate) ClearField2() *OneToManyUpdate

ClearField2 clears the value of the "field2" field.

func (*OneToManyUpdate) ClearParent

func (otmu *OneToManyUpdate) ClearParent() *OneToManyUpdate

ClearParent clears the "parent" edge to the OneToMany entity.

func (*OneToManyUpdate) ClearParentID

func (otmu *OneToManyUpdate) ClearParentID() *OneToManyUpdate

ClearParentID clears the value of the "parent_id" field.

func (*OneToManyUpdate) Exec

func (otmu *OneToManyUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*OneToManyUpdate) ExecX

func (otmu *OneToManyUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OneToManyUpdate) Modify

func (otmu *OneToManyUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *OneToManyUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*OneToManyUpdate) Mutation

func (otmu *OneToManyUpdate) Mutation() *OneToManyMutation

Mutation returns the OneToManyMutation object of the builder.

func (*OneToManyUpdate) RemoveChildIDs

func (otmu *OneToManyUpdate) RemoveChildIDs(ids ...int) *OneToManyUpdate

RemoveChildIDs removes the "children" edge to OneToMany entities by IDs.

func (*OneToManyUpdate) RemoveChildren

func (otmu *OneToManyUpdate) RemoveChildren(o ...*OneToMany) *OneToManyUpdate

RemoveChildren removes "children" edges to OneToMany entities.

func (*OneToManyUpdate) Save

func (otmu *OneToManyUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*OneToManyUpdate) SaveX

func (otmu *OneToManyUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*OneToManyUpdate) SetField2

func (otmu *OneToManyUpdate) SetField2(s string) *OneToManyUpdate

SetField2 sets the "field2" field.

func (*OneToManyUpdate) SetName

func (otmu *OneToManyUpdate) SetName(s string) *OneToManyUpdate

SetName sets the "name" field.

func (*OneToManyUpdate) SetNillableField2

func (otmu *OneToManyUpdate) SetNillableField2(s *string) *OneToManyUpdate

SetNillableField2 sets the "field2" field if the given value is not nil.

func (*OneToManyUpdate) SetNillableName

func (otmu *OneToManyUpdate) SetNillableName(s *string) *OneToManyUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*OneToManyUpdate) SetNillableParentID

func (otmu *OneToManyUpdate) SetNillableParentID(i *int) *OneToManyUpdate

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (*OneToManyUpdate) SetParent

func (otmu *OneToManyUpdate) SetParent(o *OneToMany) *OneToManyUpdate

SetParent sets the "parent" edge to the OneToMany entity.

func (*OneToManyUpdate) SetParentID

func (otmu *OneToManyUpdate) SetParentID(i int) *OneToManyUpdate

SetParentID sets the "parent_id" field.

func (*OneToManyUpdate) Where

func (otmu *OneToManyUpdate) Where(ps ...predicate.OneToMany) *OneToManyUpdate

Where appends a list predicates to the OneToManyUpdate builder.

type OneToManyUpdateOne

type OneToManyUpdateOne struct {
	// contains filtered or unexported fields
}

OneToManyUpdateOne is the builder for updating a single OneToMany entity.

func (*OneToManyUpdateOne) AddChildIDs

func (otmuo *OneToManyUpdateOne) AddChildIDs(ids ...int) *OneToManyUpdateOne

AddChildIDs adds the "children" edge to the OneToMany entity by IDs.

func (*OneToManyUpdateOne) AddChildren

func (otmuo *OneToManyUpdateOne) AddChildren(o ...*OneToMany) *OneToManyUpdateOne

AddChildren adds the "children" edges to the OneToMany entity.

func (*OneToManyUpdateOne) ClearChildren

func (otmuo *OneToManyUpdateOne) ClearChildren() *OneToManyUpdateOne

ClearChildren clears all "children" edges to the OneToMany entity.

func (*OneToManyUpdateOne) ClearField2

func (otmuo *OneToManyUpdateOne) ClearField2() *OneToManyUpdateOne

ClearField2 clears the value of the "field2" field.

func (*OneToManyUpdateOne) ClearParent

func (otmuo *OneToManyUpdateOne) ClearParent() *OneToManyUpdateOne

ClearParent clears the "parent" edge to the OneToMany entity.

func (*OneToManyUpdateOne) ClearParentID

func (otmuo *OneToManyUpdateOne) ClearParentID() *OneToManyUpdateOne

ClearParentID clears the value of the "parent_id" field.

func (*OneToManyUpdateOne) Exec

func (otmuo *OneToManyUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*OneToManyUpdateOne) ExecX

func (otmuo *OneToManyUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OneToManyUpdateOne) Modify

func (otmuo *OneToManyUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *OneToManyUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*OneToManyUpdateOne) Mutation

func (otmuo *OneToManyUpdateOne) Mutation() *OneToManyMutation

Mutation returns the OneToManyMutation object of the builder.

func (*OneToManyUpdateOne) RemoveChildIDs

func (otmuo *OneToManyUpdateOne) RemoveChildIDs(ids ...int) *OneToManyUpdateOne

RemoveChildIDs removes the "children" edge to OneToMany entities by IDs.

func (*OneToManyUpdateOne) RemoveChildren

func (otmuo *OneToManyUpdateOne) RemoveChildren(o ...*OneToMany) *OneToManyUpdateOne

RemoveChildren removes "children" edges to OneToMany entities.

func (*OneToManyUpdateOne) Save

func (otmuo *OneToManyUpdateOne) Save(ctx context.Context) (*OneToMany, error)

Save executes the query and returns the updated OneToMany entity.

func (*OneToManyUpdateOne) SaveX

func (otmuo *OneToManyUpdateOne) SaveX(ctx context.Context) *OneToMany

SaveX is like Save, but panics if an error occurs.

func (*OneToManyUpdateOne) Select

func (otmuo *OneToManyUpdateOne) Select(field string, fields ...string) *OneToManyUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*OneToManyUpdateOne) SetField2

func (otmuo *OneToManyUpdateOne) SetField2(s string) *OneToManyUpdateOne

SetField2 sets the "field2" field.

func (*OneToManyUpdateOne) SetName

func (otmuo *OneToManyUpdateOne) SetName(s string) *OneToManyUpdateOne

SetName sets the "name" field.

func (*OneToManyUpdateOne) SetNillableField2

func (otmuo *OneToManyUpdateOne) SetNillableField2(s *string) *OneToManyUpdateOne

SetNillableField2 sets the "field2" field if the given value is not nil.

func (*OneToManyUpdateOne) SetNillableName

func (otmuo *OneToManyUpdateOne) SetNillableName(s *string) *OneToManyUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*OneToManyUpdateOne) SetNillableParentID

func (otmuo *OneToManyUpdateOne) SetNillableParentID(i *int) *OneToManyUpdateOne

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (*OneToManyUpdateOne) SetParent

func (otmuo *OneToManyUpdateOne) SetParent(o *OneToMany) *OneToManyUpdateOne

SetParent sets the "parent" edge to the OneToMany entity.

func (*OneToManyUpdateOne) SetParentID

func (otmuo *OneToManyUpdateOne) SetParentID(i int) *OneToManyUpdateOne

SetParentID sets the "parent_id" field.

func (*OneToManyUpdateOne) Where

Where appends a list predicates to the OneToManyUpdate builder.

type OneToManyWhereInput

type OneToManyWhereInput struct {
	Predicates []predicate.OneToMany  `json:"-"`
	Not        *OneToManyWhereInput   `json:"not,omitempty"`
	Or         []*OneToManyWhereInput `json:"or,omitempty"`
	And        []*OneToManyWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *int  `json:"id,omitempty"`
	IDNEQ   *int  `json:"idNEQ,omitempty"`
	IDIn    []int `json:"idIn,omitempty"`
	IDNotIn []int `json:"idNotIn,omitempty"`
	IDGT    *int  `json:"idGT,omitempty"`
	IDGTE   *int  `json:"idGTE,omitempty"`
	IDLT    *int  `json:"idLT,omitempty"`
	IDLTE   *int  `json:"idLTE,omitempty"`

	// "name" field predicates.
	Name             *string  `json:"name,omitempty"`
	NameNEQ          *string  `json:"nameNEQ,omitempty"`
	NameIn           []string `json:"nameIn,omitempty"`
	NameNotIn        []string `json:"nameNotIn,omitempty"`
	NameGT           *string  `json:"nameGT,omitempty"`
	NameGTE          *string  `json:"nameGTE,omitempty"`
	NameLT           *string  `json:"nameLT,omitempty"`
	NameLTE          *string  `json:"nameLTE,omitempty"`
	NameContains     *string  `json:"nameContains,omitempty"`
	NameHasPrefix    *string  `json:"nameHasPrefix,omitempty"`
	NameHasSuffix    *string  `json:"nameHasSuffix,omitempty"`
	NameEqualFold    *string  `json:"nameEqualFold,omitempty"`
	NameContainsFold *string  `json:"nameContainsFold,omitempty"`

	// "field2" field predicates.
	Field2             *string  `json:"field2,omitempty"`
	Field2NEQ          *string  `json:"field2NEQ,omitempty"`
	Field2In           []string `json:"field2In,omitempty"`
	Field2NotIn        []string `json:"field2NotIn,omitempty"`
	Field2GT           *string  `json:"field2GT,omitempty"`
	Field2GTE          *string  `json:"field2GTE,omitempty"`
	Field2LT           *string  `json:"field2LT,omitempty"`
	Field2LTE          *string  `json:"field2LTE,omitempty"`
	Field2Contains     *string  `json:"field2Contains,omitempty"`
	Field2HasPrefix    *string  `json:"field2HasPrefix,omitempty"`
	Field2HasSuffix    *string  `json:"field2HasSuffix,omitempty"`
	Field2IsNil        bool     `json:"field2IsNil,omitempty"`
	Field2NotNil       bool     `json:"field2NotNil,omitempty"`
	Field2EqualFold    *string  `json:"field2EqualFold,omitempty"`
	Field2ContainsFold *string  `json:"field2ContainsFold,omitempty"`

	// "parent" edge predicates.
	HasParent     *bool                  `json:"hasParent,omitempty"`
	HasParentWith []*OneToManyWhereInput `json:"hasParentWith,omitempty"`

	// "children" edge predicates.
	HasChildren     *bool                  `json:"hasChildren,omitempty"`
	HasChildrenWith []*OneToManyWhereInput `json:"hasChildrenWith,omitempty"`
}

OneToManyWhereInput represents a where input for filtering OneToMany queries.

func (*OneToManyWhereInput) AddPredicates

func (i *OneToManyWhereInput) AddPredicates(predicates ...predicate.OneToMany)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*OneToManyWhereInput) Filter

Filter applies the OneToManyWhereInput filter on the OneToManyQuery builder.

func (*OneToManyWhereInput) P

P returns a predicate for filtering onetomanies. An error is returned if the input is empty or invalid.

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 Organization

type Organization = Workspace

Organization is the type alias for Workspace.

func (*Organization) ToEdge

func (w *Organization) ToEdge(order *OrganizationOrder) *OrganizationEdge

ToEdge converts Organization into OrganizationEdge.

type OrganizationConnection

type OrganizationConnection struct {
	Edges      []*OrganizationEdge `json:"edges"`
	PageInfo   PageInfo            `json:"pageInfo"`
	TotalCount int                 `json:"totalCount"`
}

OrganizationConnection is the connection containing edges to Organization.

type OrganizationEdge

type OrganizationEdge struct {
	Node   *Organization `json:"node"`
	Cursor Cursor        `json:"cursor"`
}

OrganizationEdge is the edge representation of Organization.

type OrganizationOrder

type OrganizationOrder struct {
	Direction OrderDirection          `json:"direction"`
	Field     *OrganizationOrderField `json:"field"`
}

OrganizationOrder defines the ordering of Workspace.

type OrganizationOrderField

type OrganizationOrderField struct {
	// Value extracts the ordering value from the given Workspace.
	Value func(*Organization) (ent.Value, error)
	// contains filtered or unexported fields
}

OrganizationOrderField defines the ordering field of Workspace.

type OrganizationPaginateOption

type OrganizationPaginateOption func(*organizationPager) error

OrganizationPaginateOption enables pagination customization.

func WithOrganizationFilter

func WithOrganizationFilter(filter func(*WorkspaceQuery) (*WorkspaceQuery, error)) OrganizationPaginateOption

WithOrganizationFilter configures pagination filter.

func WithOrganizationOrder

func WithOrganizationOrder(order *OrganizationOrder) OrganizationPaginateOption

WithOrganizationOrder configures pagination ordering.

type OrganizationWhereInput

type OrganizationWhereInput struct {
	Predicates []predicate.Workspace     `json:"-"`
	Not        *OrganizationWhereInput   `json:"not,omitempty"`
	Or         []*OrganizationWhereInput `json:"or,omitempty"`
	And        []*OrganizationWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *int  `json:"id,omitempty"`
	IDNEQ   *int  `json:"idNEQ,omitempty"`
	IDIn    []int `json:"idIn,omitempty"`
	IDNotIn []int `json:"idNotIn,omitempty"`
	IDGT    *int  `json:"idGT,omitempty"`
	IDGTE   *int  `json:"idGTE,omitempty"`
	IDLT    *int  `json:"idLT,omitempty"`
	IDLTE   *int  `json:"idLTE,omitempty"`

	// "name" field predicates.
	Name             *string  `json:"name,omitempty"`
	NameNEQ          *string  `json:"nameNEQ,omitempty"`
	NameIn           []string `json:"nameIn,omitempty"`
	NameNotIn        []string `json:"nameNotIn,omitempty"`
	NameGT           *string  `json:"nameGT,omitempty"`
	NameGTE          *string  `json:"nameGTE,omitempty"`
	NameLT           *string  `json:"nameLT,omitempty"`
	NameLTE          *string  `json:"nameLTE,omitempty"`
	NameContains     *string  `json:"nameContains,omitempty"`
	NameHasPrefix    *string  `json:"nameHasPrefix,omitempty"`
	NameHasSuffix    *string  `json:"nameHasSuffix,omitempty"`
	NameEqualFold    *string  `json:"nameEqualFold,omitempty"`
	NameContainsFold *string  `json:"nameContainsFold,omitempty"`
}

OrganizationWhereInput represents a where input for filtering Workspace queries.

func (*OrganizationWhereInput) AddPredicates

func (i *OrganizationWhereInput) AddPredicates(predicates ...predicate.Workspace)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*OrganizationWhereInput) Filter

Filter applies the OrganizationWhereInput filter on the WorkspaceQuery builder.

func (*OrganizationWhereInput) P

P returns a predicate for filtering workspaces. An error is returned if the input is empty or invalid.

type PageInfo

type PageInfo = entgql.PageInfo[int]

Common entgql types.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Project

type Project struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ProjectQuery when eager-loading is set.
	Edges ProjectEdges `json:"edges"`
	// contains filtered or unexported fields
}

Project is the model entity for the Project schema.

func (*Project) IsNode

func (*Project) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*Project) NamedTodos

func (pr *Project) NamedTodos(name string) ([]*Todo, error)

NamedTodos returns the Todos named value or an error if the edge was not loaded in eager-loading with this name.

func (*Project) Node

func (pr *Project) Node(ctx context.Context) (node *Node, err error)

Node implements Noder interface

func (*Project) QueryTodos

func (pr *Project) QueryTodos() *TodoQuery

QueryTodos queries the "todos" edge of the Project entity.

func (*Project) String

func (pr *Project) String() string

String implements the fmt.Stringer.

func (*Project) ToEdge

func (pr *Project) ToEdge(order *ProjectOrder) *ProjectEdge

ToEdge converts Project into ProjectEdge.

func (*Project) Todos

func (pr *Project) Todos(
	ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, orderBy []*TodoOrder, where *TodoWhereInput,
) (*TodoConnection, error)

func (*Project) Unwrap

func (pr *Project) Unwrap() *Project

Unwrap unwraps the Project 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 (*Project) Update

func (pr *Project) Update() *ProjectUpdateOne

Update returns a builder for updating this Project. Note that you need to call Project.Unwrap() before calling this method if this Project was returned from a transaction, and the transaction was committed or rolled back.

func (*Project) Value

func (pr *Project) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Project. This includes values selected through modifiers, order, etc.

type ProjectClient

type ProjectClient struct {
	// contains filtered or unexported fields
}

ProjectClient is a client for the Project schema.

func NewProjectClient

func NewProjectClient(c config) *ProjectClient

NewProjectClient returns a client for the Project from the given config.

func (*ProjectClient) Create

func (c *ProjectClient) Create() *ProjectCreate

Create returns a builder for creating a Project entity.

func (*ProjectClient) CreateBulk

func (c *ProjectClient) CreateBulk(builders ...*ProjectCreate) *ProjectCreateBulk

CreateBulk returns a builder for creating a bulk of Project entities.

func (*ProjectClient) Delete

func (c *ProjectClient) Delete() *ProjectDelete

Delete returns a delete builder for Project.

func (*ProjectClient) DeleteOne

func (c *ProjectClient) DeleteOne(pr *Project) *ProjectDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ProjectClient) DeleteOneID

func (c *ProjectClient) DeleteOneID(id int) *ProjectDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ProjectClient) Get

func (c *ProjectClient) Get(ctx context.Context, id int) (*Project, error)

Get returns a Project entity by its id.

func (*ProjectClient) GetX

func (c *ProjectClient) GetX(ctx context.Context, id int) *Project

GetX is like Get, but panics if an error occurs.

func (*ProjectClient) Hooks

func (c *ProjectClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ProjectClient) Intercept

func (c *ProjectClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `project.Intercept(f(g(h())))`.

func (*ProjectClient) Interceptors

func (c *ProjectClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ProjectClient) MapCreateBulk

func (c *ProjectClient) MapCreateBulk(slice any, setFunc func(*ProjectCreate, int)) *ProjectCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*ProjectClient) Query

func (c *ProjectClient) Query() *ProjectQuery

Query returns a query builder for Project.

func (*ProjectClient) QueryTodos

func (c *ProjectClient) QueryTodos(pr *Project) *TodoQuery

QueryTodos queries the todos edge of a Project.

func (*ProjectClient) Update

func (c *ProjectClient) Update() *ProjectUpdate

Update returns an update builder for Project.

func (*ProjectClient) UpdateOne

func (c *ProjectClient) UpdateOne(pr *Project) *ProjectUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ProjectClient) UpdateOneID

func (c *ProjectClient) UpdateOneID(id int) *ProjectUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ProjectClient) Use

func (c *ProjectClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `project.Hooks(f(g(h())))`.

type ProjectConnection

type ProjectConnection struct {
	Edges      []*ProjectEdge `json:"edges"`
	PageInfo   PageInfo       `json:"pageInfo"`
	TotalCount int            `json:"totalCount"`
}

ProjectConnection is the connection containing edges to Project.

type ProjectCreate

type ProjectCreate struct {
	// contains filtered or unexported fields
}

ProjectCreate is the builder for creating a Project entity.

func (*ProjectCreate) AddTodoIDs

func (pc *ProjectCreate) AddTodoIDs(ids ...int) *ProjectCreate

AddTodoIDs adds the "todos" edge to the Todo entity by IDs.

func (*ProjectCreate) AddTodos

func (pc *ProjectCreate) AddTodos(t ...*Todo) *ProjectCreate

AddTodos adds the "todos" edges to the Todo entity.

func (*ProjectCreate) Exec

func (pc *ProjectCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProjectCreate) ExecX

func (pc *ProjectCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProjectCreate) Mutation

func (pc *ProjectCreate) Mutation() *ProjectMutation

Mutation returns the ProjectMutation object of the builder.

func (*ProjectCreate) Save

func (pc *ProjectCreate) Save(ctx context.Context) (*Project, error)

Save creates the Project in the database.

func (*ProjectCreate) SaveX

func (pc *ProjectCreate) SaveX(ctx context.Context) *Project

SaveX calls Save and panics if Save returns an error.

type ProjectCreateBulk

type ProjectCreateBulk struct {
	// contains filtered or unexported fields
}

ProjectCreateBulk is the builder for creating many Project entities in bulk.

func (*ProjectCreateBulk) Exec

func (pcb *ProjectCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ProjectCreateBulk) ExecX

func (pcb *ProjectCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProjectCreateBulk) Save

func (pcb *ProjectCreateBulk) Save(ctx context.Context) ([]*Project, error)

Save creates the Project entities in the database.

func (*ProjectCreateBulk) SaveX

func (pcb *ProjectCreateBulk) SaveX(ctx context.Context) []*Project

SaveX is like Save, but panics if an error occurs.

type ProjectDelete

type ProjectDelete struct {
	// contains filtered or unexported fields
}

ProjectDelete is the builder for deleting a Project entity.

func (*ProjectDelete) Exec

func (pd *ProjectDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ProjectDelete) ExecX

func (pd *ProjectDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ProjectDelete) Where

func (pd *ProjectDelete) Where(ps ...predicate.Project) *ProjectDelete

Where appends a list predicates to the ProjectDelete builder.

type ProjectDeleteOne

type ProjectDeleteOne struct {
	// contains filtered or unexported fields
}

ProjectDeleteOne is the builder for deleting a single Project entity.

func (*ProjectDeleteOne) Exec

func (pdo *ProjectDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ProjectDeleteOne) ExecX

func (pdo *ProjectDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProjectDeleteOne) Where

Where appends a list predicates to the ProjectDelete builder.

type ProjectEdge

type ProjectEdge struct {
	Node   *Project `json:"node"`
	Cursor Cursor   `json:"cursor"`
}

ProjectEdge is the edge representation of Project.

type ProjectEdges

type ProjectEdges struct {
	// Todos holds the value of the todos edge.
	Todos []*Todo `json:"todos,omitempty"`
	// contains filtered or unexported fields
}

ProjectEdges holds the relations/edges for other nodes in the graph.

func (ProjectEdges) TodosOrErr

func (e ProjectEdges) TodosOrErr() ([]*Todo, error)

TodosOrErr returns the Todos value or an error if the edge was not loaded in eager-loading.

type ProjectGroupBy

type ProjectGroupBy struct {
	// contains filtered or unexported fields
}

ProjectGroupBy is the group-by builder for Project entities.

func (*ProjectGroupBy) Aggregate

func (pgb *ProjectGroupBy) Aggregate(fns ...AggregateFunc) *ProjectGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ProjectGroupBy) Bool

func (s *ProjectGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ProjectGroupBy) BoolX

func (s *ProjectGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ProjectGroupBy) Bools

func (s *ProjectGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ProjectGroupBy) BoolsX

func (s *ProjectGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ProjectGroupBy) Float64

func (s *ProjectGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ProjectGroupBy) Float64X

func (s *ProjectGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ProjectGroupBy) Float64s

func (s *ProjectGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ProjectGroupBy) Float64sX

func (s *ProjectGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ProjectGroupBy) Int

func (s *ProjectGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ProjectGroupBy) IntX

func (s *ProjectGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ProjectGroupBy) Ints

func (s *ProjectGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ProjectGroupBy) IntsX

func (s *ProjectGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ProjectGroupBy) Scan

func (pgb *ProjectGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ProjectGroupBy) ScanX

func (s *ProjectGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ProjectGroupBy) String

func (s *ProjectGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ProjectGroupBy) StringX

func (s *ProjectGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ProjectGroupBy) Strings

func (s *ProjectGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ProjectGroupBy) StringsX

func (s *ProjectGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ProjectMutation

type ProjectMutation struct {
	// contains filtered or unexported fields
}

ProjectMutation represents an operation that mutates the Project nodes in the graph.

func (*ProjectMutation) AddField

func (m *ProjectMutation) 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 (*ProjectMutation) AddTodoIDs

func (m *ProjectMutation) AddTodoIDs(ids ...int)

AddTodoIDs adds the "todos" edge to the Todo entity by ids.

func (*ProjectMutation) AddedEdges

func (m *ProjectMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ProjectMutation) AddedField

func (m *ProjectMutation) 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 (*ProjectMutation) AddedFields

func (m *ProjectMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ProjectMutation) AddedIDs

func (m *ProjectMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ProjectMutation) ClearEdge

func (m *ProjectMutation) 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 (*ProjectMutation) ClearField

func (m *ProjectMutation) 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 (*ProjectMutation) ClearTodos

func (m *ProjectMutation) ClearTodos()

ClearTodos clears the "todos" edge to the Todo entity.

func (*ProjectMutation) ClearedEdges

func (m *ProjectMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ProjectMutation) ClearedFields

func (m *ProjectMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ProjectMutation) Client

func (m ProjectMutation) 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 (*ProjectMutation) EdgeCleared

func (m *ProjectMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ProjectMutation) Field

func (m *ProjectMutation) 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 (*ProjectMutation) FieldCleared

func (m *ProjectMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ProjectMutation) Fields

func (m *ProjectMutation) 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 (*ProjectMutation) ID

func (m *ProjectMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*ProjectMutation) IDs

func (m *ProjectMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*ProjectMutation) OldField

func (m *ProjectMutation) 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 (*ProjectMutation) Op

func (m *ProjectMutation) Op() Op

Op returns the operation name.

func (*ProjectMutation) RemoveTodoIDs

func (m *ProjectMutation) RemoveTodoIDs(ids ...int)

RemoveTodoIDs removes the "todos" edge to the Todo entity by IDs.

func (*ProjectMutation) RemovedEdges

func (m *ProjectMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ProjectMutation) RemovedIDs

func (m *ProjectMutation) 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 (*ProjectMutation) RemovedTodosIDs

func (m *ProjectMutation) RemovedTodosIDs() (ids []int)

RemovedTodos returns the removed IDs of the "todos" edge to the Todo entity.

func (*ProjectMutation) ResetEdge

func (m *ProjectMutation) 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 (*ProjectMutation) ResetField

func (m *ProjectMutation) 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 (*ProjectMutation) ResetTodos

func (m *ProjectMutation) ResetTodos()

ResetTodos resets all changes to the "todos" edge.

func (*ProjectMutation) SetField

func (m *ProjectMutation) 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 (*ProjectMutation) SetOp

func (m *ProjectMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ProjectMutation) TodosCleared

func (m *ProjectMutation) TodosCleared() bool

TodosCleared reports if the "todos" edge to the Todo entity was cleared.

func (*ProjectMutation) TodosIDs

func (m *ProjectMutation) TodosIDs() (ids []int)

TodosIDs returns the "todos" edge IDs in the mutation.

func (ProjectMutation) Tx

func (m ProjectMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ProjectMutation) Type

func (m *ProjectMutation) Type() string

Type returns the node type of this mutation (Project).

func (*ProjectMutation) Where

func (m *ProjectMutation) Where(ps ...predicate.Project)

Where appends a list predicates to the ProjectMutation builder.

func (*ProjectMutation) WhereP

func (m *ProjectMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ProjectMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ProjectOrder

type ProjectOrder struct {
	Direction OrderDirection     `json:"direction"`
	Field     *ProjectOrderField `json:"field"`
}

ProjectOrder defines the ordering of Project.

type ProjectOrderField

type ProjectOrderField struct {
	// Value extracts the ordering value from the given Project.
	Value func(*Project) (ent.Value, error)
	// contains filtered or unexported fields
}

ProjectOrderField defines the ordering field of Project.

type ProjectPaginateOption

type ProjectPaginateOption func(*projectPager) error

ProjectPaginateOption enables pagination customization.

func WithProjectFilter

func WithProjectFilter(filter func(*ProjectQuery) (*ProjectQuery, error)) ProjectPaginateOption

WithProjectFilter configures pagination filter.

func WithProjectOrder

func WithProjectOrder(order *ProjectOrder) ProjectPaginateOption

WithProjectOrder configures pagination ordering.

type ProjectQuery

type ProjectQuery struct {
	// contains filtered or unexported fields
}

ProjectQuery is the builder for querying Project entities.

func (*ProjectQuery) Aggregate

func (pq *ProjectQuery) Aggregate(fns ...AggregateFunc) *ProjectSelect

Aggregate returns a ProjectSelect configured with the given aggregations.

func (*ProjectQuery) All

func (pq *ProjectQuery) All(ctx context.Context) ([]*Project, error)

All executes the query and returns a list of Projects.

func (*ProjectQuery) AllX

func (pq *ProjectQuery) AllX(ctx context.Context) []*Project

AllX is like All, but panics if an error occurs.

func (*ProjectQuery) Clone

func (pq *ProjectQuery) Clone() *ProjectQuery

Clone returns a duplicate of the ProjectQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ProjectQuery) CollectFields

func (pr *ProjectQuery) CollectFields(ctx context.Context, satisfies ...string) (*ProjectQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*ProjectQuery) Count

func (pq *ProjectQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ProjectQuery) CountX

func (pq *ProjectQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ProjectQuery) Exist

func (pq *ProjectQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ProjectQuery) ExistX

func (pq *ProjectQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ProjectQuery) First

func (pq *ProjectQuery) First(ctx context.Context) (*Project, error)

First returns the first Project entity from the query. Returns a *NotFoundError when no Project was found.

func (*ProjectQuery) FirstID

func (pq *ProjectQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Project ID from the query. Returns a *NotFoundError when no Project ID was found.

func (*ProjectQuery) FirstIDX

func (pq *ProjectQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*ProjectQuery) FirstX

func (pq *ProjectQuery) FirstX(ctx context.Context) *Project

FirstX is like First, but panics if an error occurs.

func (*ProjectQuery) GroupBy

func (pq *ProjectQuery) GroupBy(field string, fields ...string) *ProjectGroupBy

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.

func (*ProjectQuery) IDs

func (pq *ProjectQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Project IDs.

func (*ProjectQuery) IDsX

func (pq *ProjectQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*ProjectQuery) Limit

func (pq *ProjectQuery) Limit(limit int) *ProjectQuery

Limit the number of records to be returned by this query.

func (*ProjectQuery) Modify

func (pq *ProjectQuery) Modify(modifiers ...func(s *sql.Selector)) *ProjectSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*ProjectQuery) Offset

func (pq *ProjectQuery) Offset(offset int) *ProjectQuery

Offset to start from.

func (*ProjectQuery) Only

func (pq *ProjectQuery) Only(ctx context.Context) (*Project, error)

Only returns a single Project entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Project entity is found. Returns a *NotFoundError when no Project entities are found.

func (*ProjectQuery) OnlyID

func (pq *ProjectQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Project ID in the query. Returns a *NotSingularError when more than one Project ID is found. Returns a *NotFoundError when no entities are found.

func (*ProjectQuery) OnlyIDX

func (pq *ProjectQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ProjectQuery) OnlyX

func (pq *ProjectQuery) OnlyX(ctx context.Context) *Project

OnlyX is like Only, but panics if an error occurs.

func (*ProjectQuery) Order

func (pq *ProjectQuery) Order(o ...project.OrderOption) *ProjectQuery

Order specifies how the records should be ordered.

func (*ProjectQuery) Paginate

func (pr *ProjectQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...ProjectPaginateOption,
) (*ProjectConnection, error)

Paginate executes the query and returns a relay based cursor connection to Project.

func (*ProjectQuery) QueryTodos

func (pq *ProjectQuery) QueryTodos() *TodoQuery

QueryTodos chains the current query on the "todos" edge.

func (*ProjectQuery) Select

func (pq *ProjectQuery) Select(fields ...string) *ProjectSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

func (*ProjectQuery) Unique

func (pq *ProjectQuery) Unique(unique bool) *ProjectQuery

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 (*ProjectQuery) Where

func (pq *ProjectQuery) Where(ps ...predicate.Project) *ProjectQuery

Where adds a new predicate for the ProjectQuery builder.

func (*ProjectQuery) WithNamedTodos

func (pq *ProjectQuery) WithNamedTodos(name string, opts ...func(*TodoQuery)) *ProjectQuery

WithNamedTodos tells the query-builder to eager-load the nodes that are connected to the "todos" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*ProjectQuery) WithTodos

func (pq *ProjectQuery) WithTodos(opts ...func(*TodoQuery)) *ProjectQuery

WithTodos tells the query-builder to eager-load the nodes that are connected to the "todos" edge. The optional arguments are used to configure the query builder of the edge.

type ProjectSelect

type ProjectSelect struct {
	*ProjectQuery
	// contains filtered or unexported fields
}

ProjectSelect is the builder for selecting fields of Project entities.

func (*ProjectSelect) Aggregate

func (ps *ProjectSelect) Aggregate(fns ...AggregateFunc) *ProjectSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ProjectSelect) Bool

func (s *ProjectSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ProjectSelect) BoolX

func (s *ProjectSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ProjectSelect) Bools

func (s *ProjectSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ProjectSelect) BoolsX

func (s *ProjectSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ProjectSelect) Float64

func (s *ProjectSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ProjectSelect) Float64X

func (s *ProjectSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ProjectSelect) Float64s

func (s *ProjectSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ProjectSelect) Float64sX

func (s *ProjectSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ProjectSelect) Int

func (s *ProjectSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ProjectSelect) IntX

func (s *ProjectSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ProjectSelect) Ints

func (s *ProjectSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ProjectSelect) IntsX

func (s *ProjectSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ProjectSelect) Modify

func (ps *ProjectSelect) Modify(modifiers ...func(s *sql.Selector)) *ProjectSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*ProjectSelect) Scan

func (ps *ProjectSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ProjectSelect) ScanX

func (s *ProjectSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ProjectSelect) String

func (s *ProjectSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ProjectSelect) StringX

func (s *ProjectSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ProjectSelect) Strings

func (s *ProjectSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ProjectSelect) StringsX

func (s *ProjectSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ProjectUpdate

type ProjectUpdate struct {
	// contains filtered or unexported fields
}

ProjectUpdate is the builder for updating Project entities.

func (*ProjectUpdate) AddTodoIDs

func (pu *ProjectUpdate) AddTodoIDs(ids ...int) *ProjectUpdate

AddTodoIDs adds the "todos" edge to the Todo entity by IDs.

func (*ProjectUpdate) AddTodos

func (pu *ProjectUpdate) AddTodos(t ...*Todo) *ProjectUpdate

AddTodos adds the "todos" edges to the Todo entity.

func (*ProjectUpdate) ClearTodos

func (pu *ProjectUpdate) ClearTodos() *ProjectUpdate

ClearTodos clears all "todos" edges to the Todo entity.

func (*ProjectUpdate) Exec

func (pu *ProjectUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProjectUpdate) ExecX

func (pu *ProjectUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProjectUpdate) Modify

func (pu *ProjectUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *ProjectUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*ProjectUpdate) Mutation

func (pu *ProjectUpdate) Mutation() *ProjectMutation

Mutation returns the ProjectMutation object of the builder.

func (*ProjectUpdate) RemoveTodoIDs

func (pu *ProjectUpdate) RemoveTodoIDs(ids ...int) *ProjectUpdate

RemoveTodoIDs removes the "todos" edge to Todo entities by IDs.

func (*ProjectUpdate) RemoveTodos

func (pu *ProjectUpdate) RemoveTodos(t ...*Todo) *ProjectUpdate

RemoveTodos removes "todos" edges to Todo entities.

func (*ProjectUpdate) Save

func (pu *ProjectUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ProjectUpdate) SaveX

func (pu *ProjectUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ProjectUpdate) Where

func (pu *ProjectUpdate) Where(ps ...predicate.Project) *ProjectUpdate

Where appends a list predicates to the ProjectUpdate builder.

type ProjectUpdateOne

type ProjectUpdateOne struct {
	// contains filtered or unexported fields
}

ProjectUpdateOne is the builder for updating a single Project entity.

func (*ProjectUpdateOne) AddTodoIDs

func (puo *ProjectUpdateOne) AddTodoIDs(ids ...int) *ProjectUpdateOne

AddTodoIDs adds the "todos" edge to the Todo entity by IDs.

func (*ProjectUpdateOne) AddTodos

func (puo *ProjectUpdateOne) AddTodos(t ...*Todo) *ProjectUpdateOne

AddTodos adds the "todos" edges to the Todo entity.

func (*ProjectUpdateOne) ClearTodos

func (puo *ProjectUpdateOne) ClearTodos() *ProjectUpdateOne

ClearTodos clears all "todos" edges to the Todo entity.

func (*ProjectUpdateOne) Exec

func (puo *ProjectUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ProjectUpdateOne) ExecX

func (puo *ProjectUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProjectUpdateOne) Modify

func (puo *ProjectUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *ProjectUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*ProjectUpdateOne) Mutation

func (puo *ProjectUpdateOne) Mutation() *ProjectMutation

Mutation returns the ProjectMutation object of the builder.

func (*ProjectUpdateOne) RemoveTodoIDs

func (puo *ProjectUpdateOne) RemoveTodoIDs(ids ...int) *ProjectUpdateOne

RemoveTodoIDs removes the "todos" edge to Todo entities by IDs.

func (*ProjectUpdateOne) RemoveTodos

func (puo *ProjectUpdateOne) RemoveTodos(t ...*Todo) *ProjectUpdateOne

RemoveTodos removes "todos" edges to Todo entities.

func (*ProjectUpdateOne) Save

func (puo *ProjectUpdateOne) Save(ctx context.Context) (*Project, error)

Save executes the query and returns the updated Project entity.

func (*ProjectUpdateOne) SaveX

func (puo *ProjectUpdateOne) SaveX(ctx context.Context) *Project

SaveX is like Save, but panics if an error occurs.

func (*ProjectUpdateOne) Select

func (puo *ProjectUpdateOne) Select(field string, fields ...string) *ProjectUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ProjectUpdateOne) Where

Where appends a list predicates to the ProjectUpdate builder.

type ProjectWhereInput

type ProjectWhereInput struct {
	Predicates []predicate.Project  `json:"-"`
	Not        *ProjectWhereInput   `json:"not,omitempty"`
	Or         []*ProjectWhereInput `json:"or,omitempty"`
	And        []*ProjectWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *int  `json:"id,omitempty"`
	IDNEQ   *int  `json:"idNEQ,omitempty"`
	IDIn    []int `json:"idIn,omitempty"`
	IDNotIn []int `json:"idNotIn,omitempty"`
	IDGT    *int  `json:"idGT,omitempty"`
	IDGTE   *int  `json:"idGTE,omitempty"`
	IDLT    *int  `json:"idLT,omitempty"`
	IDLTE   *int  `json:"idLTE,omitempty"`

	// "todos" edge predicates.
	HasTodos     *bool             `json:"hasTodos,omitempty"`
	HasTodosWith []*TodoWhereInput `json:"hasTodosWith,omitempty"`
}

ProjectWhereInput represents a where input for filtering Project queries.

func (*ProjectWhereInput) AddPredicates

func (i *ProjectWhereInput) AddPredicates(predicates ...predicate.Project)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*ProjectWhereInput) Filter

Filter applies the ProjectWhereInput filter on the ProjectQuery builder.

func (*ProjectWhereInput) P

P returns a predicate for filtering projects. An error is returned if the input is empty or invalid.

type Projects

type Projects []*Project

Projects is a parsable slice of Project.

type Querier

type Querier = ent.Querier

ent aliases to avoid import conflicts in user's code.

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflicts in user's code.

type QueryContext

type QueryContext = ent.QueryContext

ent aliases to avoid import conflicts in user's code.

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type Todo

type Todo struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Status holds the value of the "status" field.
	Status todo.Status `json:"status,omitempty"`
	// Priority holds the value of the "priority" field.
	Priority int `json:"priority,omitempty"`
	// Text holds the value of the "text" field.
	Text string `json:"text,omitempty"`
	// Blob holds the value of the "blob" field.
	Blob []byte `json:"blob,omitempty"`
	// CategoryID holds the value of the "category_id" field.
	CategoryID int `json:"category_id,omitempty"`
	// Init holds the value of the "init" field.
	Init map[string]interface{} `json:"init,omitempty"`
	// Custom holds the value of the "custom" field.
	Custom []customstruct.Custom `json:"custom,omitempty"`
	// Customp holds the value of the "customp" field.
	Customp []*customstruct.Custom `json:"customp,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TodoQuery when eager-loading is set.
	Edges TodoEdges `json:"edges"`
	// contains filtered or unexported fields
}

Todo is the model entity for the Todo schema.

func (*Todo) Category

func (t *Todo) Category(ctx context.Context) (*Category, error)

func (*Todo) Children

func (t *Todo) Children(
	ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, orderBy []*TodoOrder, where *TodoWhereInput,
) (*TodoConnection, error)

func (*Todo) IsNode

func (*Todo) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*Todo) NamedChildren

func (t *Todo) NamedChildren(name string) ([]*Todo, error)

NamedChildren returns the Children named value or an error if the edge was not loaded in eager-loading with this name.

func (*Todo) Node

func (t *Todo) Node(ctx context.Context) (node *Node, err error)

Node implements Noder interface

func (*Todo) Parent

func (t *Todo) Parent(ctx context.Context) (*Todo, error)

func (*Todo) QueryCategory

func (t *Todo) QueryCategory() *CategoryQuery

QueryCategory queries the "category" edge of the Todo entity.

func (*Todo) QueryChildren

func (t *Todo) QueryChildren() *TodoQuery

QueryChildren queries the "children" edge of the Todo entity.

func (*Todo) QueryParent

func (t *Todo) QueryParent() *TodoQuery

QueryParent queries the "parent" edge of the Todo entity.

func (*Todo) QuerySecret

func (t *Todo) QuerySecret() *VerySecretQuery

QuerySecret queries the "secret" edge of the Todo entity.

func (*Todo) String

func (t *Todo) String() string

String implements the fmt.Stringer.

func (*Todo) ToEdge

func (t *Todo) ToEdge(order *TodoOrder) *TodoEdge

ToEdge converts Todo into TodoEdge.

func (*Todo) Unwrap

func (t *Todo) Unwrap() *Todo

Unwrap unwraps the Todo 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 (*Todo) Update

func (t *Todo) Update() *TodoUpdateOne

Update returns a builder for updating this Todo. Note that you need to call Todo.Unwrap() before calling this method if this Todo was returned from a transaction, and the transaction was committed or rolled back.

func (*Todo) Value

func (t *Todo) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Todo. This includes values selected through modifiers, order, etc.

type TodoClient

type TodoClient struct {
	// contains filtered or unexported fields
}

TodoClient is a client for the Todo schema.

func NewTodoClient

func NewTodoClient(c config) *TodoClient

NewTodoClient returns a client for the Todo from the given config.

func (*TodoClient) Create

func (c *TodoClient) Create() *TodoCreate

Create returns a builder for creating a Todo entity.

func (*TodoClient) CreateBulk

func (c *TodoClient) CreateBulk(builders ...*TodoCreate) *TodoCreateBulk

CreateBulk returns a builder for creating a bulk of Todo entities.

func (*TodoClient) Delete

func (c *TodoClient) Delete() *TodoDelete

Delete returns a delete builder for Todo.

func (*TodoClient) DeleteOne

func (c *TodoClient) DeleteOne(t *Todo) *TodoDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TodoClient) DeleteOneID

func (c *TodoClient) DeleteOneID(id int) *TodoDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*TodoClient) Get

func (c *TodoClient) Get(ctx context.Context, id int) (*Todo, error)

Get returns a Todo entity by its id.

func (*TodoClient) GetX

func (c *TodoClient) GetX(ctx context.Context, id int) *Todo

GetX is like Get, but panics if an error occurs.

func (*TodoClient) Hooks

func (c *TodoClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TodoClient) Intercept

func (c *TodoClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `todo.Intercept(f(g(h())))`.

func (*TodoClient) Interceptors

func (c *TodoClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*TodoClient) MapCreateBulk

func (c *TodoClient) MapCreateBulk(slice any, setFunc func(*TodoCreate, int)) *TodoCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*TodoClient) Query

func (c *TodoClient) Query() *TodoQuery

Query returns a query builder for Todo.

func (*TodoClient) QueryCategory

func (c *TodoClient) QueryCategory(t *Todo) *CategoryQuery

QueryCategory queries the category edge of a Todo.

func (*TodoClient) QueryChildren

func (c *TodoClient) QueryChildren(t *Todo) *TodoQuery

QueryChildren queries the children edge of a Todo.

func (*TodoClient) QueryParent

func (c *TodoClient) QueryParent(t *Todo) *TodoQuery

QueryParent queries the parent edge of a Todo.

func (*TodoClient) QuerySecret

func (c *TodoClient) QuerySecret(t *Todo) *VerySecretQuery

QuerySecret queries the secret edge of a Todo.

func (*TodoClient) Update

func (c *TodoClient) Update() *TodoUpdate

Update returns an update builder for Todo.

func (*TodoClient) UpdateOne

func (c *TodoClient) UpdateOne(t *Todo) *TodoUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TodoClient) UpdateOneID

func (c *TodoClient) UpdateOneID(id int) *TodoUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TodoClient) Use

func (c *TodoClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `todo.Hooks(f(g(h())))`.

type TodoConnection

type TodoConnection struct {
	Edges      []*TodoEdge `json:"edges"`
	PageInfo   PageInfo    `json:"pageInfo"`
	TotalCount int         `json:"totalCount"`
}

TodoConnection is the connection containing edges to Todo.

type TodoCreate

type TodoCreate struct {
	// contains filtered or unexported fields
}

TodoCreate is the builder for creating a Todo entity.

func (*TodoCreate) AddChildIDs

func (tc *TodoCreate) AddChildIDs(ids ...int) *TodoCreate

AddChildIDs adds the "children" edge to the Todo entity by IDs.

func (*TodoCreate) AddChildren

func (tc *TodoCreate) AddChildren(t ...*Todo) *TodoCreate

AddChildren adds the "children" edges to the Todo entity.

func (*TodoCreate) Exec

func (tc *TodoCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TodoCreate) ExecX

func (tc *TodoCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TodoCreate) Mutation

func (tc *TodoCreate) Mutation() *TodoMutation

Mutation returns the TodoMutation object of the builder.

func (*TodoCreate) Save

func (tc *TodoCreate) Save(ctx context.Context) (*Todo, error)

Save creates the Todo in the database.

func (*TodoCreate) SaveX

func (tc *TodoCreate) SaveX(ctx context.Context) *Todo

SaveX calls Save and panics if Save returns an error.

func (*TodoCreate) SetBlob

func (tc *TodoCreate) SetBlob(b []byte) *TodoCreate

SetBlob sets the "blob" field.

func (*TodoCreate) SetCategory

func (tc *TodoCreate) SetCategory(c *Category) *TodoCreate

SetCategory sets the "category" edge to the Category entity.

func (*TodoCreate) SetCategoryID

func (tc *TodoCreate) SetCategoryID(i int) *TodoCreate

SetCategoryID sets the "category_id" field.

func (*TodoCreate) SetCreatedAt

func (tc *TodoCreate) SetCreatedAt(t time.Time) *TodoCreate

SetCreatedAt sets the "created_at" field.

func (*TodoCreate) SetCustom

func (tc *TodoCreate) SetCustom(c []customstruct.Custom) *TodoCreate

SetCustom sets the "custom" field.

func (*TodoCreate) SetCustomp

func (tc *TodoCreate) SetCustomp(c []*customstruct.Custom) *TodoCreate

SetCustomp sets the "customp" field.

func (*TodoCreate) SetInit

func (tc *TodoCreate) SetInit(m map[string]interface{}) *TodoCreate

SetInit sets the "init" field.

func (*TodoCreate) SetInput

func (c *TodoCreate) SetInput(i CreateTodoInput) *TodoCreate

SetInput applies the change-set in the CreateTodoInput on the TodoCreate builder.

func (*TodoCreate) SetNillableCategoryID

func (tc *TodoCreate) SetNillableCategoryID(i *int) *TodoCreate

SetNillableCategoryID sets the "category_id" field if the given value is not nil.

func (*TodoCreate) SetNillableCreatedAt

func (tc *TodoCreate) SetNillableCreatedAt(t *time.Time) *TodoCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*TodoCreate) SetNillableParentID

func (tc *TodoCreate) SetNillableParentID(id *int) *TodoCreate

SetNillableParentID sets the "parent" edge to the Todo entity by ID if the given value is not nil.

func (*TodoCreate) SetNillablePriority

func (tc *TodoCreate) SetNillablePriority(i *int) *TodoCreate

SetNillablePriority sets the "priority" field if the given value is not nil.

func (*TodoCreate) SetNillableSecretID

func (tc *TodoCreate) SetNillableSecretID(id *int) *TodoCreate

SetNillableSecretID sets the "secret" edge to the VerySecret entity by ID if the given value is not nil.

func (*TodoCreate) SetParent

func (tc *TodoCreate) SetParent(t *Todo) *TodoCreate

SetParent sets the "parent" edge to the Todo entity.

func (*TodoCreate) SetParentID

func (tc *TodoCreate) SetParentID(id int) *TodoCreate

SetParentID sets the "parent" edge to the Todo entity by ID.

func (*TodoCreate) SetPriority

func (tc *TodoCreate) SetPriority(i int) *TodoCreate

SetPriority sets the "priority" field.

func (*TodoCreate) SetSecret

func (tc *TodoCreate) SetSecret(v *VerySecret) *TodoCreate

SetSecret sets the "secret" edge to the VerySecret entity.

func (*TodoCreate) SetSecretID

func (tc *TodoCreate) SetSecretID(id int) *TodoCreate

SetSecretID sets the "secret" edge to the VerySecret entity by ID.

func (*TodoCreate) SetStatus

func (tc *TodoCreate) SetStatus(t todo.Status) *TodoCreate

SetStatus sets the "status" field.

func (*TodoCreate) SetText

func (tc *TodoCreate) SetText(s string) *TodoCreate

SetText sets the "text" field.

type TodoCreateBulk

type TodoCreateBulk struct {
	// contains filtered or unexported fields
}

TodoCreateBulk is the builder for creating many Todo entities in bulk.

func (*TodoCreateBulk) Exec

func (tcb *TodoCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TodoCreateBulk) ExecX

func (tcb *TodoCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TodoCreateBulk) Save

func (tcb *TodoCreateBulk) Save(ctx context.Context) ([]*Todo, error)

Save creates the Todo entities in the database.

func (*TodoCreateBulk) SaveX

func (tcb *TodoCreateBulk) SaveX(ctx context.Context) []*Todo

SaveX is like Save, but panics if an error occurs.

type TodoDelete

type TodoDelete struct {
	// contains filtered or unexported fields
}

TodoDelete is the builder for deleting a Todo entity.

func (*TodoDelete) Exec

func (td *TodoDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TodoDelete) ExecX

func (td *TodoDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TodoDelete) Where

func (td *TodoDelete) Where(ps ...predicate.Todo) *TodoDelete

Where appends a list predicates to the TodoDelete builder.

type TodoDeleteOne

type TodoDeleteOne struct {
	// contains filtered or unexported fields
}

TodoDeleteOne is the builder for deleting a single Todo entity.

func (*TodoDeleteOne) Exec

func (tdo *TodoDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TodoDeleteOne) ExecX

func (tdo *TodoDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TodoDeleteOne) Where

func (tdo *TodoDeleteOne) Where(ps ...predicate.Todo) *TodoDeleteOne

Where appends a list predicates to the TodoDelete builder.

type TodoEdge

type TodoEdge struct {
	Node   *Todo  `json:"node"`
	Cursor Cursor `json:"cursor"`
}

TodoEdge is the edge representation of Todo.

type TodoEdges

type TodoEdges struct {
	// Parent holds the value of the parent edge.
	Parent *Todo `json:"parent,omitempty"`
	// Children holds the value of the children edge.
	Children []*Todo `json:"children,omitempty"`
	// Category holds the value of the category edge.
	Category *Category `json:"category,omitempty"`
	// Secret holds the value of the secret edge.
	Secret *VerySecret `json:"secret,omitempty"`
	// contains filtered or unexported fields
}

TodoEdges holds the relations/edges for other nodes in the graph.

func (TodoEdges) CategoryOrErr

func (e TodoEdges) CategoryOrErr() (*Category, error)

CategoryOrErr returns the Category value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (TodoEdges) ChildrenOrErr

func (e TodoEdges) ChildrenOrErr() ([]*Todo, error)

ChildrenOrErr returns the Children value or an error if the edge was not loaded in eager-loading.

func (TodoEdges) ParentOrErr

func (e TodoEdges) ParentOrErr() (*Todo, error)

ParentOrErr returns the Parent value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (TodoEdges) SecretOrErr

func (e TodoEdges) SecretOrErr() (*VerySecret, error)

SecretOrErr returns the Secret value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type TodoGroupBy

type TodoGroupBy struct {
	// contains filtered or unexported fields
}

TodoGroupBy is the group-by builder for Todo entities.

func (*TodoGroupBy) Aggregate

func (tgb *TodoGroupBy) Aggregate(fns ...AggregateFunc) *TodoGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*TodoGroupBy) Bool

func (s *TodoGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TodoGroupBy) BoolX

func (s *TodoGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TodoGroupBy) Bools

func (s *TodoGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TodoGroupBy) BoolsX

func (s *TodoGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TodoGroupBy) Float64

func (s *TodoGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TodoGroupBy) Float64X

func (s *TodoGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TodoGroupBy) Float64s

func (s *TodoGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TodoGroupBy) Float64sX

func (s *TodoGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TodoGroupBy) Int

func (s *TodoGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TodoGroupBy) IntX

func (s *TodoGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TodoGroupBy) Ints

func (s *TodoGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TodoGroupBy) IntsX

func (s *TodoGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TodoGroupBy) Scan

func (tgb *TodoGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TodoGroupBy) ScanX

func (s *TodoGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TodoGroupBy) String

func (s *TodoGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TodoGroupBy) StringX

func (s *TodoGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TodoGroupBy) Strings

func (s *TodoGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TodoGroupBy) StringsX

func (s *TodoGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TodoMutation

type TodoMutation struct {
	// contains filtered or unexported fields
}

TodoMutation represents an operation that mutates the Todo nodes in the graph.

func (*TodoMutation) AddChildIDs

func (m *TodoMutation) AddChildIDs(ids ...int)

AddChildIDs adds the "children" edge to the Todo entity by ids.

func (*TodoMutation) AddField

func (m *TodoMutation) 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 (*TodoMutation) AddPriority

func (m *TodoMutation) AddPriority(i int)

AddPriority adds i to the "priority" field.

func (*TodoMutation) AddedEdges

func (m *TodoMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TodoMutation) AddedField

func (m *TodoMutation) 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 (*TodoMutation) AddedFields

func (m *TodoMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TodoMutation) AddedIDs

func (m *TodoMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TodoMutation) AddedPriority

func (m *TodoMutation) AddedPriority() (r int, exists bool)

AddedPriority returns the value that was added to the "priority" field in this mutation.

func (*TodoMutation) AppendCustom

func (m *TodoMutation) AppendCustom(c []customstruct.Custom)

AppendCustom adds c to the "custom" field.

func (*TodoMutation) AppendCustomp

func (m *TodoMutation) AppendCustomp(c []*customstruct.Custom)

AppendCustomp adds c to the "customp" field.

func (*TodoMutation) AppendedCustom

func (m *TodoMutation) AppendedCustom() ([]customstruct.Custom, bool)

AppendedCustom returns the list of values that were appended to the "custom" field in this mutation.

func (*TodoMutation) AppendedCustomp

func (m *TodoMutation) AppendedCustomp() ([]*customstruct.Custom, bool)

AppendedCustomp returns the list of values that were appended to the "customp" field in this mutation.

func (*TodoMutation) Blob

func (m *TodoMutation) Blob() (r []byte, exists bool)

Blob returns the value of the "blob" field in the mutation.

func (*TodoMutation) BlobCleared

func (m *TodoMutation) BlobCleared() bool

BlobCleared returns if the "blob" field was cleared in this mutation.

func (*TodoMutation) CategoryCleared

func (m *TodoMutation) CategoryCleared() bool

CategoryCleared reports if the "category" edge to the Category entity was cleared.

func (*TodoMutation) CategoryID

func (m *TodoMutation) CategoryID() (r int, exists bool)

CategoryID returns the value of the "category_id" field in the mutation.

func (*TodoMutation) CategoryIDCleared

func (m *TodoMutation) CategoryIDCleared() bool

CategoryIDCleared returns if the "category_id" field was cleared in this mutation.

func (*TodoMutation) CategoryIDs

func (m *TodoMutation) CategoryIDs() (ids []int)

CategoryIDs returns the "category" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CategoryID instead. It exists only for internal usage by the builders.

func (*TodoMutation) ChildrenCleared

func (m *TodoMutation) ChildrenCleared() bool

ChildrenCleared reports if the "children" edge to the Todo entity was cleared.

func (*TodoMutation) ChildrenIDs

func (m *TodoMutation) ChildrenIDs() (ids []int)

ChildrenIDs returns the "children" edge IDs in the mutation.

func (*TodoMutation) ClearBlob

func (m *TodoMutation) ClearBlob()

ClearBlob clears the value of the "blob" field.

func (*TodoMutation) ClearCategory

func (m *TodoMutation) ClearCategory()

ClearCategory clears the "category" edge to the Category entity.

func (*TodoMutation) ClearCategoryID

func (m *TodoMutation) ClearCategoryID()

ClearCategoryID clears the value of the "category_id" field.

func (*TodoMutation) ClearChildren

func (m *TodoMutation) ClearChildren()

ClearChildren clears the "children" edge to the Todo entity.

func (*TodoMutation) ClearCustom

func (m *TodoMutation) ClearCustom()

ClearCustom clears the value of the "custom" field.

func (*TodoMutation) ClearCustomp

func (m *TodoMutation) ClearCustomp()

ClearCustomp clears the value of the "customp" field.

func (*TodoMutation) ClearEdge

func (m *TodoMutation) 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 (*TodoMutation) ClearField

func (m *TodoMutation) 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 (*TodoMutation) ClearInit

func (m *TodoMutation) ClearInit()

ClearInit clears the value of the "init" field.

func (*TodoMutation) ClearParent

func (m *TodoMutation) ClearParent()

ClearParent clears the "parent" edge to the Todo entity.

func (*TodoMutation) ClearSecret

func (m *TodoMutation) ClearSecret()

ClearSecret clears the "secret" edge to the VerySecret entity.

func (*TodoMutation) ClearedEdges

func (m *TodoMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TodoMutation) ClearedFields

func (m *TodoMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TodoMutation) Client

func (m TodoMutation) 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 (*TodoMutation) CreatedAt

func (m *TodoMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*TodoMutation) Custom

func (m *TodoMutation) Custom() (r []customstruct.Custom, exists bool)

Custom returns the value of the "custom" field in the mutation.

func (*TodoMutation) CustomCleared

func (m *TodoMutation) CustomCleared() bool

CustomCleared returns if the "custom" field was cleared in this mutation.

func (*TodoMutation) Customp

func (m *TodoMutation) Customp() (r []*customstruct.Custom, exists bool)

Customp returns the value of the "customp" field in the mutation.

func (*TodoMutation) CustompCleared

func (m *TodoMutation) CustompCleared() bool

CustompCleared returns if the "customp" field was cleared in this mutation.

func (*TodoMutation) EdgeCleared

func (m *TodoMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TodoMutation) Field

func (m *TodoMutation) 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 (*TodoMutation) FieldCleared

func (m *TodoMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TodoMutation) Fields

func (m *TodoMutation) 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 (*TodoMutation) ID

func (m *TodoMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*TodoMutation) IDs

func (m *TodoMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*TodoMutation) Init

func (m *TodoMutation) Init() (r map[string]interface{}, exists bool)

Init returns the value of the "init" field in the mutation.

func (*TodoMutation) InitCleared

func (m *TodoMutation) InitCleared() bool

InitCleared returns if the "init" field was cleared in this mutation.

func (*TodoMutation) OldBlob

func (m *TodoMutation) OldBlob(ctx context.Context) (v []byte, err error)

OldBlob returns the old "blob" field's value of the Todo entity. If the Todo 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 (*TodoMutation) OldCategoryID

func (m *TodoMutation) OldCategoryID(ctx context.Context) (v int, err error)

OldCategoryID returns the old "category_id" field's value of the Todo entity. If the Todo 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 (*TodoMutation) OldCreatedAt

func (m *TodoMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Todo entity. If the Todo 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 (*TodoMutation) OldCustom

func (m *TodoMutation) OldCustom(ctx context.Context) (v []customstruct.Custom, err error)

OldCustom returns the old "custom" field's value of the Todo entity. If the Todo 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 (*TodoMutation) OldCustomp

func (m *TodoMutation) OldCustomp(ctx context.Context) (v []*customstruct.Custom, err error)

OldCustomp returns the old "customp" field's value of the Todo entity. If the Todo 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 (*TodoMutation) OldField

func (m *TodoMutation) 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 (*TodoMutation) OldInit

func (m *TodoMutation) OldInit(ctx context.Context) (v map[string]interface{}, err error)

OldInit returns the old "init" field's value of the Todo entity. If the Todo 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 (*TodoMutation) OldPriority

func (m *TodoMutation) OldPriority(ctx context.Context) (v int, err error)

OldPriority returns the old "priority" field's value of the Todo entity. If the Todo 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 (*TodoMutation) OldStatus

func (m *TodoMutation) OldStatus(ctx context.Context) (v todo.Status, err error)

OldStatus returns the old "status" field's value of the Todo entity. If the Todo 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 (*TodoMutation) OldText

func (m *TodoMutation) OldText(ctx context.Context) (v string, err error)

OldText returns the old "text" field's value of the Todo entity. If the Todo 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 (*TodoMutation) Op

func (m *TodoMutation) Op() Op

Op returns the operation name.

func (*TodoMutation) ParentCleared

func (m *TodoMutation) ParentCleared() bool

ParentCleared reports if the "parent" edge to the Todo entity was cleared.

func (*TodoMutation) ParentID

func (m *TodoMutation) ParentID() (id int, exists bool)

ParentID returns the "parent" edge ID in the mutation.

func (*TodoMutation) ParentIDs

func (m *TodoMutation) ParentIDs() (ids []int)

ParentIDs returns the "parent" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ParentID instead. It exists only for internal usage by the builders.

func (*TodoMutation) Priority

func (m *TodoMutation) Priority() (r int, exists bool)

Priority returns the value of the "priority" field in the mutation.

func (*TodoMutation) RemoveChildIDs

func (m *TodoMutation) RemoveChildIDs(ids ...int)

RemoveChildIDs removes the "children" edge to the Todo entity by IDs.

func (*TodoMutation) RemovedChildrenIDs

func (m *TodoMutation) RemovedChildrenIDs() (ids []int)

RemovedChildren returns the removed IDs of the "children" edge to the Todo entity.

func (*TodoMutation) RemovedEdges

func (m *TodoMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TodoMutation) RemovedIDs

func (m *TodoMutation) 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 (*TodoMutation) ResetBlob

func (m *TodoMutation) ResetBlob()

ResetBlob resets all changes to the "blob" field.

func (*TodoMutation) ResetCategory

func (m *TodoMutation) ResetCategory()

ResetCategory resets all changes to the "category" edge.

func (*TodoMutation) ResetCategoryID

func (m *TodoMutation) ResetCategoryID()

ResetCategoryID resets all changes to the "category_id" field.

func (*TodoMutation) ResetChildren

func (m *TodoMutation) ResetChildren()

ResetChildren resets all changes to the "children" edge.

func (*TodoMutation) ResetCreatedAt

func (m *TodoMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*TodoMutation) ResetCustom

func (m *TodoMutation) ResetCustom()

ResetCustom resets all changes to the "custom" field.

func (*TodoMutation) ResetCustomp

func (m *TodoMutation) ResetCustomp()

ResetCustomp resets all changes to the "customp" field.

func (*TodoMutation) ResetEdge

func (m *TodoMutation) 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 (*TodoMutation) ResetField

func (m *TodoMutation) 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 (*TodoMutation) ResetInit

func (m *TodoMutation) ResetInit()

ResetInit resets all changes to the "init" field.

func (*TodoMutation) ResetParent

func (m *TodoMutation) ResetParent()

ResetParent resets all changes to the "parent" edge.

func (*TodoMutation) ResetPriority

func (m *TodoMutation) ResetPriority()

ResetPriority resets all changes to the "priority" field.

func (*TodoMutation) ResetSecret

func (m *TodoMutation) ResetSecret()

ResetSecret resets all changes to the "secret" edge.

func (*TodoMutation) ResetStatus

func (m *TodoMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*TodoMutation) ResetText

func (m *TodoMutation) ResetText()

ResetText resets all changes to the "text" field.

func (*TodoMutation) SecretCleared

func (m *TodoMutation) SecretCleared() bool

SecretCleared reports if the "secret" edge to the VerySecret entity was cleared.

func (*TodoMutation) SecretID

func (m *TodoMutation) SecretID() (id int, exists bool)

SecretID returns the "secret" edge ID in the mutation.

func (*TodoMutation) SecretIDs

func (m *TodoMutation) SecretIDs() (ids []int)

SecretIDs returns the "secret" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use SecretID instead. It exists only for internal usage by the builders.

func (*TodoMutation) SetBlob

func (m *TodoMutation) SetBlob(b []byte)

SetBlob sets the "blob" field.

func (*TodoMutation) SetCategoryID

func (m *TodoMutation) SetCategoryID(i int)

SetCategoryID sets the "category_id" field.

func (*TodoMutation) SetCreatedAt

func (m *TodoMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*TodoMutation) SetCustom

func (m *TodoMutation) SetCustom(c []customstruct.Custom)

SetCustom sets the "custom" field.

func (*TodoMutation) SetCustomp

func (m *TodoMutation) SetCustomp(c []*customstruct.Custom)

SetCustomp sets the "customp" field.

func (*TodoMutation) SetField

func (m *TodoMutation) 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 (*TodoMutation) SetInit

func (m *TodoMutation) SetInit(value map[string]interface{})

SetInit sets the "init" field.

func (*TodoMutation) SetOp

func (m *TodoMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*TodoMutation) SetParentID

func (m *TodoMutation) SetParentID(id int)

SetParentID sets the "parent" edge to the Todo entity by id.

func (*TodoMutation) SetPriority

func (m *TodoMutation) SetPriority(i int)

SetPriority sets the "priority" field.

func (*TodoMutation) SetSecretID

func (m *TodoMutation) SetSecretID(id int)

SetSecretID sets the "secret" edge to the VerySecret entity by id.

func (*TodoMutation) SetStatus

func (m *TodoMutation) SetStatus(t todo.Status)

SetStatus sets the "status" field.

func (*TodoMutation) SetText

func (m *TodoMutation) SetText(s string)

SetText sets the "text" field.

func (*TodoMutation) Status

func (m *TodoMutation) Status() (r todo.Status, exists bool)

Status returns the value of the "status" field in the mutation.

func (*TodoMutation) Text

func (m *TodoMutation) Text() (r string, exists bool)

Text returns the value of the "text" field in the mutation.

func (TodoMutation) Tx

func (m TodoMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TodoMutation) Type

func (m *TodoMutation) Type() string

Type returns the node type of this mutation (Todo).

func (*TodoMutation) Where

func (m *TodoMutation) Where(ps ...predicate.Todo)

Where appends a list predicates to the TodoMutation builder.

func (*TodoMutation) WhereP

func (m *TodoMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the TodoMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type TodoOrder

type TodoOrder struct {
	Direction OrderDirection  `json:"direction"`
	Field     *TodoOrderField `json:"field"`
}

TodoOrder defines the ordering of Todo.

type TodoOrderField

type TodoOrderField struct {
	// Value extracts the ordering value from the given Todo.
	Value func(*Todo) (ent.Value, error)
	// contains filtered or unexported fields
}

TodoOrderField defines the ordering field of Todo.

func (TodoOrderField) MarshalGQL

func (f TodoOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (TodoOrderField) String

func (f TodoOrderField) String() string

String implement fmt.Stringer interface.

func (*TodoOrderField) UnmarshalGQL

func (f *TodoOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type TodoPaginateOption

type TodoPaginateOption func(*todoPager) error

TodoPaginateOption enables pagination customization.

func WithTodoFilter

func WithTodoFilter(filter func(*TodoQuery) (*TodoQuery, error)) TodoPaginateOption

WithTodoFilter configures pagination filter.

func WithTodoOrder

func WithTodoOrder(order []*TodoOrder) TodoPaginateOption

WithTodoOrder configures pagination ordering.

type TodoQuery

type TodoQuery struct {
	// contains filtered or unexported fields
}

TodoQuery is the builder for querying Todo entities.

func (*TodoQuery) Aggregate

func (tq *TodoQuery) Aggregate(fns ...AggregateFunc) *TodoSelect

Aggregate returns a TodoSelect configured with the given aggregations.

func (*TodoQuery) All

func (tq *TodoQuery) All(ctx context.Context) ([]*Todo, error)

All executes the query and returns a list of Todos.

func (*TodoQuery) AllX

func (tq *TodoQuery) AllX(ctx context.Context) []*Todo

AllX is like All, but panics if an error occurs.

func (*TodoQuery) Clone

func (tq *TodoQuery) Clone() *TodoQuery

Clone returns a duplicate of the TodoQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TodoQuery) CollectFields

func (t *TodoQuery) CollectFields(ctx context.Context, satisfies ...string) (*TodoQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*TodoQuery) Count

func (tq *TodoQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TodoQuery) CountX

func (tq *TodoQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TodoQuery) Exist

func (tq *TodoQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TodoQuery) ExistX

func (tq *TodoQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TodoQuery) First

func (tq *TodoQuery) First(ctx context.Context) (*Todo, error)

First returns the first Todo entity from the query. Returns a *NotFoundError when no Todo was found.

func (*TodoQuery) FirstID

func (tq *TodoQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Todo ID from the query. Returns a *NotFoundError when no Todo ID was found.

func (*TodoQuery) FirstIDX

func (tq *TodoQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*TodoQuery) FirstX

func (tq *TodoQuery) FirstX(ctx context.Context) *Todo

FirstX is like First, but panics if an error occurs.

func (*TodoQuery) GroupBy

func (tq *TodoQuery) GroupBy(field string, fields ...string) *TodoGroupBy

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.Todo.Query().
	GroupBy(todo.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TodoQuery) IDs

func (tq *TodoQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Todo IDs.

func (*TodoQuery) IDsX

func (tq *TodoQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*TodoQuery) Limit

func (tq *TodoQuery) Limit(limit int) *TodoQuery

Limit the number of records to be returned by this query.

func (*TodoQuery) Modify

func (tq *TodoQuery) Modify(modifiers ...func(s *sql.Selector)) *TodoSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*TodoQuery) Offset

func (tq *TodoQuery) Offset(offset int) *TodoQuery

Offset to start from.

func (*TodoQuery) Only

func (tq *TodoQuery) Only(ctx context.Context) (*Todo, error)

Only returns a single Todo entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Todo entity is found. Returns a *NotFoundError when no Todo entities are found.

func (*TodoQuery) OnlyID

func (tq *TodoQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Todo ID in the query. Returns a *NotSingularError when more than one Todo ID is found. Returns a *NotFoundError when no entities are found.

func (*TodoQuery) OnlyIDX

func (tq *TodoQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TodoQuery) OnlyX

func (tq *TodoQuery) OnlyX(ctx context.Context) *Todo

OnlyX is like Only, but panics if an error occurs.

func (*TodoQuery) Order

func (tq *TodoQuery) Order(o ...todo.OrderOption) *TodoQuery

Order specifies how the records should be ordered.

func (*TodoQuery) Paginate

func (t *TodoQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...TodoPaginateOption,
) (*TodoConnection, error)

Paginate executes the query and returns a relay based cursor connection to Todo.

func (*TodoQuery) QueryCategory

func (tq *TodoQuery) QueryCategory() *CategoryQuery

QueryCategory chains the current query on the "category" edge.

func (*TodoQuery) QueryChildren

func (tq *TodoQuery) QueryChildren() *TodoQuery

QueryChildren chains the current query on the "children" edge.

func (*TodoQuery) QueryParent

func (tq *TodoQuery) QueryParent() *TodoQuery

QueryParent chains the current query on the "parent" edge.

func (*TodoQuery) QuerySecret

func (tq *TodoQuery) QuerySecret() *VerySecretQuery

QuerySecret chains the current query on the "secret" edge.

func (*TodoQuery) Select

func (tq *TodoQuery) Select(fields ...string) *TodoSelect

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.Todo.Query().
	Select(todo.FieldCreatedAt).
	Scan(ctx, &v)

func (*TodoQuery) Unique

func (tq *TodoQuery) Unique(unique bool) *TodoQuery

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 (*TodoQuery) Where

func (tq *TodoQuery) Where(ps ...predicate.Todo) *TodoQuery

Where adds a new predicate for the TodoQuery builder.

func (*TodoQuery) WithCategory

func (tq *TodoQuery) WithCategory(opts ...func(*CategoryQuery)) *TodoQuery

WithCategory tells the query-builder to eager-load the nodes that are connected to the "category" edge. The optional arguments are used to configure the query builder of the edge.

func (*TodoQuery) WithChildren

func (tq *TodoQuery) WithChildren(opts ...func(*TodoQuery)) *TodoQuery

WithChildren tells the query-builder to eager-load the nodes that are connected to the "children" edge. The optional arguments are used to configure the query builder of the edge.

func (*TodoQuery) WithNamedChildren

func (tq *TodoQuery) WithNamedChildren(name string, opts ...func(*TodoQuery)) *TodoQuery

WithNamedChildren tells the query-builder to eager-load the nodes that are connected to the "children" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*TodoQuery) WithParent

func (tq *TodoQuery) WithParent(opts ...func(*TodoQuery)) *TodoQuery

WithParent tells the query-builder to eager-load the nodes that are connected to the "parent" edge. The optional arguments are used to configure the query builder of the edge.

func (*TodoQuery) WithSecret

func (tq *TodoQuery) WithSecret(opts ...func(*VerySecretQuery)) *TodoQuery

WithSecret tells the query-builder to eager-load the nodes that are connected to the "secret" edge. The optional arguments are used to configure the query builder of the edge.

type TodoSelect

type TodoSelect struct {
	*TodoQuery
	// contains filtered or unexported fields
}

TodoSelect is the builder for selecting fields of Todo entities.

func (*TodoSelect) Aggregate

func (ts *TodoSelect) Aggregate(fns ...AggregateFunc) *TodoSelect

Aggregate adds the given aggregation functions to the selector query.

func (*TodoSelect) Bool

func (s *TodoSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TodoSelect) BoolX

func (s *TodoSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TodoSelect) Bools

func (s *TodoSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TodoSelect) BoolsX

func (s *TodoSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TodoSelect) Float64

func (s *TodoSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TodoSelect) Float64X

func (s *TodoSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TodoSelect) Float64s

func (s *TodoSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TodoSelect) Float64sX

func (s *TodoSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TodoSelect) Int

func (s *TodoSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TodoSelect) IntX

func (s *TodoSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TodoSelect) Ints

func (s *TodoSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TodoSelect) IntsX

func (s *TodoSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TodoSelect) Modify

func (ts *TodoSelect) Modify(modifiers ...func(s *sql.Selector)) *TodoSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*TodoSelect) Scan

func (ts *TodoSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TodoSelect) ScanX

func (s *TodoSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TodoSelect) String

func (s *TodoSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TodoSelect) StringX

func (s *TodoSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TodoSelect) Strings

func (s *TodoSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TodoSelect) StringsX

func (s *TodoSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TodoUpdate

type TodoUpdate struct {
	// contains filtered or unexported fields
}

TodoUpdate is the builder for updating Todo entities.

func (*TodoUpdate) AddChildIDs

func (tu *TodoUpdate) AddChildIDs(ids ...int) *TodoUpdate

AddChildIDs adds the "children" edge to the Todo entity by IDs.

func (*TodoUpdate) AddChildren

func (tu *TodoUpdate) AddChildren(t ...*Todo) *TodoUpdate

AddChildren adds the "children" edges to the Todo entity.

func (*TodoUpdate) AddPriority

func (tu *TodoUpdate) AddPriority(i int) *TodoUpdate

AddPriority adds i to the "priority" field.

func (*TodoUpdate) AppendCustom

func (tu *TodoUpdate) AppendCustom(c []customstruct.Custom) *TodoUpdate

AppendCustom appends c to the "custom" field.

func (*TodoUpdate) AppendCustomp

func (tu *TodoUpdate) AppendCustomp(c []*customstruct.Custom) *TodoUpdate

AppendCustomp appends c to the "customp" field.

func (*TodoUpdate) ClearBlob

func (tu *TodoUpdate) ClearBlob() *TodoUpdate

ClearBlob clears the value of the "blob" field.

func (*TodoUpdate) ClearChildren

func (tu *TodoUpdate) ClearChildren() *TodoUpdate

ClearChildren clears all "children" edges to the Todo entity.

func (*TodoUpdate) ClearCustom

func (tu *TodoUpdate) ClearCustom() *TodoUpdate

ClearCustom clears the value of the "custom" field.

func (*TodoUpdate) ClearCustomp

func (tu *TodoUpdate) ClearCustomp() *TodoUpdate

ClearCustomp clears the value of the "customp" field.

func (*TodoUpdate) ClearInit

func (tu *TodoUpdate) ClearInit() *TodoUpdate

ClearInit clears the value of the "init" field.

func (*TodoUpdate) ClearParent

func (tu *TodoUpdate) ClearParent() *TodoUpdate

ClearParent clears the "parent" edge to the Todo entity.

func (*TodoUpdate) ClearSecret

func (tu *TodoUpdate) ClearSecret() *TodoUpdate

ClearSecret clears the "secret" edge to the VerySecret entity.

func (*TodoUpdate) Exec

func (tu *TodoUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TodoUpdate) ExecX

func (tu *TodoUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TodoUpdate) Modify

func (tu *TodoUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *TodoUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*TodoUpdate) Mutation

func (tu *TodoUpdate) Mutation() *TodoMutation

Mutation returns the TodoMutation object of the builder.

func (*TodoUpdate) RemoveChildIDs

func (tu *TodoUpdate) RemoveChildIDs(ids ...int) *TodoUpdate

RemoveChildIDs removes the "children" edge to Todo entities by IDs.

func (*TodoUpdate) RemoveChildren

func (tu *TodoUpdate) RemoveChildren(t ...*Todo) *TodoUpdate

RemoveChildren removes "children" edges to Todo entities.

func (*TodoUpdate) Save

func (tu *TodoUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TodoUpdate) SaveX

func (tu *TodoUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TodoUpdate) SetBlob

func (tu *TodoUpdate) SetBlob(b []byte) *TodoUpdate

SetBlob sets the "blob" field.

func (*TodoUpdate) SetCustom

func (tu *TodoUpdate) SetCustom(c []customstruct.Custom) *TodoUpdate

SetCustom sets the "custom" field.

func (*TodoUpdate) SetCustomp

func (tu *TodoUpdate) SetCustomp(c []*customstruct.Custom) *TodoUpdate

SetCustomp sets the "customp" field.

func (*TodoUpdate) SetInit

func (tu *TodoUpdate) SetInit(m map[string]interface{}) *TodoUpdate

SetInit sets the "init" field.

func (*TodoUpdate) SetInput

func (c *TodoUpdate) SetInput(i UpdateTodoInput) *TodoUpdate

SetInput applies the change-set in the UpdateTodoInput on the TodoUpdate builder.

func (*TodoUpdate) SetNillableParentID

func (tu *TodoUpdate) SetNillableParentID(id *int) *TodoUpdate

SetNillableParentID sets the "parent" edge to the Todo entity by ID if the given value is not nil.

func (*TodoUpdate) SetNillablePriority

func (tu *TodoUpdate) SetNillablePriority(i *int) *TodoUpdate

SetNillablePriority sets the "priority" field if the given value is not nil.

func (*TodoUpdate) SetNillableSecretID

func (tu *TodoUpdate) SetNillableSecretID(id *int) *TodoUpdate

SetNillableSecretID sets the "secret" edge to the VerySecret entity by ID if the given value is not nil.

func (*TodoUpdate) SetNillableStatus

func (tu *TodoUpdate) SetNillableStatus(t *todo.Status) *TodoUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*TodoUpdate) SetNillableText

func (tu *TodoUpdate) SetNillableText(s *string) *TodoUpdate

SetNillableText sets the "text" field if the given value is not nil.

func (*TodoUpdate) SetParent

func (tu *TodoUpdate) SetParent(t *Todo) *TodoUpdate

SetParent sets the "parent" edge to the Todo entity.

func (*TodoUpdate) SetParentID

func (tu *TodoUpdate) SetParentID(id int) *TodoUpdate

SetParentID sets the "parent" edge to the Todo entity by ID.

func (*TodoUpdate) SetPriority

func (tu *TodoUpdate) SetPriority(i int) *TodoUpdate

SetPriority sets the "priority" field.

func (*TodoUpdate) SetSecret

func (tu *TodoUpdate) SetSecret(v *VerySecret) *TodoUpdate

SetSecret sets the "secret" edge to the VerySecret entity.

func (*TodoUpdate) SetSecretID

func (tu *TodoUpdate) SetSecretID(id int) *TodoUpdate

SetSecretID sets the "secret" edge to the VerySecret entity by ID.

func (*TodoUpdate) SetStatus

func (tu *TodoUpdate) SetStatus(t todo.Status) *TodoUpdate

SetStatus sets the "status" field.

func (*TodoUpdate) SetText

func (tu *TodoUpdate) SetText(s string) *TodoUpdate

SetText sets the "text" field.

func (*TodoUpdate) Where

func (tu *TodoUpdate) Where(ps ...predicate.Todo) *TodoUpdate

Where appends a list predicates to the TodoUpdate builder.

type TodoUpdateOne

type TodoUpdateOne struct {
	// contains filtered or unexported fields
}

TodoUpdateOne is the builder for updating a single Todo entity.

func (*TodoUpdateOne) AddChildIDs

func (tuo *TodoUpdateOne) AddChildIDs(ids ...int) *TodoUpdateOne

AddChildIDs adds the "children" edge to the Todo entity by IDs.

func (*TodoUpdateOne) AddChildren

func (tuo *TodoUpdateOne) AddChildren(t ...*Todo) *TodoUpdateOne

AddChildren adds the "children" edges to the Todo entity.

func (*TodoUpdateOne) AddPriority

func (tuo *TodoUpdateOne) AddPriority(i int) *TodoUpdateOne

AddPriority adds i to the "priority" field.

func (*TodoUpdateOne) AppendCustom

func (tuo *TodoUpdateOne) AppendCustom(c []customstruct.Custom) *TodoUpdateOne

AppendCustom appends c to the "custom" field.

func (*TodoUpdateOne) AppendCustomp

func (tuo *TodoUpdateOne) AppendCustomp(c []*customstruct.Custom) *TodoUpdateOne

AppendCustomp appends c to the "customp" field.

func (*TodoUpdateOne) ClearBlob

func (tuo *TodoUpdateOne) ClearBlob() *TodoUpdateOne

ClearBlob clears the value of the "blob" field.

func (*TodoUpdateOne) ClearChildren

func (tuo *TodoUpdateOne) ClearChildren() *TodoUpdateOne

ClearChildren clears all "children" edges to the Todo entity.

func (*TodoUpdateOne) ClearCustom

func (tuo *TodoUpdateOne) ClearCustom() *TodoUpdateOne

ClearCustom clears the value of the "custom" field.

func (*TodoUpdateOne) ClearCustomp

func (tuo *TodoUpdateOne) ClearCustomp() *TodoUpdateOne

ClearCustomp clears the value of the "customp" field.

func (*TodoUpdateOne) ClearInit

func (tuo *TodoUpdateOne) ClearInit() *TodoUpdateOne

ClearInit clears the value of the "init" field.

func (*TodoUpdateOne) ClearParent

func (tuo *TodoUpdateOne) ClearParent() *TodoUpdateOne

ClearParent clears the "parent" edge to the Todo entity.

func (*TodoUpdateOne) ClearSecret

func (tuo *TodoUpdateOne) ClearSecret() *TodoUpdateOne

ClearSecret clears the "secret" edge to the VerySecret entity.

func (*TodoUpdateOne) Exec

func (tuo *TodoUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TodoUpdateOne) ExecX

func (tuo *TodoUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TodoUpdateOne) Modify

func (tuo *TodoUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *TodoUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*TodoUpdateOne) Mutation

func (tuo *TodoUpdateOne) Mutation() *TodoMutation

Mutation returns the TodoMutation object of the builder.

func (*TodoUpdateOne) RemoveChildIDs

func (tuo *TodoUpdateOne) RemoveChildIDs(ids ...int) *TodoUpdateOne

RemoveChildIDs removes the "children" edge to Todo entities by IDs.

func (*TodoUpdateOne) RemoveChildren

func (tuo *TodoUpdateOne) RemoveChildren(t ...*Todo) *TodoUpdateOne

RemoveChildren removes "children" edges to Todo entities.

func (*TodoUpdateOne) Save

func (tuo *TodoUpdateOne) Save(ctx context.Context) (*Todo, error)

Save executes the query and returns the updated Todo entity.

func (*TodoUpdateOne) SaveX

func (tuo *TodoUpdateOne) SaveX(ctx context.Context) *Todo

SaveX is like Save, but panics if an error occurs.

func (*TodoUpdateOne) Select

func (tuo *TodoUpdateOne) Select(field string, fields ...string) *TodoUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TodoUpdateOne) SetBlob

func (tuo *TodoUpdateOne) SetBlob(b []byte) *TodoUpdateOne

SetBlob sets the "blob" field.

func (*TodoUpdateOne) SetCustom

func (tuo *TodoUpdateOne) SetCustom(c []customstruct.Custom) *TodoUpdateOne

SetCustom sets the "custom" field.

func (*TodoUpdateOne) SetCustomp

func (tuo *TodoUpdateOne) SetCustomp(c []*customstruct.Custom) *TodoUpdateOne

SetCustomp sets the "customp" field.

func (*TodoUpdateOne) SetInit

func (tuo *TodoUpdateOne) SetInit(m map[string]interface{}) *TodoUpdateOne

SetInit sets the "init" field.

func (*TodoUpdateOne) SetInput

SetInput applies the change-set in the UpdateTodoInput on the TodoUpdateOne builder.

func (*TodoUpdateOne) SetNillableParentID

func (tuo *TodoUpdateOne) SetNillableParentID(id *int) *TodoUpdateOne

SetNillableParentID sets the "parent" edge to the Todo entity by ID if the given value is not nil.

func (*TodoUpdateOne) SetNillablePriority

func (tuo *TodoUpdateOne) SetNillablePriority(i *int) *TodoUpdateOne

SetNillablePriority sets the "priority" field if the given value is not nil.

func (*TodoUpdateOne) SetNillableSecretID

func (tuo *TodoUpdateOne) SetNillableSecretID(id *int) *TodoUpdateOne

SetNillableSecretID sets the "secret" edge to the VerySecret entity by ID if the given value is not nil.

func (*TodoUpdateOne) SetNillableStatus

func (tuo *TodoUpdateOne) SetNillableStatus(t *todo.Status) *TodoUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*TodoUpdateOne) SetNillableText

func (tuo *TodoUpdateOne) SetNillableText(s *string) *TodoUpdateOne

SetNillableText sets the "text" field if the given value is not nil.

func (*TodoUpdateOne) SetParent

func (tuo *TodoUpdateOne) SetParent(t *Todo) *TodoUpdateOne

SetParent sets the "parent" edge to the Todo entity.

func (*TodoUpdateOne) SetParentID

func (tuo *TodoUpdateOne) SetParentID(id int) *TodoUpdateOne

SetParentID sets the "parent" edge to the Todo entity by ID.

func (*TodoUpdateOne) SetPriority

func (tuo *TodoUpdateOne) SetPriority(i int) *TodoUpdateOne

SetPriority sets the "priority" field.

func (*TodoUpdateOne) SetSecret

func (tuo *TodoUpdateOne) SetSecret(v *VerySecret) *TodoUpdateOne

SetSecret sets the "secret" edge to the VerySecret entity.

func (*TodoUpdateOne) SetSecretID

func (tuo *TodoUpdateOne) SetSecretID(id int) *TodoUpdateOne

SetSecretID sets the "secret" edge to the VerySecret entity by ID.

func (*TodoUpdateOne) SetStatus

func (tuo *TodoUpdateOne) SetStatus(t todo.Status) *TodoUpdateOne

SetStatus sets the "status" field.

func (*TodoUpdateOne) SetText

func (tuo *TodoUpdateOne) SetText(s string) *TodoUpdateOne

SetText sets the "text" field.

func (*TodoUpdateOne) Where

func (tuo *TodoUpdateOne) Where(ps ...predicate.Todo) *TodoUpdateOne

Where appends a list predicates to the TodoUpdate builder.

type TodoWhereInput

type TodoWhereInput struct {
	Predicates []predicate.Todo  `json:"-"`
	Not        *TodoWhereInput   `json:"not,omitempty"`
	Or         []*TodoWhereInput `json:"or,omitempty"`
	And        []*TodoWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *int  `json:"id,omitempty"`
	IDNEQ   *int  `json:"idNEQ,omitempty"`
	IDIn    []int `json:"idIn,omitempty"`
	IDNotIn []int `json:"idNotIn,omitempty"`
	IDGT    *int  `json:"idGT,omitempty"`
	IDGTE   *int  `json:"idGTE,omitempty"`
	IDLT    *int  `json:"idLT,omitempty"`
	IDLTE   *int  `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"`

	// "status" field predicates.
	Status      *todo.Status  `json:"status,omitempty"`
	StatusNEQ   *todo.Status  `json:"statusNEQ,omitempty"`
	StatusIn    []todo.Status `json:"statusIn,omitempty"`
	StatusNotIn []todo.Status `json:"statusNotIn,omitempty"`

	// "priority" field predicates.
	Priority      *int  `json:"priority,omitempty"`
	PriorityNEQ   *int  `json:"priorityNEQ,omitempty"`
	PriorityIn    []int `json:"priorityIn,omitempty"`
	PriorityNotIn []int `json:"priorityNotIn,omitempty"`
	PriorityGT    *int  `json:"priorityGT,omitempty"`
	PriorityGTE   *int  `json:"priorityGTE,omitempty"`
	PriorityLT    *int  `json:"priorityLT,omitempty"`
	PriorityLTE   *int  `json:"priorityLTE,omitempty"`

	// "text" field predicates.
	Text             *string  `json:"text,omitempty"`
	TextNEQ          *string  `json:"textNEQ,omitempty"`
	TextIn           []string `json:"textIn,omitempty"`
	TextNotIn        []string `json:"textNotIn,omitempty"`
	TextGT           *string  `json:"textGT,omitempty"`
	TextGTE          *string  `json:"textGTE,omitempty"`
	TextLT           *string  `json:"textLT,omitempty"`
	TextLTE          *string  `json:"textLTE,omitempty"`
	TextContains     *string  `json:"textContains,omitempty"`
	TextHasPrefix    *string  `json:"textHasPrefix,omitempty"`
	TextHasSuffix    *string  `json:"textHasSuffix,omitempty"`
	TextEqualFold    *string  `json:"textEqualFold,omitempty"`
	TextContainsFold *string  `json:"textContainsFold,omitempty"`

	// "category_id" field predicates.
	CategoryID       *int  `json:"categoryID,omitempty"`
	CategoryIDNEQ    *int  `json:"categoryIDNEQ,omitempty"`
	CategoryIDIn     []int `json:"categoryIDIn,omitempty"`
	CategoryIDNotIn  []int `json:"categoryIDNotIn,omitempty"`
	CategoryIDIsNil  bool  `json:"categoryIDIsNil,omitempty"`
	CategoryIDNotNil bool  `json:"categoryIDNotNil,omitempty"`

	// "parent" edge predicates.
	HasParent     *bool             `json:"hasParent,omitempty"`
	HasParentWith []*TodoWhereInput `json:"hasParentWith,omitempty"`

	// "children" edge predicates.
	HasChildren     *bool             `json:"hasChildren,omitempty"`
	HasChildrenWith []*TodoWhereInput `json:"hasChildrenWith,omitempty"`

	// "category" edge predicates.
	HasCategory     *bool                 `json:"hasCategory,omitempty"`
	HasCategoryWith []*CategoryWhereInput `json:"hasCategoryWith,omitempty"`
}

TodoWhereInput represents a where input for filtering Todo queries.

func (*TodoWhereInput) AddPredicates

func (i *TodoWhereInput) AddPredicates(predicates ...predicate.Todo)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*TodoWhereInput) Filter

func (i *TodoWhereInput) Filter(q *TodoQuery) (*TodoQuery, error)

Filter applies the TodoWhereInput filter on the TodoQuery builder.

func (*TodoWhereInput) P

func (i *TodoWhereInput) P() (predicate.Todo, error)

P returns a predicate for filtering todos. An error is returned if the input is empty or invalid.

type Todos

type Todos []*Todo

Todos is a parsable slice of Todo.

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 {

	// BillProduct is the client for interacting with the BillProduct builders.
	BillProduct *BillProductClient
	// Category is the client for interacting with the Category builders.
	Category *CategoryClient
	// Friendship is the client for interacting with the Friendship builders.
	Friendship *FriendshipClient
	// Group is the client for interacting with the Group builders.
	Group *GroupClient
	// OneToMany is the client for interacting with the OneToMany builders.
	OneToMany *OneToManyClient
	// Project is the client for interacting with the Project builders.
	Project *ProjectClient
	// Todo is the client for interacting with the Todo builders.
	Todo *TodoClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// VerySecret is the client for interacting with the VerySecret builders.
	VerySecret *VerySecretClient
	// Workspace is the client for interacting with the Workspace builders.
	Workspace *WorkspaceClient
	// 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 UpdateCategoryInput

type UpdateCategoryInput struct {
	Text                 *string
	Status               *category.Status
	ClearConfig          bool
	Config               *schematype.CategoryConfig
	ClearTypes           bool
	Types                *schematype.CategoryTypes
	ClearDuration        bool
	Duration             *time.Duration
	ClearCount           bool
	Count                *uint64
	ClearStrings         bool
	Strings              []string
	AppendStrings        []string
	ClearTodos           bool
	AddTodoIDs           []int
	RemoveTodoIDs        []int
	ClearSubCategories   bool
	AddSubCategoryIDs    []int
	RemoveSubCategoryIDs []int
}

UpdateCategoryInput represents a mutation input for updating categories.

func (*UpdateCategoryInput) Mutate

func (i *UpdateCategoryInput) Mutate(m *CategoryMutation)

Mutate applies the UpdateCategoryInput on the CategoryMutation builder.

type UpdateFriendshipInput

type UpdateFriendshipInput struct {
	CreatedAt *time.Time
	UserID    *int
	FriendID  *int
}

UpdateFriendshipInput represents a mutation input for updating friendships.

func (*UpdateFriendshipInput) Mutate

Mutate applies the UpdateFriendshipInput on the FriendshipMutation builder.

type UpdateTodoInput

type UpdateTodoInput struct {
	Status         *todo.Status
	Priority       *int
	Text           *string
	ClearInit      bool
	Init           map[string]interface{}
	ClearParent    bool
	ParentID       *int
	ClearChildren  bool
	AddChildIDs    []int
	RemoveChildIDs []int
	ClearSecret    bool
	SecretID       *int
}

UpdateTodoInput represents a mutation input for updating todos.

func (*UpdateTodoInput) Mutate

func (i *UpdateTodoInput) Mutate(m *TodoMutation)

Mutate applies the UpdateTodoInput on the TodoMutation builder.

type UpdateUserInput

type UpdateUserInput struct {
	Name             *string
	Username         *uuid.UUID
	ClearPassword    bool
	Password         *string
	RequiredMetadata map[string]interface{}
	ClearMetadata    bool
	Metadata         map[string]interface{}
	ClearGroups      bool
	AddGroupIDs      []int
	RemoveGroupIDs   []int
	ClearFriends     bool
	AddFriendIDs     []int
	RemoveFriendIDs  []int
}

UpdateUserInput represents a mutation input for updating users.

func (*UpdateUserInput) Mutate

func (i *UpdateUserInput) Mutate(m *UserMutation)

Mutate applies the UpdateUserInput on the UserMutation builder.

type User

type User struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Username holds the value of the "username" field.
	Username uuid.UUID `json:"username,omitempty"`
	// Password holds the value of the "password" field.
	Password string `json:"-"`
	// RequiredMetadata holds the value of the "required_metadata" field.
	RequiredMetadata map[string]interface{} `json:"required_metadata,omitempty"`
	// Metadata holds the value of the "metadata" field.
	Metadata map[string]interface{} `json:"metadata,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) Friends

func (u *User) Friends(
	ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, orderBy *UserOrder, where *UserWhereInput,
) (*UserConnection, error)

func (*User) Friendships

func (u *User) Friendships(
	ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, where *FriendshipWhereInput,
) (*FriendshipConnection, 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 (*User) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*User) NamedFriends

func (u *User) NamedFriends(name string) ([]*User, error)

NamedFriends returns the Friends named value or an error if the edge was not loaded in eager-loading with this name.

func (*User) NamedFriendships

func (u *User) NamedFriendships(name string) ([]*Friendship, error)

NamedFriendships returns the Friendships 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) Node

func (u *User) Node(ctx context.Context) (node *Node, err error)

Node implements Noder interface

func (*User) QueryFriends

func (u *User) QueryFriends() *UserQuery

QueryFriends queries the "friends" edge of the User entity.

func (*User) QueryFriendships

func (u *User) QueryFriendships() *FriendshipQuery

QueryFriendships queries the "friendships" edge of the User entity.

func (*User) QueryGroups

func (u *User) QueryGroups() *GroupQuery

QueryGroups queries the "groups" 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 int) *UserDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id int) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id int) *User

GetX is like Get, but panics if an error occurs.

func (*UserClient) Hooks

func (c *UserClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserClient) Intercept

func (c *UserClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`.

func (*UserClient) Interceptors

func (c *UserClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*UserClient) MapCreateBulk

func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryFriends

func (c *UserClient) QueryFriends(u *User) *UserQuery

QueryFriends queries the friends edge of a User.

func (*UserClient) QueryFriendships

func (c *UserClient) QueryFriendships(u *User) *FriendshipQuery

QueryFriendships queries the friendships edge of a User.

func (*UserClient) QueryGroups

func (c *UserClient) QueryGroups(u *User) *GroupQuery

QueryGroups queries the groups edge of a User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(u *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id int) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

func (c *UserClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.

type 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) AddFriendIDs

func (uc *UserCreate) AddFriendIDs(ids ...int) *UserCreate

AddFriendIDs adds the "friends" edge to the User entity by IDs.

func (*UserCreate) AddFriends

func (uc *UserCreate) AddFriends(u ...*User) *UserCreate

AddFriends adds the "friends" edges to the User entity.

func (*UserCreate) AddFriendshipIDs

func (uc *UserCreate) AddFriendshipIDs(ids ...int) *UserCreate

AddFriendshipIDs adds the "friendships" edge to the Friendship entity by IDs.

func (*UserCreate) AddFriendships

func (uc *UserCreate) AddFriendships(f ...*Friendship) *UserCreate

AddFriendships adds the "friendships" edges to the Friendship entity.

func (*UserCreate) AddGroupIDs

func (uc *UserCreate) AddGroupIDs(ids ...int) *UserCreate

AddGroupIDs adds the "groups" edge to the Group entity by IDs.

func (*UserCreate) AddGroups

func (uc *UserCreate) AddGroups(g ...*Group) *UserCreate

AddGroups adds the "groups" edges to the Group entity.

func (*UserCreate) 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) SetInput

func (c *UserCreate) SetInput(i CreateUserInput) *UserCreate

SetInput applies the change-set in the CreateUserInput on the UserCreate builder.

func (*UserCreate) SetMetadata

func (uc *UserCreate) SetMetadata(m map[string]interface{}) *UserCreate

SetMetadata sets the "metadata" field.

func (*UserCreate) SetName

func (uc *UserCreate) SetName(s string) *UserCreate

SetName sets the "name" field.

func (*UserCreate) SetNillableName

func (uc *UserCreate) SetNillableName(s *string) *UserCreate

SetNillableName sets the "name" field if the given value is not nil.

func (*UserCreate) SetNillablePassword

func (uc *UserCreate) SetNillablePassword(s *string) *UserCreate

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UserCreate) SetNillableUsername

func (uc *UserCreate) SetNillableUsername(u *uuid.UUID) *UserCreate

SetNillableUsername sets the "username" field if the given value is not nil.

func (*UserCreate) SetPassword

func (uc *UserCreate) SetPassword(s string) *UserCreate

SetPassword sets the "password" field.

func (*UserCreate) SetRequiredMetadata

func (uc *UserCreate) SetRequiredMetadata(m map[string]interface{}) *UserCreate

SetRequiredMetadata sets the "required_metadata" field.

func (*UserCreate) SetUsername

func (uc *UserCreate) SetUsername(u uuid.UUID) *UserCreate

SetUsername sets the "username" field.

type UserCreateBulk

type UserCreateBulk struct {
	// contains filtered or unexported fields
}

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec

func (ucb *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecX

func (ucb *UserCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreateBulk) Save

func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User

SaveX is like Save, but panics if an error occurs.

type UserDelete

type UserDelete struct {
	// contains filtered or unexported fields
}

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (ud *UserDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserDelete) ExecX

func (ud *UserDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserDelete) Where

func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

type UserDeleteOne struct {
	// contains filtered or unexported fields
}

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (udo *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (udo *UserDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserDeleteOne) Where

func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne

Where appends a list predicates to the UserDelete builder.

type UserEdge

type UserEdge struct {
	Node   *User  `json:"node"`
	Cursor Cursor `json:"cursor"`
}

UserEdge is the edge representation of User.

type UserEdges

type UserEdges struct {
	// The groups of the user
	Groups []*Group `json:"groups,omitempty"`
	// Friends holds the value of the friends edge.
	Friends []*User `json:"friends,omitempty"`
	// Friendships holds the value of the friendships edge.
	Friendships []*Friendship `json:"friendships,omitempty"`
	// contains filtered or unexported fields
}

UserEdges holds the relations/edges for other nodes in the graph.

func (UserEdges) FriendsOrErr

func (e UserEdges) FriendsOrErr() ([]*User, error)

FriendsOrErr returns the Friends value or an error if the edge was not loaded in eager-loading.

func (UserEdges) FriendshipsOrErr

func (e UserEdges) FriendshipsOrErr() ([]*Friendship, error)

FriendshipsOrErr returns the Friendships 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.

type UserGroupBy

type UserGroupBy struct {
	// contains filtered or unexported fields
}

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserGroupBy) Bool

func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolX

func (s *UserGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserGroupBy) Bools

func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolsX

func (s *UserGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserGroupBy) Float64

func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64X

func (s *UserGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserGroupBy) Float64s

func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64sX

func (s *UserGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserGroupBy) Int

func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntX

func (s *UserGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserGroupBy) Ints

func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntsX

func (s *UserGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserGroupBy) ScanX

func (s *UserGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserGroupBy) String

func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringX

func (s *UserGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserGroupBy) Strings

func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringsX

func (s *UserGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserMutation

type UserMutation struct {
	// contains filtered or unexported fields
}

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AddField

func (m *UserMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) AddFriendIDs

func (m *UserMutation) AddFriendIDs(ids ...int)

AddFriendIDs adds the "friends" edge to the User entity by ids.

func (*UserMutation) AddFriendshipIDs

func (m *UserMutation) AddFriendshipIDs(ids ...int)

AddFriendshipIDs adds the "friendships" edge to the Friendship entity by ids.

func (*UserMutation) AddGroupIDs

func (m *UserMutation) AddGroupIDs(ids ...int)

AddGroupIDs adds the "groups" edge to the Group entity by ids.

func (*UserMutation) AddedEdges

func (m *UserMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserMutation) AddedField

func (m *UserMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) AddedFields

func (m *UserMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserMutation) AddedIDs

func (m *UserMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserMutation) ClearEdge

func (m *UserMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*UserMutation) ClearField

func (m *UserMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ClearFriends

func (m *UserMutation) ClearFriends()

ClearFriends clears the "friends" edge to the User entity.

func (*UserMutation) ClearFriendships

func (m *UserMutation) ClearFriendships()

ClearFriendships clears the "friendships" edge to the Friendship entity.

func (*UserMutation) ClearGroups

func (m *UserMutation) ClearGroups()

ClearGroups clears the "groups" edge to the Group entity.

func (*UserMutation) ClearMetadata

func (m *UserMutation) ClearMetadata()

ClearMetadata clears the value of the "metadata" field.

func (*UserMutation) ClearPassword

func (m *UserMutation) ClearPassword()

ClearPassword clears the value of the "password" field.

func (*UserMutation) ClearedEdges

func (m *UserMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserMutation) ClearedFields

func (m *UserMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserMutation) Client

func (m UserMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*UserMutation) EdgeCleared

func (m *UserMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserMutation) 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) FriendsCleared

func (m *UserMutation) FriendsCleared() bool

FriendsCleared reports if the "friends" edge to the User entity was cleared.

func (*UserMutation) FriendsIDs

func (m *UserMutation) FriendsIDs() (ids []int)

FriendsIDs returns the "friends" edge IDs in the mutation.

func (*UserMutation) FriendshipsCleared

func (m *UserMutation) FriendshipsCleared() bool

FriendshipsCleared reports if the "friendships" edge to the Friendship entity was cleared.

func (*UserMutation) FriendshipsIDs

func (m *UserMutation) FriendshipsIDs() (ids []int)

FriendshipsIDs returns the "friendships" 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 []int)

GroupsIDs returns the "groups" edge IDs in the mutation.

func (*UserMutation) ID

func (m *UserMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*UserMutation) IDs

func (m *UserMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*UserMutation) Metadata

func (m *UserMutation) Metadata() (r map[string]interface{}, exists bool)

Metadata returns the value of the "metadata" field in the mutation.

func (*UserMutation) MetadataCleared

func (m *UserMutation) MetadataCleared() bool

MetadataCleared returns if the "metadata" field was cleared in this mutation.

func (*UserMutation) Name

func (m *UserMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*UserMutation) 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) OldMetadata

func (m *UserMutation) OldMetadata(ctx context.Context) (v map[string]interface{}, err error)

OldMetadata returns the old "metadata" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldName

func (m *UserMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldPassword

func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error)

OldPassword returns the old "password" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldRequiredMetadata

func (m *UserMutation) OldRequiredMetadata(ctx context.Context) (v map[string]interface{}, err error)

OldRequiredMetadata returns the old "required_metadata" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldUsername

func (m *UserMutation) OldUsername(ctx context.Context) (v uuid.UUID, err error)

OldUsername returns the old "username" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) Password

func (m *UserMutation) Password() (r string, exists bool)

Password returns the value of the "password" field in the mutation.

func (*UserMutation) PasswordCleared

func (m *UserMutation) PasswordCleared() bool

PasswordCleared returns if the "password" field was cleared in this mutation.

func (*UserMutation) RemoveFriendIDs

func (m *UserMutation) RemoveFriendIDs(ids ...int)

RemoveFriendIDs removes the "friends" edge to the User entity by IDs.

func (*UserMutation) RemoveFriendshipIDs

func (m *UserMutation) RemoveFriendshipIDs(ids ...int)

RemoveFriendshipIDs removes the "friendships" edge to the Friendship entity by IDs.

func (*UserMutation) RemoveGroupIDs

func (m *UserMutation) RemoveGroupIDs(ids ...int)

RemoveGroupIDs removes the "groups" edge to the Group entity by IDs.

func (*UserMutation) RemovedEdges

func (m *UserMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserMutation) RemovedFriendsIDs

func (m *UserMutation) RemovedFriendsIDs() (ids []int)

RemovedFriends returns the removed IDs of the "friends" edge to the User entity.

func (*UserMutation) RemovedFriendshipsIDs

func (m *UserMutation) RemovedFriendshipsIDs() (ids []int)

RemovedFriendships returns the removed IDs of the "friendships" edge to the Friendship entity.

func (*UserMutation) RemovedGroupsIDs

func (m *UserMutation) RemovedGroupsIDs() (ids []int)

RemovedGroups returns the removed IDs of the "groups" edge to the Group entity.

func (*UserMutation) RemovedIDs

func (m *UserMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*UserMutation) RequiredMetadata

func (m *UserMutation) RequiredMetadata() (r map[string]interface{}, exists bool)

RequiredMetadata returns the value of the "required_metadata" field in the mutation.

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) 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) ResetFriends

func (m *UserMutation) ResetFriends()

ResetFriends resets all changes to the "friends" edge.

func (*UserMutation) ResetFriendships

func (m *UserMutation) ResetFriendships()

ResetFriendships resets all changes to the "friendships" edge.

func (*UserMutation) ResetGroups

func (m *UserMutation) ResetGroups()

ResetGroups resets all changes to the "groups" edge.

func (*UserMutation) ResetMetadata

func (m *UserMutation) ResetMetadata()

ResetMetadata resets all changes to the "metadata" field.

func (*UserMutation) ResetName

func (m *UserMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*UserMutation) ResetPassword

func (m *UserMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*UserMutation) ResetRequiredMetadata

func (m *UserMutation) ResetRequiredMetadata()

ResetRequiredMetadata resets all changes to the "required_metadata" field.

func (*UserMutation) ResetUsername

func (m *UserMutation) ResetUsername()

ResetUsername resets all changes to the "username" 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) SetMetadata

func (m *UserMutation) SetMetadata(value map[string]interface{})

SetMetadata sets the "metadata" field.

func (*UserMutation) SetName

func (m *UserMutation) SetName(s string)

SetName sets the "name" field.

func (*UserMutation) SetOp

func (m *UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserMutation) SetPassword

func (m *UserMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*UserMutation) SetRequiredMetadata

func (m *UserMutation) SetRequiredMetadata(value map[string]interface{})

SetRequiredMetadata sets the "required_metadata" field.

func (*UserMutation) SetUsername

func (m *UserMutation) SetUsername(u uuid.UUID)

SetUsername sets the "username" 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) Username

func (m *UserMutation) Username() (r uuid.UUID, exists bool)

Username returns the value of the "username" field in the mutation.

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

func (*UserMutation) WhereP

func (m *UserMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type 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.

func (UserOrderField) MarshalGQL

func (f UserOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (UserOrderField) String

func (f UserOrderField) String() string

String implement fmt.Stringer interface.

func (*UserOrderField) UnmarshalGQL

func (f *UserOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

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 int, err error)

FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.

func (*UserQuery) FirstIDX

func (uq *UserQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserQuery) FirstX

func (uq *UserQuery) FirstX(ctx context.Context) *User

FirstX is like First, but panics if an error occurs.

func (*UserQuery) GroupBy

func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

Limit the number of records to be returned by this query.

func (*UserQuery) Modify

func (uq *UserQuery) Modify(modifiers ...func(s *sql.Selector)) *UserSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset to start from.

func (*UserQuery) Only

func (uq *UserQuery) Only(ctx context.Context) (*User, error)

Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.

func (*UserQuery) OnlyID

func (uq *UserQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.

func (*UserQuery) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserQuery) OnlyX

func (uq *UserQuery) OnlyX(ctx context.Context) *User

OnlyX is like Only, but panics if an error occurs.

func (*UserQuery) Order

func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery

Order specifies how the records should be ordered.

func (*UserQuery) 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) QueryFriends

func (uq *UserQuery) QueryFriends() *UserQuery

QueryFriends chains the current query on the "friends" edge.

func (*UserQuery) QueryFriendships

func (uq *UserQuery) QueryFriendships() *FriendshipQuery

QueryFriendships chains the current query on the "friendships" edge.

func (*UserQuery) QueryGroups

func (uq *UserQuery) QueryGroups() *GroupQuery

QueryGroups chains the current query on the "groups" 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 {
	Name string `json:"name,omitempty"`
}

client.User.Query().
	Select(user.FieldName).
	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) WithFriends

func (uq *UserQuery) WithFriends(opts ...func(*UserQuery)) *UserQuery

WithFriends tells the query-builder to eager-load the nodes that are connected to the "friends" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithFriendships

func (uq *UserQuery) WithFriendships(opts ...func(*FriendshipQuery)) *UserQuery

WithFriendships tells the query-builder to eager-load the nodes that are connected to the "friendships" 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) WithNamedFriends

func (uq *UserQuery) WithNamedFriends(name string, opts ...func(*UserQuery)) *UserQuery

WithNamedFriends tells the query-builder to eager-load the nodes that are connected to the "friends" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithNamedFriendships

func (uq *UserQuery) WithNamedFriendships(name string, opts ...func(*FriendshipQuery)) *UserQuery

WithNamedFriendships tells the query-builder to eager-load the nodes that are connected to the "friendships" 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.

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) Modify

func (us *UserSelect) Modify(modifiers ...func(s *sql.Selector)) *UserSelect

Modify adds a query modifier for attaching custom logic to queries.

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) AddFriendIDs

func (uu *UserUpdate) AddFriendIDs(ids ...int) *UserUpdate

AddFriendIDs adds the "friends" edge to the User entity by IDs.

func (*UserUpdate) AddFriends

func (uu *UserUpdate) AddFriends(u ...*User) *UserUpdate

AddFriends adds the "friends" edges to the User entity.

func (*UserUpdate) AddFriendshipIDs

func (uu *UserUpdate) AddFriendshipIDs(ids ...int) *UserUpdate

AddFriendshipIDs adds the "friendships" edge to the Friendship entity by IDs.

func (*UserUpdate) AddFriendships

func (uu *UserUpdate) AddFriendships(f ...*Friendship) *UserUpdate

AddFriendships adds the "friendships" edges to the Friendship entity.

func (*UserUpdate) AddGroupIDs

func (uu *UserUpdate) AddGroupIDs(ids ...int) *UserUpdate

AddGroupIDs adds the "groups" edge to the Group entity by IDs.

func (*UserUpdate) AddGroups

func (uu *UserUpdate) AddGroups(g ...*Group) *UserUpdate

AddGroups adds the "groups" edges to the Group entity.

func (*UserUpdate) ClearFriends

func (uu *UserUpdate) ClearFriends() *UserUpdate

ClearFriends clears all "friends" edges to the User entity.

func (*UserUpdate) ClearFriendships

func (uu *UserUpdate) ClearFriendships() *UserUpdate

ClearFriendships clears all "friendships" edges to the Friendship entity.

func (*UserUpdate) ClearGroups

func (uu *UserUpdate) ClearGroups() *UserUpdate

ClearGroups clears all "groups" edges to the Group entity.

func (*UserUpdate) ClearMetadata

func (uu *UserUpdate) ClearMetadata() *UserUpdate

ClearMetadata clears the value of the "metadata" field.

func (*UserUpdate) ClearPassword

func (uu *UserUpdate) ClearPassword() *UserUpdate

ClearPassword clears the value of the "password" field.

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) Modify

func (uu *UserUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *UserUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) RemoveFriendIDs

func (uu *UserUpdate) RemoveFriendIDs(ids ...int) *UserUpdate

RemoveFriendIDs removes the "friends" edge to User entities by IDs.

func (*UserUpdate) RemoveFriends

func (uu *UserUpdate) RemoveFriends(u ...*User) *UserUpdate

RemoveFriends removes "friends" edges to User entities.

func (*UserUpdate) RemoveFriendshipIDs

func (uu *UserUpdate) RemoveFriendshipIDs(ids ...int) *UserUpdate

RemoveFriendshipIDs removes the "friendships" edge to Friendship entities by IDs.

func (*UserUpdate) RemoveFriendships

func (uu *UserUpdate) RemoveFriendships(f ...*Friendship) *UserUpdate

RemoveFriendships removes "friendships" edges to Friendship entities.

func (*UserUpdate) RemoveGroupIDs

func (uu *UserUpdate) RemoveGroupIDs(ids ...int) *UserUpdate

RemoveGroupIDs removes the "groups" edge to Group entities by IDs.

func (*UserUpdate) RemoveGroups

func (uu *UserUpdate) RemoveGroups(g ...*Group) *UserUpdate

RemoveGroups removes "groups" edges to Group entities.

func (*UserUpdate) 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) SetInput

func (c *UserUpdate) SetInput(i UpdateUserInput) *UserUpdate

SetInput applies the change-set in the UpdateUserInput on the UserUpdate builder.

func (*UserUpdate) SetMetadata

func (uu *UserUpdate) SetMetadata(m map[string]interface{}) *UserUpdate

SetMetadata sets the "metadata" field.

func (*UserUpdate) SetName

func (uu *UserUpdate) SetName(s string) *UserUpdate

SetName sets the "name" field.

func (*UserUpdate) SetNillableName

func (uu *UserUpdate) SetNillableName(s *string) *UserUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*UserUpdate) SetNillablePassword

func (uu *UserUpdate) SetNillablePassword(s *string) *UserUpdate

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UserUpdate) SetNillableUsername

func (uu *UserUpdate) SetNillableUsername(u *uuid.UUID) *UserUpdate

SetNillableUsername sets the "username" field if the given value is not nil.

func (*UserUpdate) SetPassword

func (uu *UserUpdate) SetPassword(s string) *UserUpdate

SetPassword sets the "password" field.

func (*UserUpdate) SetRequiredMetadata

func (uu *UserUpdate) SetRequiredMetadata(m map[string]interface{}) *UserUpdate

SetRequiredMetadata sets the "required_metadata" field.

func (*UserUpdate) SetUsername

func (uu *UserUpdate) SetUsername(u uuid.UUID) *UserUpdate

SetUsername sets the "username" field.

func (*UserUpdate) Where

func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to the UserUpdate builder.

type UserUpdateOne

type UserUpdateOne struct {
	// contains filtered or unexported fields
}

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) AddFriendIDs

func (uuo *UserUpdateOne) AddFriendIDs(ids ...int) *UserUpdateOne

AddFriendIDs adds the "friends" edge to the User entity by IDs.

func (*UserUpdateOne) AddFriends

func (uuo *UserUpdateOne) AddFriends(u ...*User) *UserUpdateOne

AddFriends adds the "friends" edges to the User entity.

func (*UserUpdateOne) AddFriendshipIDs

func (uuo *UserUpdateOne) AddFriendshipIDs(ids ...int) *UserUpdateOne

AddFriendshipIDs adds the "friendships" edge to the Friendship entity by IDs.

func (*UserUpdateOne) AddFriendships

func (uuo *UserUpdateOne) AddFriendships(f ...*Friendship) *UserUpdateOne

AddFriendships adds the "friendships" edges to the Friendship entity.

func (*UserUpdateOne) AddGroupIDs

func (uuo *UserUpdateOne) AddGroupIDs(ids ...int) *UserUpdateOne

AddGroupIDs adds the "groups" edge to the Group entity by IDs.

func (*UserUpdateOne) AddGroups

func (uuo *UserUpdateOne) AddGroups(g ...*Group) *UserUpdateOne

AddGroups adds the "groups" edges to the Group entity.

func (*UserUpdateOne) ClearFriends

func (uuo *UserUpdateOne) ClearFriends() *UserUpdateOne

ClearFriends clears all "friends" edges to the User entity.

func (*UserUpdateOne) ClearFriendships

func (uuo *UserUpdateOne) ClearFriendships() *UserUpdateOne

ClearFriendships clears all "friendships" edges to the Friendship entity.

func (*UserUpdateOne) ClearGroups

func (uuo *UserUpdateOne) ClearGroups() *UserUpdateOne

ClearGroups clears all "groups" edges to the Group entity.

func (*UserUpdateOne) ClearMetadata

func (uuo *UserUpdateOne) ClearMetadata() *UserUpdateOne

ClearMetadata clears the value of the "metadata" field.

func (*UserUpdateOne) ClearPassword

func (uuo *UserUpdateOne) ClearPassword() *UserUpdateOne

ClearPassword clears the value of the "password" field.

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) Modify

func (uuo *UserUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *UserUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) RemoveFriendIDs

func (uuo *UserUpdateOne) RemoveFriendIDs(ids ...int) *UserUpdateOne

RemoveFriendIDs removes the "friends" edge to User entities by IDs.

func (*UserUpdateOne) RemoveFriends

func (uuo *UserUpdateOne) RemoveFriends(u ...*User) *UserUpdateOne

RemoveFriends removes "friends" edges to User entities.

func (*UserUpdateOne) RemoveFriendshipIDs

func (uuo *UserUpdateOne) RemoveFriendshipIDs(ids ...int) *UserUpdateOne

RemoveFriendshipIDs removes the "friendships" edge to Friendship entities by IDs.

func (*UserUpdateOne) RemoveFriendships

func (uuo *UserUpdateOne) RemoveFriendships(f ...*Friendship) *UserUpdateOne

RemoveFriendships removes "friendships" edges to Friendship entities.

func (*UserUpdateOne) RemoveGroupIDs

func (uuo *UserUpdateOne) RemoveGroupIDs(ids ...int) *UserUpdateOne

RemoveGroupIDs removes the "groups" edge to Group entities by IDs.

func (*UserUpdateOne) RemoveGroups

func (uuo *UserUpdateOne) RemoveGroups(g ...*Group) *UserUpdateOne

RemoveGroups removes "groups" edges to Group entities.

func (*UserUpdateOne) 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) SetInput

SetInput applies the change-set in the UpdateUserInput on the UserUpdateOne builder.

func (*UserUpdateOne) SetMetadata

func (uuo *UserUpdateOne) SetMetadata(m map[string]interface{}) *UserUpdateOne

SetMetadata sets the "metadata" field.

func (*UserUpdateOne) SetName

func (uuo *UserUpdateOne) SetName(s string) *UserUpdateOne

SetName sets the "name" field.

func (*UserUpdateOne) SetNillableName

func (uuo *UserUpdateOne) SetNillableName(s *string) *UserUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*UserUpdateOne) SetNillablePassword

func (uuo *UserUpdateOne) SetNillablePassword(s *string) *UserUpdateOne

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UserUpdateOne) SetNillableUsername

func (uuo *UserUpdateOne) SetNillableUsername(u *uuid.UUID) *UserUpdateOne

SetNillableUsername sets the "username" field if the given value is not nil.

func (*UserUpdateOne) SetPassword

func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne

SetPassword sets the "password" field.

func (*UserUpdateOne) SetRequiredMetadata

func (uuo *UserUpdateOne) SetRequiredMetadata(m map[string]interface{}) *UserUpdateOne

SetRequiredMetadata sets the "required_metadata" field.

func (*UserUpdateOne) SetUsername

func (uuo *UserUpdateOne) SetUsername(u uuid.UUID) *UserUpdateOne

SetUsername sets the "username" field.

func (*UserUpdateOne) Where

func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne

Where appends a list predicates to the UserUpdate builder.

type 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      *int  `json:"id,omitempty"`
	IDNEQ   *int  `json:"idNEQ,omitempty"`
	IDIn    []int `json:"idIn,omitempty"`
	IDNotIn []int `json:"idNotIn,omitempty"`
	IDGT    *int  `json:"idGT,omitempty"`
	IDGTE   *int  `json:"idGTE,omitempty"`
	IDLT    *int  `json:"idLT,omitempty"`
	IDLTE   *int  `json:"idLTE,omitempty"`

	// "name" field predicates.
	Name             *string  `json:"name,omitempty"`
	NameNEQ          *string  `json:"nameNEQ,omitempty"`
	NameIn           []string `json:"nameIn,omitempty"`
	NameNotIn        []string `json:"nameNotIn,omitempty"`
	NameGT           *string  `json:"nameGT,omitempty"`
	NameGTE          *string  `json:"nameGTE,omitempty"`
	NameLT           *string  `json:"nameLT,omitempty"`
	NameLTE          *string  `json:"nameLTE,omitempty"`
	NameContains     *string  `json:"nameContains,omitempty"`
	NameHasPrefix    *string  `json:"nameHasPrefix,omitempty"`
	NameHasSuffix    *string  `json:"nameHasSuffix,omitempty"`
	NameEqualFold    *string  `json:"nameEqualFold,omitempty"`
	NameContainsFold *string  `json:"nameContainsFold,omitempty"`

	// "username" field predicates.
	Username      *uuid.UUID  `json:"username,omitempty"`
	UsernameNEQ   *uuid.UUID  `json:"usernameNEQ,omitempty"`
	UsernameIn    []uuid.UUID `json:"usernameIn,omitempty"`
	UsernameNotIn []uuid.UUID `json:"usernameNotIn,omitempty"`
	UsernameGT    *uuid.UUID  `json:"usernameGT,omitempty"`
	UsernameGTE   *uuid.UUID  `json:"usernameGTE,omitempty"`
	UsernameLT    *uuid.UUID  `json:"usernameLT,omitempty"`
	UsernameLTE   *uuid.UUID  `json:"usernameLTE,omitempty"`

	// "password" field predicates.
	Password             *string  `json:"password,omitempty"`
	PasswordNEQ          *string  `json:"passwordNEQ,omitempty"`
	PasswordIn           []string `json:"passwordIn,omitempty"`
	PasswordNotIn        []string `json:"passwordNotIn,omitempty"`
	PasswordGT           *string  `json:"passwordGT,omitempty"`
	PasswordGTE          *string  `json:"passwordGTE,omitempty"`
	PasswordLT           *string  `json:"passwordLT,omitempty"`
	PasswordLTE          *string  `json:"passwordLTE,omitempty"`
	PasswordContains     *string  `json:"passwordContains,omitempty"`
	PasswordHasPrefix    *string  `json:"passwordHasPrefix,omitempty"`
	PasswordHasSuffix    *string  `json:"passwordHasSuffix,omitempty"`
	PasswordIsNil        bool     `json:"passwordIsNil,omitempty"`
	PasswordNotNil       bool     `json:"passwordNotNil,omitempty"`
	PasswordEqualFold    *string  `json:"passwordEqualFold,omitempty"`
	PasswordContainsFold *string  `json:"passwordContainsFold,omitempty"`

	// "groups" edge predicates.
	HasGroups     *bool              `json:"hasGroups,omitempty"`
	HasGroupsWith []*GroupWhereInput `json:"hasGroupsWith,omitempty"`

	// "friends" edge predicates.
	HasFriends     *bool             `json:"hasFriends,omitempty"`
	HasFriendsWith []*UserWhereInput `json:"hasFriendsWith,omitempty"`

	// "friendships" edge predicates.
	HasFriendships     *bool                   `json:"hasFriendships,omitempty"`
	HasFriendshipsWith []*FriendshipWhereInput `json:"hasFriendshipsWith,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.

type VerySecret

type VerySecret struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Password holds the value of the "password" field.
	Password string `json:"password,omitempty"`
	// contains filtered or unexported fields
}

VerySecret is the model entity for the VerySecret schema.

func (*VerySecret) String

func (vs *VerySecret) String() string

String implements the fmt.Stringer.

func (*VerySecret) Unwrap

func (vs *VerySecret) Unwrap() *VerySecret

Unwrap unwraps the VerySecret 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 (*VerySecret) Update

func (vs *VerySecret) Update() *VerySecretUpdateOne

Update returns a builder for updating this VerySecret. Note that you need to call VerySecret.Unwrap() before calling this method if this VerySecret was returned from a transaction, and the transaction was committed or rolled back.

func (*VerySecret) Value

func (vs *VerySecret) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the VerySecret. This includes values selected through modifiers, order, etc.

type VerySecretClient

type VerySecretClient struct {
	// contains filtered or unexported fields
}

VerySecretClient is a client for the VerySecret schema.

func NewVerySecretClient

func NewVerySecretClient(c config) *VerySecretClient

NewVerySecretClient returns a client for the VerySecret from the given config.

func (*VerySecretClient) Create

func (c *VerySecretClient) Create() *VerySecretCreate

Create returns a builder for creating a VerySecret entity.

func (*VerySecretClient) CreateBulk

func (c *VerySecretClient) CreateBulk(builders ...*VerySecretCreate) *VerySecretCreateBulk

CreateBulk returns a builder for creating a bulk of VerySecret entities.

func (*VerySecretClient) Delete

func (c *VerySecretClient) Delete() *VerySecretDelete

Delete returns a delete builder for VerySecret.

func (*VerySecretClient) DeleteOne

func (c *VerySecretClient) DeleteOne(vs *VerySecret) *VerySecretDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*VerySecretClient) DeleteOneID

func (c *VerySecretClient) DeleteOneID(id int) *VerySecretDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*VerySecretClient) Get

func (c *VerySecretClient) Get(ctx context.Context, id int) (*VerySecret, error)

Get returns a VerySecret entity by its id.

func (*VerySecretClient) GetX

func (c *VerySecretClient) GetX(ctx context.Context, id int) *VerySecret

GetX is like Get, but panics if an error occurs.

func (*VerySecretClient) Hooks

func (c *VerySecretClient) Hooks() []Hook

Hooks returns the client hooks.

func (*VerySecretClient) Intercept

func (c *VerySecretClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `verysecret.Intercept(f(g(h())))`.

func (*VerySecretClient) Interceptors

func (c *VerySecretClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*VerySecretClient) MapCreateBulk

func (c *VerySecretClient) MapCreateBulk(slice any, setFunc func(*VerySecretCreate, int)) *VerySecretCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*VerySecretClient) Query

func (c *VerySecretClient) Query() *VerySecretQuery

Query returns a query builder for VerySecret.

func (*VerySecretClient) Update

func (c *VerySecretClient) Update() *VerySecretUpdate

Update returns an update builder for VerySecret.

func (*VerySecretClient) UpdateOne

func (c *VerySecretClient) UpdateOne(vs *VerySecret) *VerySecretUpdateOne

UpdateOne returns an update builder for the given entity.

func (*VerySecretClient) UpdateOneID

func (c *VerySecretClient) UpdateOneID(id int) *VerySecretUpdateOne

UpdateOneID returns an update builder for the given id.

func (*VerySecretClient) Use

func (c *VerySecretClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `verysecret.Hooks(f(g(h())))`.

type VerySecretCreate

type VerySecretCreate struct {
	// contains filtered or unexported fields
}

VerySecretCreate is the builder for creating a VerySecret entity.

func (*VerySecretCreate) Exec

func (vsc *VerySecretCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*VerySecretCreate) ExecX

func (vsc *VerySecretCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*VerySecretCreate) Mutation

func (vsc *VerySecretCreate) Mutation() *VerySecretMutation

Mutation returns the VerySecretMutation object of the builder.

func (*VerySecretCreate) Save

func (vsc *VerySecretCreate) Save(ctx context.Context) (*VerySecret, error)

Save creates the VerySecret in the database.

func (*VerySecretCreate) SaveX

func (vsc *VerySecretCreate) SaveX(ctx context.Context) *VerySecret

SaveX calls Save and panics if Save returns an error.

func (*VerySecretCreate) SetPassword

func (vsc *VerySecretCreate) SetPassword(s string) *VerySecretCreate

SetPassword sets the "password" field.

type VerySecretCreateBulk

type VerySecretCreateBulk struct {
	// contains filtered or unexported fields
}

VerySecretCreateBulk is the builder for creating many VerySecret entities in bulk.

func (*VerySecretCreateBulk) Exec

func (vscb *VerySecretCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*VerySecretCreateBulk) ExecX

func (vscb *VerySecretCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*VerySecretCreateBulk) Save

func (vscb *VerySecretCreateBulk) Save(ctx context.Context) ([]*VerySecret, error)

Save creates the VerySecret entities in the database.

func (*VerySecretCreateBulk) SaveX

func (vscb *VerySecretCreateBulk) SaveX(ctx context.Context) []*VerySecret

SaveX is like Save, but panics if an error occurs.

type VerySecretDelete

type VerySecretDelete struct {
	// contains filtered or unexported fields
}

VerySecretDelete is the builder for deleting a VerySecret entity.

func (*VerySecretDelete) Exec

func (vsd *VerySecretDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*VerySecretDelete) ExecX

func (vsd *VerySecretDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*VerySecretDelete) Where

Where appends a list predicates to the VerySecretDelete builder.

type VerySecretDeleteOne

type VerySecretDeleteOne struct {
	// contains filtered or unexported fields
}

VerySecretDeleteOne is the builder for deleting a single VerySecret entity.

func (*VerySecretDeleteOne) Exec

func (vsdo *VerySecretDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*VerySecretDeleteOne) ExecX

func (vsdo *VerySecretDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*VerySecretDeleteOne) Where

Where appends a list predicates to the VerySecretDelete builder.

type VerySecretGroupBy

type VerySecretGroupBy struct {
	// contains filtered or unexported fields
}

VerySecretGroupBy is the group-by builder for VerySecret entities.

func (*VerySecretGroupBy) Aggregate

func (vsgb *VerySecretGroupBy) Aggregate(fns ...AggregateFunc) *VerySecretGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*VerySecretGroupBy) Bool

func (s *VerySecretGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*VerySecretGroupBy) BoolX

func (s *VerySecretGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*VerySecretGroupBy) Bools

func (s *VerySecretGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*VerySecretGroupBy) BoolsX

func (s *VerySecretGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*VerySecretGroupBy) Float64

func (s *VerySecretGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*VerySecretGroupBy) Float64X

func (s *VerySecretGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*VerySecretGroupBy) Float64s

func (s *VerySecretGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*VerySecretGroupBy) Float64sX

func (s *VerySecretGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*VerySecretGroupBy) Int

func (s *VerySecretGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*VerySecretGroupBy) IntX

func (s *VerySecretGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*VerySecretGroupBy) Ints

func (s *VerySecretGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*VerySecretGroupBy) IntsX

func (s *VerySecretGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*VerySecretGroupBy) Scan

func (vsgb *VerySecretGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*VerySecretGroupBy) ScanX

func (s *VerySecretGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*VerySecretGroupBy) String

func (s *VerySecretGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*VerySecretGroupBy) StringX

func (s *VerySecretGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*VerySecretGroupBy) Strings

func (s *VerySecretGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*VerySecretGroupBy) StringsX

func (s *VerySecretGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type VerySecretMutation

type VerySecretMutation struct {
	// contains filtered or unexported fields
}

VerySecretMutation represents an operation that mutates the VerySecret nodes in the graph.

func (*VerySecretMutation) AddField

func (m *VerySecretMutation) 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 (*VerySecretMutation) AddedEdges

func (m *VerySecretMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*VerySecretMutation) AddedField

func (m *VerySecretMutation) 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 (*VerySecretMutation) AddedFields

func (m *VerySecretMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*VerySecretMutation) AddedIDs

func (m *VerySecretMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*VerySecretMutation) ClearEdge

func (m *VerySecretMutation) 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 (*VerySecretMutation) ClearField

func (m *VerySecretMutation) 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 (*VerySecretMutation) ClearedEdges

func (m *VerySecretMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*VerySecretMutation) ClearedFields

func (m *VerySecretMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (VerySecretMutation) Client

func (m VerySecretMutation) 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 (*VerySecretMutation) EdgeCleared

func (m *VerySecretMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*VerySecretMutation) Field

func (m *VerySecretMutation) 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 (*VerySecretMutation) FieldCleared

func (m *VerySecretMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*VerySecretMutation) Fields

func (m *VerySecretMutation) 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 (*VerySecretMutation) ID

func (m *VerySecretMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*VerySecretMutation) IDs

func (m *VerySecretMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*VerySecretMutation) OldField

func (m *VerySecretMutation) 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 (*VerySecretMutation) OldPassword

func (m *VerySecretMutation) OldPassword(ctx context.Context) (v string, err error)

OldPassword returns the old "password" field's value of the VerySecret entity. If the VerySecret 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 (*VerySecretMutation) Op

func (m *VerySecretMutation) Op() Op

Op returns the operation name.

func (*VerySecretMutation) Password

func (m *VerySecretMutation) Password() (r string, exists bool)

Password returns the value of the "password" field in the mutation.

func (*VerySecretMutation) RemovedEdges

func (m *VerySecretMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*VerySecretMutation) RemovedIDs

func (m *VerySecretMutation) 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 (*VerySecretMutation) ResetEdge

func (m *VerySecretMutation) 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 (*VerySecretMutation) ResetField

func (m *VerySecretMutation) 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 (*VerySecretMutation) ResetPassword

func (m *VerySecretMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*VerySecretMutation) SetField

func (m *VerySecretMutation) 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 (*VerySecretMutation) SetOp

func (m *VerySecretMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*VerySecretMutation) SetPassword

func (m *VerySecretMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (VerySecretMutation) Tx

func (m VerySecretMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*VerySecretMutation) Type

func (m *VerySecretMutation) Type() string

Type returns the node type of this mutation (VerySecret).

func (*VerySecretMutation) Where

func (m *VerySecretMutation) Where(ps ...predicate.VerySecret)

Where appends a list predicates to the VerySecretMutation builder.

func (*VerySecretMutation) WhereP

func (m *VerySecretMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the VerySecretMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type VerySecretQuery

type VerySecretQuery struct {
	// contains filtered or unexported fields
}

VerySecretQuery is the builder for querying VerySecret entities.

func (*VerySecretQuery) Aggregate

func (vsq *VerySecretQuery) Aggregate(fns ...AggregateFunc) *VerySecretSelect

Aggregate returns a VerySecretSelect configured with the given aggregations.

func (*VerySecretQuery) All

func (vsq *VerySecretQuery) All(ctx context.Context) ([]*VerySecret, error)

All executes the query and returns a list of VerySecrets.

func (*VerySecretQuery) AllX

func (vsq *VerySecretQuery) AllX(ctx context.Context) []*VerySecret

AllX is like All, but panics if an error occurs.

func (*VerySecretQuery) Clone

func (vsq *VerySecretQuery) Clone() *VerySecretQuery

Clone returns a duplicate of the VerySecretQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*VerySecretQuery) Count

func (vsq *VerySecretQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*VerySecretQuery) CountX

func (vsq *VerySecretQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*VerySecretQuery) Exist

func (vsq *VerySecretQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*VerySecretQuery) ExistX

func (vsq *VerySecretQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*VerySecretQuery) First

func (vsq *VerySecretQuery) First(ctx context.Context) (*VerySecret, error)

First returns the first VerySecret entity from the query. Returns a *NotFoundError when no VerySecret was found.

func (*VerySecretQuery) FirstID

func (vsq *VerySecretQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first VerySecret ID from the query. Returns a *NotFoundError when no VerySecret ID was found.

func (*VerySecretQuery) FirstIDX

func (vsq *VerySecretQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*VerySecretQuery) FirstX

func (vsq *VerySecretQuery) FirstX(ctx context.Context) *VerySecret

FirstX is like First, but panics if an error occurs.

func (*VerySecretQuery) GroupBy

func (vsq *VerySecretQuery) GroupBy(field string, fields ...string) *VerySecretGroupBy

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 {
	Password string `json:"password,omitempty"`
	Count int `json:"count,omitempty"`
}

client.VerySecret.Query().
	GroupBy(verysecret.FieldPassword).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*VerySecretQuery) IDs

func (vsq *VerySecretQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of VerySecret IDs.

func (*VerySecretQuery) IDsX

func (vsq *VerySecretQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*VerySecretQuery) Limit

func (vsq *VerySecretQuery) Limit(limit int) *VerySecretQuery

Limit the number of records to be returned by this query.

func (*VerySecretQuery) Modify

func (vsq *VerySecretQuery) Modify(modifiers ...func(s *sql.Selector)) *VerySecretSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*VerySecretQuery) Offset

func (vsq *VerySecretQuery) Offset(offset int) *VerySecretQuery

Offset to start from.

func (*VerySecretQuery) Only

func (vsq *VerySecretQuery) Only(ctx context.Context) (*VerySecret, error)

Only returns a single VerySecret entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one VerySecret entity is found. Returns a *NotFoundError when no VerySecret entities are found.

func (*VerySecretQuery) OnlyID

func (vsq *VerySecretQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only VerySecret ID in the query. Returns a *NotSingularError when more than one VerySecret ID is found. Returns a *NotFoundError when no entities are found.

func (*VerySecretQuery) OnlyIDX

func (vsq *VerySecretQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*VerySecretQuery) OnlyX

func (vsq *VerySecretQuery) OnlyX(ctx context.Context) *VerySecret

OnlyX is like Only, but panics if an error occurs.

func (*VerySecretQuery) Order

Order specifies how the records should be ordered.

func (*VerySecretQuery) Select

func (vsq *VerySecretQuery) Select(fields ...string) *VerySecretSelect

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 {
	Password string `json:"password,omitempty"`
}

client.VerySecret.Query().
	Select(verysecret.FieldPassword).
	Scan(ctx, &v)

func (*VerySecretQuery) Unique

func (vsq *VerySecretQuery) Unique(unique bool) *VerySecretQuery

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 (*VerySecretQuery) Where

Where adds a new predicate for the VerySecretQuery builder.

type VerySecretSelect

type VerySecretSelect struct {
	*VerySecretQuery
	// contains filtered or unexported fields
}

VerySecretSelect is the builder for selecting fields of VerySecret entities.

func (*VerySecretSelect) Aggregate

func (vss *VerySecretSelect) Aggregate(fns ...AggregateFunc) *VerySecretSelect

Aggregate adds the given aggregation functions to the selector query.

func (*VerySecretSelect) Bool

func (s *VerySecretSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*VerySecretSelect) BoolX

func (s *VerySecretSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*VerySecretSelect) Bools

func (s *VerySecretSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*VerySecretSelect) BoolsX

func (s *VerySecretSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*VerySecretSelect) Float64

func (s *VerySecretSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*VerySecretSelect) Float64X

func (s *VerySecretSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*VerySecretSelect) Float64s

func (s *VerySecretSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*VerySecretSelect) Float64sX

func (s *VerySecretSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*VerySecretSelect) Int

func (s *VerySecretSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*VerySecretSelect) IntX

func (s *VerySecretSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*VerySecretSelect) Ints

func (s *VerySecretSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*VerySecretSelect) IntsX

func (s *VerySecretSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*VerySecretSelect) Modify

func (vss *VerySecretSelect) Modify(modifiers ...func(s *sql.Selector)) *VerySecretSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*VerySecretSelect) Scan

func (vss *VerySecretSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*VerySecretSelect) ScanX

func (s *VerySecretSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*VerySecretSelect) String

func (s *VerySecretSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*VerySecretSelect) StringX

func (s *VerySecretSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*VerySecretSelect) Strings

func (s *VerySecretSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*VerySecretSelect) StringsX

func (s *VerySecretSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type VerySecretUpdate

type VerySecretUpdate struct {
	// contains filtered or unexported fields
}

VerySecretUpdate is the builder for updating VerySecret entities.

func (*VerySecretUpdate) Exec

func (vsu *VerySecretUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*VerySecretUpdate) ExecX

func (vsu *VerySecretUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*VerySecretUpdate) Modify

func (vsu *VerySecretUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *VerySecretUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*VerySecretUpdate) Mutation

func (vsu *VerySecretUpdate) Mutation() *VerySecretMutation

Mutation returns the VerySecretMutation object of the builder.

func (*VerySecretUpdate) Save

func (vsu *VerySecretUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*VerySecretUpdate) SaveX

func (vsu *VerySecretUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*VerySecretUpdate) SetNillablePassword

func (vsu *VerySecretUpdate) SetNillablePassword(s *string) *VerySecretUpdate

SetNillablePassword sets the "password" field if the given value is not nil.

func (*VerySecretUpdate) SetPassword

func (vsu *VerySecretUpdate) SetPassword(s string) *VerySecretUpdate

SetPassword sets the "password" field.

func (*VerySecretUpdate) Where

Where appends a list predicates to the VerySecretUpdate builder.

type VerySecretUpdateOne

type VerySecretUpdateOne struct {
	// contains filtered or unexported fields
}

VerySecretUpdateOne is the builder for updating a single VerySecret entity.

func (*VerySecretUpdateOne) Exec

func (vsuo *VerySecretUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*VerySecretUpdateOne) ExecX

func (vsuo *VerySecretUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*VerySecretUpdateOne) Modify

func (vsuo *VerySecretUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *VerySecretUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*VerySecretUpdateOne) Mutation

func (vsuo *VerySecretUpdateOne) Mutation() *VerySecretMutation

Mutation returns the VerySecretMutation object of the builder.

func (*VerySecretUpdateOne) Save

func (vsuo *VerySecretUpdateOne) Save(ctx context.Context) (*VerySecret, error)

Save executes the query and returns the updated VerySecret entity.

func (*VerySecretUpdateOne) SaveX

func (vsuo *VerySecretUpdateOne) SaveX(ctx context.Context) *VerySecret

SaveX is like Save, but panics if an error occurs.

func (*VerySecretUpdateOne) Select

func (vsuo *VerySecretUpdateOne) Select(field string, fields ...string) *VerySecretUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*VerySecretUpdateOne) SetNillablePassword

func (vsuo *VerySecretUpdateOne) SetNillablePassword(s *string) *VerySecretUpdateOne

SetNillablePassword sets the "password" field if the given value is not nil.

func (*VerySecretUpdateOne) SetPassword

func (vsuo *VerySecretUpdateOne) SetPassword(s string) *VerySecretUpdateOne

SetPassword sets the "password" field.

func (*VerySecretUpdateOne) Where

Where appends a list predicates to the VerySecretUpdate builder.

type VerySecrets

type VerySecrets []*VerySecret

VerySecrets is a parsable slice of VerySecret.

type Workspace

type Workspace struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// contains filtered or unexported fields
}

Workspace is the model entity for the Workspace schema.

func (*Workspace) IsNode

func (*Workspace) IsNode()

IsNode implements the Node interface check for GQLGen.

func (*Workspace) Node

func (w *Workspace) Node(ctx context.Context) (node *Node, err error)

Node implements Noder interface

func (*Workspace) String

func (w *Workspace) String() string

String implements the fmt.Stringer.

func (*Workspace) Unwrap

func (w *Workspace) Unwrap() *Workspace

Unwrap unwraps the Workspace 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 (*Workspace) Update

func (w *Workspace) Update() *WorkspaceUpdateOne

Update returns a builder for updating this Workspace. Note that you need to call Workspace.Unwrap() before calling this method if this Workspace was returned from a transaction, and the transaction was committed or rolled back.

func (*Workspace) Value

func (w *Workspace) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Workspace. This includes values selected through modifiers, order, etc.

type WorkspaceClient

type WorkspaceClient struct {
	// contains filtered or unexported fields
}

WorkspaceClient is a client for the Workspace schema.

func NewWorkspaceClient

func NewWorkspaceClient(c config) *WorkspaceClient

NewWorkspaceClient returns a client for the Workspace from the given config.

func (*WorkspaceClient) Create

func (c *WorkspaceClient) Create() *WorkspaceCreate

Create returns a builder for creating a Workspace entity.

func (*WorkspaceClient) CreateBulk

func (c *WorkspaceClient) CreateBulk(builders ...*WorkspaceCreate) *WorkspaceCreateBulk

CreateBulk returns a builder for creating a bulk of Workspace entities.

func (*WorkspaceClient) Delete

func (c *WorkspaceClient) Delete() *WorkspaceDelete

Delete returns a delete builder for Workspace.

func (*WorkspaceClient) DeleteOne

func (c *WorkspaceClient) DeleteOne(w *Workspace) *WorkspaceDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*WorkspaceClient) DeleteOneID

func (c *WorkspaceClient) DeleteOneID(id int) *WorkspaceDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*WorkspaceClient) Get

func (c *WorkspaceClient) Get(ctx context.Context, id int) (*Workspace, error)

Get returns a Workspace entity by its id.

func (*WorkspaceClient) GetX

func (c *WorkspaceClient) GetX(ctx context.Context, id int) *Workspace

GetX is like Get, but panics if an error occurs.

func (*WorkspaceClient) Hooks

func (c *WorkspaceClient) Hooks() []Hook

Hooks returns the client hooks.

func (*WorkspaceClient) Intercept

func (c *WorkspaceClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `workspace.Intercept(f(g(h())))`.

func (*WorkspaceClient) Interceptors

func (c *WorkspaceClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*WorkspaceClient) MapCreateBulk

func (c *WorkspaceClient) MapCreateBulk(slice any, setFunc func(*WorkspaceCreate, int)) *WorkspaceCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*WorkspaceClient) Query

func (c *WorkspaceClient) Query() *WorkspaceQuery

Query returns a query builder for Workspace.

func (*WorkspaceClient) Update

func (c *WorkspaceClient) Update() *WorkspaceUpdate

Update returns an update builder for Workspace.

func (*WorkspaceClient) UpdateOne

func (c *WorkspaceClient) UpdateOne(w *Workspace) *WorkspaceUpdateOne

UpdateOne returns an update builder for the given entity.

func (*WorkspaceClient) UpdateOneID

func (c *WorkspaceClient) UpdateOneID(id int) *WorkspaceUpdateOne

UpdateOneID returns an update builder for the given id.

func (*WorkspaceClient) Use

func (c *WorkspaceClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `workspace.Hooks(f(g(h())))`.

type WorkspaceCreate

type WorkspaceCreate struct {
	// contains filtered or unexported fields
}

WorkspaceCreate is the builder for creating a Workspace entity.

func (*WorkspaceCreate) Exec

func (wc *WorkspaceCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*WorkspaceCreate) ExecX

func (wc *WorkspaceCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WorkspaceCreate) Mutation

func (wc *WorkspaceCreate) Mutation() *WorkspaceMutation

Mutation returns the WorkspaceMutation object of the builder.

func (*WorkspaceCreate) Save

func (wc *WorkspaceCreate) Save(ctx context.Context) (*Workspace, error)

Save creates the Workspace in the database.

func (*WorkspaceCreate) SaveX

func (wc *WorkspaceCreate) SaveX(ctx context.Context) *Workspace

SaveX calls Save and panics if Save returns an error.

func (*WorkspaceCreate) SetName

func (wc *WorkspaceCreate) SetName(s string) *WorkspaceCreate

SetName sets the "name" field.

type WorkspaceCreateBulk

type WorkspaceCreateBulk struct {
	// contains filtered or unexported fields
}

WorkspaceCreateBulk is the builder for creating many Workspace entities in bulk.

func (*WorkspaceCreateBulk) Exec

func (wcb *WorkspaceCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*WorkspaceCreateBulk) ExecX

func (wcb *WorkspaceCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WorkspaceCreateBulk) Save

func (wcb *WorkspaceCreateBulk) Save(ctx context.Context) ([]*Workspace, error)

Save creates the Workspace entities in the database.

func (*WorkspaceCreateBulk) SaveX

func (wcb *WorkspaceCreateBulk) SaveX(ctx context.Context) []*Workspace

SaveX is like Save, but panics if an error occurs.

type WorkspaceDelete

type WorkspaceDelete struct {
	// contains filtered or unexported fields
}

WorkspaceDelete is the builder for deleting a Workspace entity.

func (*WorkspaceDelete) Exec

func (wd *WorkspaceDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*WorkspaceDelete) ExecX

func (wd *WorkspaceDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*WorkspaceDelete) Where

Where appends a list predicates to the WorkspaceDelete builder.

type WorkspaceDeleteOne

type WorkspaceDeleteOne struct {
	// contains filtered or unexported fields
}

WorkspaceDeleteOne is the builder for deleting a single Workspace entity.

func (*WorkspaceDeleteOne) Exec

func (wdo *WorkspaceDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*WorkspaceDeleteOne) ExecX

func (wdo *WorkspaceDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WorkspaceDeleteOne) Where

Where appends a list predicates to the WorkspaceDelete builder.

type WorkspaceGroupBy

type WorkspaceGroupBy struct {
	// contains filtered or unexported fields
}

WorkspaceGroupBy is the group-by builder for Workspace entities.

func (*WorkspaceGroupBy) Aggregate

func (wgb *WorkspaceGroupBy) Aggregate(fns ...AggregateFunc) *WorkspaceGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*WorkspaceGroupBy) Bool

func (s *WorkspaceGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*WorkspaceGroupBy) BoolX

func (s *WorkspaceGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*WorkspaceGroupBy) Bools

func (s *WorkspaceGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*WorkspaceGroupBy) BoolsX

func (s *WorkspaceGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*WorkspaceGroupBy) Float64

func (s *WorkspaceGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*WorkspaceGroupBy) Float64X

func (s *WorkspaceGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*WorkspaceGroupBy) Float64s

func (s *WorkspaceGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*WorkspaceGroupBy) Float64sX

func (s *WorkspaceGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*WorkspaceGroupBy) Int

func (s *WorkspaceGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*WorkspaceGroupBy) IntX

func (s *WorkspaceGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*WorkspaceGroupBy) Ints

func (s *WorkspaceGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*WorkspaceGroupBy) IntsX

func (s *WorkspaceGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*WorkspaceGroupBy) Scan

func (wgb *WorkspaceGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*WorkspaceGroupBy) ScanX

func (s *WorkspaceGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*WorkspaceGroupBy) String

func (s *WorkspaceGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*WorkspaceGroupBy) StringX

func (s *WorkspaceGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*WorkspaceGroupBy) Strings

func (s *WorkspaceGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*WorkspaceGroupBy) StringsX

func (s *WorkspaceGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type WorkspaceMutation

type WorkspaceMutation struct {
	// contains filtered or unexported fields
}

WorkspaceMutation represents an operation that mutates the Workspace nodes in the graph.

func (*WorkspaceMutation) AddField

func (m *WorkspaceMutation) 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 (*WorkspaceMutation) AddedEdges

func (m *WorkspaceMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*WorkspaceMutation) AddedField

func (m *WorkspaceMutation) 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 (*WorkspaceMutation) AddedFields

func (m *WorkspaceMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*WorkspaceMutation) AddedIDs

func (m *WorkspaceMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*WorkspaceMutation) ClearEdge

func (m *WorkspaceMutation) 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 (*WorkspaceMutation) ClearField

func (m *WorkspaceMutation) 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 (*WorkspaceMutation) ClearedEdges

func (m *WorkspaceMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*WorkspaceMutation) ClearedFields

func (m *WorkspaceMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (WorkspaceMutation) Client

func (m WorkspaceMutation) 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 (*WorkspaceMutation) EdgeCleared

func (m *WorkspaceMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*WorkspaceMutation) Field

func (m *WorkspaceMutation) 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 (*WorkspaceMutation) FieldCleared

func (m *WorkspaceMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*WorkspaceMutation) Fields

func (m *WorkspaceMutation) 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 (*WorkspaceMutation) ID

func (m *WorkspaceMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*WorkspaceMutation) IDs

func (m *WorkspaceMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*WorkspaceMutation) Name

func (m *WorkspaceMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*WorkspaceMutation) OldField

func (m *WorkspaceMutation) 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 (*WorkspaceMutation) OldName

func (m *WorkspaceMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Workspace entity. If the Workspace 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 (*WorkspaceMutation) Op

func (m *WorkspaceMutation) Op() Op

Op returns the operation name.

func (*WorkspaceMutation) RemovedEdges

func (m *WorkspaceMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*WorkspaceMutation) RemovedIDs

func (m *WorkspaceMutation) 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 (*WorkspaceMutation) ResetEdge

func (m *WorkspaceMutation) 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 (*WorkspaceMutation) ResetField

func (m *WorkspaceMutation) 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 (*WorkspaceMutation) ResetName

func (m *WorkspaceMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*WorkspaceMutation) SetField

func (m *WorkspaceMutation) 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 (*WorkspaceMutation) SetName

func (m *WorkspaceMutation) SetName(s string)

SetName sets the "name" field.

func (*WorkspaceMutation) SetOp

func (m *WorkspaceMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (WorkspaceMutation) Tx

func (m WorkspaceMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*WorkspaceMutation) Type

func (m *WorkspaceMutation) Type() string

Type returns the node type of this mutation (Workspace).

func (*WorkspaceMutation) Where

func (m *WorkspaceMutation) Where(ps ...predicate.Workspace)

Where appends a list predicates to the WorkspaceMutation builder.

func (*WorkspaceMutation) WhereP

func (m *WorkspaceMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the WorkspaceMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type WorkspaceQuery

type WorkspaceQuery struct {
	// contains filtered or unexported fields
}

WorkspaceQuery is the builder for querying Workspace entities.

func (*WorkspaceQuery) Aggregate

func (wq *WorkspaceQuery) Aggregate(fns ...AggregateFunc) *WorkspaceSelect

Aggregate returns a WorkspaceSelect configured with the given aggregations.

func (*WorkspaceQuery) All

func (wq *WorkspaceQuery) All(ctx context.Context) ([]*Workspace, error)

All executes the query and returns a list of Workspaces.

func (*WorkspaceQuery) AllX

func (wq *WorkspaceQuery) AllX(ctx context.Context) []*Workspace

AllX is like All, but panics if an error occurs.

func (*WorkspaceQuery) Clone

func (wq *WorkspaceQuery) Clone() *WorkspaceQuery

Clone returns a duplicate of the WorkspaceQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*WorkspaceQuery) CollectFields

func (w *WorkspaceQuery) CollectFields(ctx context.Context, satisfies ...string) (*WorkspaceQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*WorkspaceQuery) Count

func (wq *WorkspaceQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*WorkspaceQuery) CountX

func (wq *WorkspaceQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*WorkspaceQuery) Exist

func (wq *WorkspaceQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*WorkspaceQuery) ExistX

func (wq *WorkspaceQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*WorkspaceQuery) First

func (wq *WorkspaceQuery) First(ctx context.Context) (*Workspace, error)

First returns the first Workspace entity from the query. Returns a *NotFoundError when no Workspace was found.

func (*WorkspaceQuery) FirstID

func (wq *WorkspaceQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Workspace ID from the query. Returns a *NotFoundError when no Workspace ID was found.

func (*WorkspaceQuery) FirstIDX

func (wq *WorkspaceQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*WorkspaceQuery) FirstX

func (wq *WorkspaceQuery) FirstX(ctx context.Context) *Workspace

FirstX is like First, but panics if an error occurs.

func (*WorkspaceQuery) GroupBy

func (wq *WorkspaceQuery) GroupBy(field string, fields ...string) *WorkspaceGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Workspace.Query().
	GroupBy(workspace.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*WorkspaceQuery) IDs

func (wq *WorkspaceQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Workspace IDs.

func (*WorkspaceQuery) IDsX

func (wq *WorkspaceQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*WorkspaceQuery) Limit

func (wq *WorkspaceQuery) Limit(limit int) *WorkspaceQuery

Limit the number of records to be returned by this query.

func (*WorkspaceQuery) Modify

func (wq *WorkspaceQuery) Modify(modifiers ...func(s *sql.Selector)) *WorkspaceSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*WorkspaceQuery) Offset

func (wq *WorkspaceQuery) Offset(offset int) *WorkspaceQuery

Offset to start from.

func (*WorkspaceQuery) Only

func (wq *WorkspaceQuery) Only(ctx context.Context) (*Workspace, error)

Only returns a single Workspace entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Workspace entity is found. Returns a *NotFoundError when no Workspace entities are found.

func (*WorkspaceQuery) OnlyID

func (wq *WorkspaceQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Workspace ID in the query. Returns a *NotSingularError when more than one Workspace ID is found. Returns a *NotFoundError when no entities are found.

func (*WorkspaceQuery) OnlyIDX

func (wq *WorkspaceQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*WorkspaceQuery) OnlyX

func (wq *WorkspaceQuery) OnlyX(ctx context.Context) *Workspace

OnlyX is like Only, but panics if an error occurs.

func (*WorkspaceQuery) Order

Order specifies how the records should be ordered.

func (*WorkspaceQuery) Paginate

func (w *WorkspaceQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...OrganizationPaginateOption,
) (*OrganizationConnection, error)

Paginate executes the query and returns a relay based cursor connection to Organization.

func (*WorkspaceQuery) Select

func (wq *WorkspaceQuery) Select(fields ...string) *WorkspaceSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.Workspace.Query().
	Select(workspace.FieldName).
	Scan(ctx, &v)

func (*WorkspaceQuery) Unique

func (wq *WorkspaceQuery) Unique(unique bool) *WorkspaceQuery

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 (*WorkspaceQuery) Where

Where adds a new predicate for the WorkspaceQuery builder.

type WorkspaceSelect

type WorkspaceSelect struct {
	*WorkspaceQuery
	// contains filtered or unexported fields
}

WorkspaceSelect is the builder for selecting fields of Workspace entities.

func (*WorkspaceSelect) Aggregate

func (ws *WorkspaceSelect) Aggregate(fns ...AggregateFunc) *WorkspaceSelect

Aggregate adds the given aggregation functions to the selector query.

func (*WorkspaceSelect) Bool

func (s *WorkspaceSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*WorkspaceSelect) BoolX

func (s *WorkspaceSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*WorkspaceSelect) Bools

func (s *WorkspaceSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*WorkspaceSelect) BoolsX

func (s *WorkspaceSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*WorkspaceSelect) Float64

func (s *WorkspaceSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*WorkspaceSelect) Float64X

func (s *WorkspaceSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*WorkspaceSelect) Float64s

func (s *WorkspaceSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*WorkspaceSelect) Float64sX

func (s *WorkspaceSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*WorkspaceSelect) Int

func (s *WorkspaceSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*WorkspaceSelect) IntX

func (s *WorkspaceSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*WorkspaceSelect) Ints

func (s *WorkspaceSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*WorkspaceSelect) IntsX

func (s *WorkspaceSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*WorkspaceSelect) Modify

func (ws *WorkspaceSelect) Modify(modifiers ...func(s *sql.Selector)) *WorkspaceSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*WorkspaceSelect) Scan

func (ws *WorkspaceSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*WorkspaceSelect) ScanX

func (s *WorkspaceSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*WorkspaceSelect) String

func (s *WorkspaceSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*WorkspaceSelect) StringX

func (s *WorkspaceSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*WorkspaceSelect) Strings

func (s *WorkspaceSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*WorkspaceSelect) StringsX

func (s *WorkspaceSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type WorkspaceUpdate

type WorkspaceUpdate struct {
	// contains filtered or unexported fields
}

WorkspaceUpdate is the builder for updating Workspace entities.

func (*WorkspaceUpdate) Exec

func (wu *WorkspaceUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*WorkspaceUpdate) ExecX

func (wu *WorkspaceUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WorkspaceUpdate) Modify

func (wu *WorkspaceUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *WorkspaceUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*WorkspaceUpdate) Mutation

func (wu *WorkspaceUpdate) Mutation() *WorkspaceMutation

Mutation returns the WorkspaceMutation object of the builder.

func (*WorkspaceUpdate) Save

func (wu *WorkspaceUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*WorkspaceUpdate) SaveX

func (wu *WorkspaceUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*WorkspaceUpdate) SetName

func (wu *WorkspaceUpdate) SetName(s string) *WorkspaceUpdate

SetName sets the "name" field.

func (*WorkspaceUpdate) SetNillableName

func (wu *WorkspaceUpdate) SetNillableName(s *string) *WorkspaceUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*WorkspaceUpdate) Where

Where appends a list predicates to the WorkspaceUpdate builder.

type WorkspaceUpdateOne

type WorkspaceUpdateOne struct {
	// contains filtered or unexported fields
}

WorkspaceUpdateOne is the builder for updating a single Workspace entity.

func (*WorkspaceUpdateOne) Exec

func (wuo *WorkspaceUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*WorkspaceUpdateOne) ExecX

func (wuo *WorkspaceUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WorkspaceUpdateOne) Modify

func (wuo *WorkspaceUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *WorkspaceUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*WorkspaceUpdateOne) Mutation

func (wuo *WorkspaceUpdateOne) Mutation() *WorkspaceMutation

Mutation returns the WorkspaceMutation object of the builder.

func (*WorkspaceUpdateOne) Save

func (wuo *WorkspaceUpdateOne) Save(ctx context.Context) (*Workspace, error)

Save executes the query and returns the updated Workspace entity.

func (*WorkspaceUpdateOne) SaveX

func (wuo *WorkspaceUpdateOne) SaveX(ctx context.Context) *Workspace

SaveX is like Save, but panics if an error occurs.

func (*WorkspaceUpdateOne) Select

func (wuo *WorkspaceUpdateOne) Select(field string, fields ...string) *WorkspaceUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*WorkspaceUpdateOne) SetName

func (wuo *WorkspaceUpdateOne) SetName(s string) *WorkspaceUpdateOne

SetName sets the "name" field.

func (*WorkspaceUpdateOne) SetNillableName

func (wuo *WorkspaceUpdateOne) SetNillableName(s *string) *WorkspaceUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*WorkspaceUpdateOne) Where

Where appends a list predicates to the WorkspaceUpdate builder.

type Workspaces

type Workspaces []*Workspace

Workspaces is a parsable slice of Workspace.

Directories

Path Synopsis
schematype
Package schematype provides custom types for ent/schema.
Package schematype provides custom types for ent/schema.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL