Documentation ¶
Index ¶
- Constants
- Variables
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- func OpenTxFromContext(ctx context.Context) (context.Context, driver.Tx, error)
- type AggregateFunc
- type Categories
- type Category
- func (Category) IsEntity()
- func (c *Category) Node(ctx context.Context) (node *Node, err error)
- func (c *Category) QueryTodos() *TodoQuery
- func (c *Category) String() string
- func (c *Category) ToEdge(order *CategoryOrder) *CategoryEdge
- func (c *Category) Todos(ctx context.Context) ([]*Todo, error)
- func (c *Category) Unwrap() *Category
- func (c *Category) Update() *CategoryUpdateOne
- type CategoryClient
- func (c *CategoryClient) Create() *CategoryCreate
- func (c *CategoryClient) CreateBulk(builders ...*CategoryCreate) *CategoryCreateBulk
- func (c *CategoryClient) Delete() *CategoryDelete
- func (c *CategoryClient) DeleteOne(ca *Category) *CategoryDeleteOne
- func (c *CategoryClient) DeleteOneID(id int) *CategoryDeleteOne
- func (c *CategoryClient) Get(ctx context.Context, id int) (*Category, error)
- func (c *CategoryClient) GetX(ctx context.Context, id int) *Category
- func (c *CategoryClient) Hooks() []Hook
- func (c *CategoryClient) Query() *CategoryQuery
- func (c *CategoryClient) QueryTodos(ca *Category) *TodoQuery
- func (c *CategoryClient) Update() *CategoryUpdate
- func (c *CategoryClient) UpdateOne(ca *Category) *CategoryUpdateOne
- func (c *CategoryClient) UpdateOneID(id int) *CategoryUpdateOne
- func (c *CategoryClient) Use(hooks ...Hook)
- type CategoryConnection
- type CategoryCreate
- func (cc *CategoryCreate) AddTodoIDs(ids ...int) *CategoryCreate
- func (cc *CategoryCreate) AddTodos(t ...*Todo) *CategoryCreate
- func (cc *CategoryCreate) Exec(ctx context.Context) error
- func (cc *CategoryCreate) ExecX(ctx context.Context)
- func (cc *CategoryCreate) Mutation() *CategoryMutation
- func (cc *CategoryCreate) Save(ctx context.Context) (*Category, error)
- func (cc *CategoryCreate) SaveX(ctx context.Context) *Category
- func (cc *CategoryCreate) SetConfig(sc *schematype.CategoryConfig) *CategoryCreate
- func (cc *CategoryCreate) SetCount(u uint64) *CategoryCreate
- func (cc *CategoryCreate) SetDuration(t time.Duration) *CategoryCreate
- func (cc *CategoryCreate) SetNillableCount(u *uint64) *CategoryCreate
- func (cc *CategoryCreate) SetNillableDuration(t *time.Duration) *CategoryCreate
- func (cc *CategoryCreate) SetNillableUUIDA(u *uuid.UUID) *CategoryCreate
- func (cc *CategoryCreate) SetStatus(c category.Status) *CategoryCreate
- func (cc *CategoryCreate) SetStrings(s []string) *CategoryCreate
- func (cc *CategoryCreate) SetText(s string) *CategoryCreate
- func (cc *CategoryCreate) SetUUIDA(u uuid.UUID) *CategoryCreate
- type CategoryCreateBulk
- type CategoryDelete
- type CategoryDeleteOne
- type CategoryEdge
- type CategoryEdges
- type CategoryGroupBy
- func (cgb *CategoryGroupBy) Aggregate(fns ...AggregateFunc) *CategoryGroupBy
- func (s *CategoryGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *CategoryGroupBy) BoolX(ctx context.Context) bool
- func (s *CategoryGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *CategoryGroupBy) BoolsX(ctx context.Context) []bool
- func (s *CategoryGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *CategoryGroupBy) Float64X(ctx context.Context) float64
- func (s *CategoryGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *CategoryGroupBy) Float64sX(ctx context.Context) []float64
- func (s *CategoryGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *CategoryGroupBy) IntX(ctx context.Context) int
- func (s *CategoryGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *CategoryGroupBy) IntsX(ctx context.Context) []int
- func (cgb *CategoryGroupBy) Scan(ctx context.Context, v interface{}) error
- func (s *CategoryGroupBy) ScanX(ctx context.Context, v interface{})
- func (s *CategoryGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *CategoryGroupBy) StringX(ctx context.Context) string
- func (s *CategoryGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *CategoryGroupBy) StringsX(ctx context.Context) []string
- type CategoryMutation
- func (m *CategoryMutation) AddCount(u int64)
- func (m *CategoryMutation) AddDuration(t time.Duration)
- func (m *CategoryMutation) AddField(name string, value ent.Value) error
- func (m *CategoryMutation) AddTodoIDs(ids ...int)
- func (m *CategoryMutation) AddedCount() (r int64, exists bool)
- func (m *CategoryMutation) AddedDuration() (r time.Duration, exists bool)
- func (m *CategoryMutation) AddedEdges() []string
- func (m *CategoryMutation) AddedField(name string) (ent.Value, bool)
- func (m *CategoryMutation) AddedFields() []string
- func (m *CategoryMutation) AddedIDs(name string) []ent.Value
- func (m *CategoryMutation) ClearConfig()
- func (m *CategoryMutation) ClearCount()
- func (m *CategoryMutation) ClearDuration()
- func (m *CategoryMutation) ClearEdge(name string) error
- func (m *CategoryMutation) ClearField(name string) error
- func (m *CategoryMutation) ClearStrings()
- func (m *CategoryMutation) ClearTodos()
- func (m *CategoryMutation) ClearUUIDA()
- func (m *CategoryMutation) ClearedEdges() []string
- func (m *CategoryMutation) ClearedFields() []string
- func (m CategoryMutation) Client() *Client
- func (m *CategoryMutation) Config() (r *schematype.CategoryConfig, exists bool)
- func (m *CategoryMutation) ConfigCleared() bool
- func (m *CategoryMutation) Count() (r uint64, exists bool)
- func (m *CategoryMutation) CountCleared() bool
- func (m *CategoryMutation) Duration() (r time.Duration, exists bool)
- func (m *CategoryMutation) DurationCleared() bool
- func (m *CategoryMutation) EdgeCleared(name string) bool
- func (m *CategoryMutation) Field(name string) (ent.Value, bool)
- func (m *CategoryMutation) FieldCleared(name string) bool
- func (m *CategoryMutation) Fields() []string
- func (m *CategoryMutation) ID() (id int, exists bool)
- func (m *CategoryMutation) IDs(ctx context.Context) ([]int, error)
- func (m *CategoryMutation) OldConfig(ctx context.Context) (v *schematype.CategoryConfig, err error)
- func (m *CategoryMutation) OldCount(ctx context.Context) (v uint64, err error)
- func (m *CategoryMutation) OldDuration(ctx context.Context) (v time.Duration, err error)
- func (m *CategoryMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *CategoryMutation) OldStatus(ctx context.Context) (v category.Status, err error)
- func (m *CategoryMutation) OldStrings(ctx context.Context) (v []string, err error)
- func (m *CategoryMutation) OldText(ctx context.Context) (v string, err error)
- func (m *CategoryMutation) OldUUIDA(ctx context.Context) (v *uuid.UUID, err error)
- func (m *CategoryMutation) Op() Op
- func (m *CategoryMutation) RemoveTodoIDs(ids ...int)
- func (m *CategoryMutation) RemovedEdges() []string
- func (m *CategoryMutation) RemovedIDs(name string) []ent.Value
- func (m *CategoryMutation) RemovedTodosIDs() (ids []int)
- func (m *CategoryMutation) ResetConfig()
- func (m *CategoryMutation) ResetCount()
- func (m *CategoryMutation) ResetDuration()
- func (m *CategoryMutation) ResetEdge(name string) error
- func (m *CategoryMutation) ResetField(name string) error
- func (m *CategoryMutation) ResetStatus()
- func (m *CategoryMutation) ResetStrings()
- func (m *CategoryMutation) ResetText()
- func (m *CategoryMutation) ResetTodos()
- func (m *CategoryMutation) ResetUUIDA()
- func (m *CategoryMutation) SetConfig(sc *schematype.CategoryConfig)
- func (m *CategoryMutation) SetCount(u uint64)
- func (m *CategoryMutation) SetDuration(t time.Duration)
- func (m *CategoryMutation) SetField(name string, value ent.Value) error
- func (m *CategoryMutation) SetStatus(c category.Status)
- func (m *CategoryMutation) SetStrings(s []string)
- func (m *CategoryMutation) SetText(s string)
- func (m *CategoryMutation) SetUUIDA(u uuid.UUID)
- func (m *CategoryMutation) Status() (r category.Status, exists bool)
- func (m *CategoryMutation) Strings() (r []string, exists bool)
- func (m *CategoryMutation) StringsCleared() bool
- func (m *CategoryMutation) Text() (r string, exists bool)
- func (m *CategoryMutation) TodosCleared() bool
- func (m *CategoryMutation) TodosIDs() (ids []int)
- func (m CategoryMutation) Tx() (*Tx, error)
- func (m *CategoryMutation) Type() string
- func (m *CategoryMutation) UUIDA() (r uuid.UUID, exists bool)
- func (m *CategoryMutation) UUIDACleared() bool
- func (m *CategoryMutation) Where(ps ...predicate.Category)
- type CategoryOrder
- type CategoryOrderField
- type CategoryPaginateOption
- type CategoryQuery
- func (cq *CategoryQuery) All(ctx context.Context) ([]*Category, error)
- func (cq *CategoryQuery) AllX(ctx context.Context) []*Category
- func (cq *CategoryQuery) Clone() *CategoryQuery
- func (c *CategoryQuery) CollectFields(ctx context.Context, satisfies ...string) (*CategoryQuery, error)
- func (cq *CategoryQuery) Count(ctx context.Context) (int, error)
- func (cq *CategoryQuery) CountX(ctx context.Context) int
- func (cq *CategoryQuery) Exist(ctx context.Context) (bool, error)
- func (cq *CategoryQuery) ExistX(ctx context.Context) bool
- func (cq *CategoryQuery) First(ctx context.Context) (*Category, error)
- func (cq *CategoryQuery) FirstID(ctx context.Context) (id int, err error)
- func (cq *CategoryQuery) FirstIDX(ctx context.Context) int
- func (cq *CategoryQuery) FirstX(ctx context.Context) *Category
- func (cq *CategoryQuery) GroupBy(field string, fields ...string) *CategoryGroupBy
- func (cq *CategoryQuery) IDs(ctx context.Context) ([]int, error)
- func (cq *CategoryQuery) IDsX(ctx context.Context) []int
- func (cq *CategoryQuery) Limit(limit int) *CategoryQuery
- func (cq *CategoryQuery) Offset(offset int) *CategoryQuery
- func (cq *CategoryQuery) Only(ctx context.Context) (*Category, error)
- func (cq *CategoryQuery) OnlyID(ctx context.Context) (id int, err error)
- func (cq *CategoryQuery) OnlyIDX(ctx context.Context) int
- func (cq *CategoryQuery) OnlyX(ctx context.Context) *Category
- func (cq *CategoryQuery) Order(o ...OrderFunc) *CategoryQuery
- func (c *CategoryQuery) Paginate(ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, ...) (*CategoryConnection, error)
- func (cq *CategoryQuery) QueryTodos() *TodoQuery
- func (cq *CategoryQuery) Select(fields ...string) *CategorySelect
- func (cq *CategoryQuery) Unique(unique bool) *CategoryQuery
- func (cq *CategoryQuery) Where(ps ...predicate.Category) *CategoryQuery
- func (cq *CategoryQuery) WithTodos(opts ...func(*TodoQuery)) *CategoryQuery
- type CategorySelect
- func (s *CategorySelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *CategorySelect) BoolX(ctx context.Context) bool
- func (s *CategorySelect) Bools(ctx context.Context) ([]bool, error)
- func (s *CategorySelect) BoolsX(ctx context.Context) []bool
- func (s *CategorySelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *CategorySelect) Float64X(ctx context.Context) float64
- func (s *CategorySelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *CategorySelect) Float64sX(ctx context.Context) []float64
- func (s *CategorySelect) Int(ctx context.Context) (_ int, err error)
- func (s *CategorySelect) IntX(ctx context.Context) int
- func (s *CategorySelect) Ints(ctx context.Context) ([]int, error)
- func (s *CategorySelect) IntsX(ctx context.Context) []int
- func (cs *CategorySelect) Scan(ctx context.Context, v interface{}) error
- func (s *CategorySelect) ScanX(ctx context.Context, v interface{})
- func (s *CategorySelect) String(ctx context.Context) (_ string, err error)
- func (s *CategorySelect) StringX(ctx context.Context) string
- func (s *CategorySelect) Strings(ctx context.Context) ([]string, error)
- func (s *CategorySelect) StringsX(ctx context.Context) []string
- type CategoryUpdate
- func (cu *CategoryUpdate) AddCount(u int64) *CategoryUpdate
- func (cu *CategoryUpdate) AddDuration(t time.Duration) *CategoryUpdate
- func (cu *CategoryUpdate) AddTodoIDs(ids ...int) *CategoryUpdate
- func (cu *CategoryUpdate) AddTodos(t ...*Todo) *CategoryUpdate
- func (cu *CategoryUpdate) ClearConfig() *CategoryUpdate
- func (cu *CategoryUpdate) ClearCount() *CategoryUpdate
- func (cu *CategoryUpdate) ClearDuration() *CategoryUpdate
- func (cu *CategoryUpdate) ClearStrings() *CategoryUpdate
- func (cu *CategoryUpdate) ClearTodos() *CategoryUpdate
- func (cu *CategoryUpdate) ClearUUIDA() *CategoryUpdate
- func (cu *CategoryUpdate) Exec(ctx context.Context) error
- func (cu *CategoryUpdate) ExecX(ctx context.Context)
- func (cu *CategoryUpdate) Mutation() *CategoryMutation
- func (cu *CategoryUpdate) RemoveTodoIDs(ids ...int) *CategoryUpdate
- func (cu *CategoryUpdate) RemoveTodos(t ...*Todo) *CategoryUpdate
- func (cu *CategoryUpdate) Save(ctx context.Context) (int, error)
- func (cu *CategoryUpdate) SaveX(ctx context.Context) int
- func (cu *CategoryUpdate) SetConfig(sc *schematype.CategoryConfig) *CategoryUpdate
- func (cu *CategoryUpdate) SetCount(u uint64) *CategoryUpdate
- func (cu *CategoryUpdate) SetDuration(t time.Duration) *CategoryUpdate
- func (cu *CategoryUpdate) SetNillableCount(u *uint64) *CategoryUpdate
- func (cu *CategoryUpdate) SetNillableDuration(t *time.Duration) *CategoryUpdate
- func (cu *CategoryUpdate) SetNillableUUIDA(u *uuid.UUID) *CategoryUpdate
- func (cu *CategoryUpdate) SetStatus(c category.Status) *CategoryUpdate
- func (cu *CategoryUpdate) SetStrings(s []string) *CategoryUpdate
- func (cu *CategoryUpdate) SetText(s string) *CategoryUpdate
- func (cu *CategoryUpdate) SetUUIDA(u uuid.UUID) *CategoryUpdate
- func (cu *CategoryUpdate) Where(ps ...predicate.Category) *CategoryUpdate
- type CategoryUpdateOne
- func (cuo *CategoryUpdateOne) AddCount(u int64) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) AddDuration(t time.Duration) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) AddTodoIDs(ids ...int) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) AddTodos(t ...*Todo) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) ClearConfig() *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) ClearCount() *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) ClearDuration() *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) ClearStrings() *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) ClearTodos() *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) ClearUUIDA() *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) Exec(ctx context.Context) error
- func (cuo *CategoryUpdateOne) ExecX(ctx context.Context)
- func (cuo *CategoryUpdateOne) Mutation() *CategoryMutation
- func (cuo *CategoryUpdateOne) RemoveTodoIDs(ids ...int) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) RemoveTodos(t ...*Todo) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) Save(ctx context.Context) (*Category, error)
- func (cuo *CategoryUpdateOne) SaveX(ctx context.Context) *Category
- func (cuo *CategoryUpdateOne) Select(field string, fields ...string) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) SetConfig(sc *schematype.CategoryConfig) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) SetCount(u uint64) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) SetDuration(t time.Duration) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) SetNillableCount(u *uint64) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) SetNillableDuration(t *time.Duration) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) SetNillableUUIDA(u *uuid.UUID) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) SetStatus(c category.Status) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) SetStrings(s []string) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) SetText(s string) *CategoryUpdateOne
- func (cuo *CategoryUpdateOne) SetUUIDA(u uuid.UUID) *CategoryUpdateOne
- type CategoryWhereInput
- type Client
- func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (c *Client) Close() error
- func (c *Client) Debug() *Client
- func (c *Client) Node(ctx context.Context, id int) (*Node, error)
- func (c *Client) Noder(ctx context.Context, id int, opts ...NodeOption) (_ Noder, err error)
- func (c *Client) Noders(ctx context.Context, ids []int, opts ...NodeOption) ([]Noder, error)
- func (c *Client) OpenTx(ctx context.Context) (context.Context, driver.Tx, error)
- func (c *Client) Tx(ctx context.Context) (*Tx, error)
- func (c *Client) Use(hooks ...Hook)
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Cursor
- type Edge
- type Field
- type Hook
- type MasterUser
- type MasterUserConnection
- type MasterUserEdge
- type MasterUserOrder
- type MasterUserOrderField
- type MasterUserPaginateOption
- type MasterUserWhereInput
- type MutateFunc
- type Mutation
- type Mutator
- type Node
- type NodeOption
- type Noder
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderDirection
- type OrderFunc
- type PageInfo
- type Policy
- type Query
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Todo
- func (t *Todo) Children(ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, ...) (*TodoConnection, error)
- func (t *Todo) Node(ctx context.Context) (node *Node, err error)
- func (t *Todo) Parent(ctx context.Context) (*Todo, error)
- func (t *Todo) QueryChildren() *TodoQuery
- func (t *Todo) QueryParent() *TodoQuery
- func (t *Todo) String() string
- func (t *Todo) ToEdge(order *TodoOrder) *TodoEdge
- func (t *Todo) Unwrap() *Todo
- func (t *Todo) Update() *TodoUpdateOne
- type TodoClient
- func (c *TodoClient) Create() *TodoCreate
- func (c *TodoClient) CreateBulk(builders ...*TodoCreate) *TodoCreateBulk
- func (c *TodoClient) Delete() *TodoDelete
- func (c *TodoClient) DeleteOne(t *Todo) *TodoDeleteOne
- func (c *TodoClient) DeleteOneID(id int) *TodoDeleteOne
- func (c *TodoClient) Get(ctx context.Context, id int) (*Todo, error)
- func (c *TodoClient) GetX(ctx context.Context, id int) *Todo
- func (c *TodoClient) Hooks() []Hook
- func (c *TodoClient) Query() *TodoQuery
- func (c *TodoClient) QueryChildren(t *Todo) *TodoQuery
- func (c *TodoClient) QueryParent(t *Todo) *TodoQuery
- func (c *TodoClient) Update() *TodoUpdate
- func (c *TodoClient) UpdateOne(t *Todo) *TodoUpdateOne
- func (c *TodoClient) UpdateOneID(id int) *TodoUpdateOne
- func (c *TodoClient) Use(hooks ...Hook)
- type TodoConnection
- type TodoCreate
- func (tc *TodoCreate) AddChildIDs(ids ...int) *TodoCreate
- func (tc *TodoCreate) AddChildren(t ...*Todo) *TodoCreate
- func (tc *TodoCreate) Exec(ctx context.Context) error
- func (tc *TodoCreate) ExecX(ctx context.Context)
- func (tc *TodoCreate) Mutation() *TodoMutation
- func (tc *TodoCreate) Save(ctx context.Context) (*Todo, error)
- func (tc *TodoCreate) SaveX(ctx context.Context) *Todo
- func (tc *TodoCreate) SetCreatedAt(t time.Time) *TodoCreate
- func (tc *TodoCreate) SetNillableCreatedAt(t *time.Time) *TodoCreate
- func (tc *TodoCreate) SetNillableParentID(id *int) *TodoCreate
- func (tc *TodoCreate) SetNillablePriority(i *int) *TodoCreate
- func (tc *TodoCreate) SetNillableVisibilityStatus(ts *todo.VisibilityStatus) *TodoCreate
- func (tc *TodoCreate) SetParent(t *Todo) *TodoCreate
- func (tc *TodoCreate) SetParentID(id int) *TodoCreate
- func (tc *TodoCreate) SetPriority(i int) *TodoCreate
- func (tc *TodoCreate) SetStatus(t todo.Status) *TodoCreate
- func (tc *TodoCreate) SetText(s string) *TodoCreate
- func (tc *TodoCreate) SetVisibilityStatus(ts todo.VisibilityStatus) *TodoCreate
- type TodoCreateBulk
- type TodoDelete
- type TodoDeleteOne
- type TodoEdge
- type TodoEdges
- type TodoGroupBy
- func (tgb *TodoGroupBy) Aggregate(fns ...AggregateFunc) *TodoGroupBy
- func (s *TodoGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *TodoGroupBy) BoolX(ctx context.Context) bool
- func (s *TodoGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *TodoGroupBy) BoolsX(ctx context.Context) []bool
- func (s *TodoGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *TodoGroupBy) Float64X(ctx context.Context) float64
- func (s *TodoGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *TodoGroupBy) Float64sX(ctx context.Context) []float64
- func (s *TodoGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *TodoGroupBy) IntX(ctx context.Context) int
- func (s *TodoGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *TodoGroupBy) IntsX(ctx context.Context) []int
- func (tgb *TodoGroupBy) Scan(ctx context.Context, v interface{}) error
- func (s *TodoGroupBy) ScanX(ctx context.Context, v interface{})
- func (s *TodoGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *TodoGroupBy) StringX(ctx context.Context) string
- func (s *TodoGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *TodoGroupBy) StringsX(ctx context.Context) []string
- type TodoMutation
- func (m *TodoMutation) AddChildIDs(ids ...int)
- func (m *TodoMutation) AddField(name string, value ent.Value) error
- func (m *TodoMutation) AddPriority(i int)
- func (m *TodoMutation) AddedEdges() []string
- func (m *TodoMutation) AddedField(name string) (ent.Value, bool)
- func (m *TodoMutation) AddedFields() []string
- func (m *TodoMutation) AddedIDs(name string) []ent.Value
- func (m *TodoMutation) AddedPriority() (r int, exists bool)
- func (m *TodoMutation) ChildrenCleared() bool
- func (m *TodoMutation) ChildrenIDs() (ids []int)
- func (m *TodoMutation) ClearChildren()
- func (m *TodoMutation) ClearEdge(name string) error
- func (m *TodoMutation) ClearField(name string) error
- func (m *TodoMutation) ClearParent()
- func (m *TodoMutation) ClearedEdges() []string
- func (m *TodoMutation) ClearedFields() []string
- func (m TodoMutation) Client() *Client
- func (m *TodoMutation) CreatedAt() (r time.Time, exists bool)
- func (m *TodoMutation) EdgeCleared(name string) bool
- func (m *TodoMutation) Field(name string) (ent.Value, bool)
- func (m *TodoMutation) FieldCleared(name string) bool
- func (m *TodoMutation) Fields() []string
- func (m *TodoMutation) ID() (id int, exists bool)
- func (m *TodoMutation) IDs(ctx context.Context) ([]int, error)
- func (m *TodoMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *TodoMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *TodoMutation) OldPriority(ctx context.Context) (v int, err error)
- func (m *TodoMutation) OldStatus(ctx context.Context) (v todo.Status, err error)
- func (m *TodoMutation) OldText(ctx context.Context) (v string, err error)
- func (m *TodoMutation) OldVisibilityStatus(ctx context.Context) (v todo.VisibilityStatus, err error)
- func (m *TodoMutation) Op() Op
- func (m *TodoMutation) ParentCleared() bool
- func (m *TodoMutation) ParentID() (id int, exists bool)
- func (m *TodoMutation) ParentIDs() (ids []int)
- func (m *TodoMutation) Priority() (r int, exists bool)
- func (m *TodoMutation) RemoveChildIDs(ids ...int)
- func (m *TodoMutation) RemovedChildrenIDs() (ids []int)
- func (m *TodoMutation) RemovedEdges() []string
- func (m *TodoMutation) RemovedIDs(name string) []ent.Value
- func (m *TodoMutation) ResetChildren()
- func (m *TodoMutation) ResetCreatedAt()
- func (m *TodoMutation) ResetEdge(name string) error
- func (m *TodoMutation) ResetField(name string) error
- func (m *TodoMutation) ResetParent()
- func (m *TodoMutation) ResetPriority()
- func (m *TodoMutation) ResetStatus()
- func (m *TodoMutation) ResetText()
- func (m *TodoMutation) ResetVisibilityStatus()
- func (m *TodoMutation) SetCreatedAt(t time.Time)
- func (m *TodoMutation) SetField(name string, value ent.Value) error
- func (m *TodoMutation) SetParentID(id int)
- func (m *TodoMutation) SetPriority(i int)
- func (m *TodoMutation) SetStatus(t todo.Status)
- func (m *TodoMutation) SetText(s string)
- func (m *TodoMutation) SetVisibilityStatus(ts todo.VisibilityStatus)
- func (m *TodoMutation) Status() (r todo.Status, exists bool)
- func (m *TodoMutation) Text() (r string, exists bool)
- func (m TodoMutation) Tx() (*Tx, error)
- func (m *TodoMutation) Type() string
- func (m *TodoMutation) VisibilityStatus() (r todo.VisibilityStatus, exists bool)
- func (m *TodoMutation) Where(ps ...predicate.Todo)
- type TodoOrder
- type TodoOrderField
- type TodoPaginateOption
- type TodoQuery
- func (tq *TodoQuery) All(ctx context.Context) ([]*Todo, error)
- func (tq *TodoQuery) AllX(ctx context.Context) []*Todo
- func (tq *TodoQuery) Clone() *TodoQuery
- func (t *TodoQuery) CollectFields(ctx context.Context, satisfies ...string) (*TodoQuery, error)
- func (tq *TodoQuery) Count(ctx context.Context) (int, error)
- func (tq *TodoQuery) CountX(ctx context.Context) int
- func (tq *TodoQuery) Exist(ctx context.Context) (bool, error)
- func (tq *TodoQuery) ExistX(ctx context.Context) bool
- func (tq *TodoQuery) First(ctx context.Context) (*Todo, error)
- func (tq *TodoQuery) FirstID(ctx context.Context) (id int, err error)
- func (tq *TodoQuery) FirstIDX(ctx context.Context) int
- func (tq *TodoQuery) FirstX(ctx context.Context) *Todo
- func (tq *TodoQuery) GroupBy(field string, fields ...string) *TodoGroupBy
- func (tq *TodoQuery) IDs(ctx context.Context) ([]int, error)
- func (tq *TodoQuery) IDsX(ctx context.Context) []int
- func (tq *TodoQuery) Limit(limit int) *TodoQuery
- func (tq *TodoQuery) Offset(offset int) *TodoQuery
- func (tq *TodoQuery) Only(ctx context.Context) (*Todo, error)
- func (tq *TodoQuery) OnlyID(ctx context.Context) (id int, err error)
- func (tq *TodoQuery) OnlyIDX(ctx context.Context) int
- func (tq *TodoQuery) OnlyX(ctx context.Context) *Todo
- func (tq *TodoQuery) Order(o ...OrderFunc) *TodoQuery
- func (t *TodoQuery) Paginate(ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, ...) (*TodoConnection, error)
- func (tq *TodoQuery) QueryChildren() *TodoQuery
- func (tq *TodoQuery) QueryParent() *TodoQuery
- func (tq *TodoQuery) Select(fields ...string) *TodoSelect
- func (tq *TodoQuery) Unique(unique bool) *TodoQuery
- func (tq *TodoQuery) Where(ps ...predicate.Todo) *TodoQuery
- func (tq *TodoQuery) WithChildren(opts ...func(*TodoQuery)) *TodoQuery
- func (tq *TodoQuery) WithParent(opts ...func(*TodoQuery)) *TodoQuery
- type TodoSelect
- func (s *TodoSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *TodoSelect) BoolX(ctx context.Context) bool
- func (s *TodoSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *TodoSelect) BoolsX(ctx context.Context) []bool
- func (s *TodoSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *TodoSelect) Float64X(ctx context.Context) float64
- func (s *TodoSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *TodoSelect) Float64sX(ctx context.Context) []float64
- func (s *TodoSelect) Int(ctx context.Context) (_ int, err error)
- func (s *TodoSelect) IntX(ctx context.Context) int
- func (s *TodoSelect) Ints(ctx context.Context) ([]int, error)
- func (s *TodoSelect) IntsX(ctx context.Context) []int
- func (ts *TodoSelect) Scan(ctx context.Context, v interface{}) error
- func (s *TodoSelect) ScanX(ctx context.Context, v interface{})
- func (s *TodoSelect) String(ctx context.Context) (_ string, err error)
- func (s *TodoSelect) StringX(ctx context.Context) string
- func (s *TodoSelect) Strings(ctx context.Context) ([]string, error)
- func (s *TodoSelect) StringsX(ctx context.Context) []string
- type TodoUpdate
- func (tu *TodoUpdate) AddChildIDs(ids ...int) *TodoUpdate
- func (tu *TodoUpdate) AddChildren(t ...*Todo) *TodoUpdate
- func (tu *TodoUpdate) AddPriority(i int) *TodoUpdate
- func (tu *TodoUpdate) ClearChildren() *TodoUpdate
- func (tu *TodoUpdate) ClearParent() *TodoUpdate
- func (tu *TodoUpdate) Exec(ctx context.Context) error
- func (tu *TodoUpdate) ExecX(ctx context.Context)
- func (tu *TodoUpdate) Mutation() *TodoMutation
- func (tu *TodoUpdate) RemoveChildIDs(ids ...int) *TodoUpdate
- func (tu *TodoUpdate) RemoveChildren(t ...*Todo) *TodoUpdate
- func (tu *TodoUpdate) Save(ctx context.Context) (int, error)
- func (tu *TodoUpdate) SaveX(ctx context.Context) int
- func (tu *TodoUpdate) SetNillableParentID(id *int) *TodoUpdate
- func (tu *TodoUpdate) SetNillablePriority(i *int) *TodoUpdate
- func (tu *TodoUpdate) SetNillableVisibilityStatus(ts *todo.VisibilityStatus) *TodoUpdate
- func (tu *TodoUpdate) SetParent(t *Todo) *TodoUpdate
- func (tu *TodoUpdate) SetParentID(id int) *TodoUpdate
- func (tu *TodoUpdate) SetPriority(i int) *TodoUpdate
- func (tu *TodoUpdate) SetStatus(t todo.Status) *TodoUpdate
- func (tu *TodoUpdate) SetText(s string) *TodoUpdate
- func (tu *TodoUpdate) SetVisibilityStatus(ts todo.VisibilityStatus) *TodoUpdate
- func (tu *TodoUpdate) Where(ps ...predicate.Todo) *TodoUpdate
- type TodoUpdateOne
- func (tuo *TodoUpdateOne) AddChildIDs(ids ...int) *TodoUpdateOne
- func (tuo *TodoUpdateOne) AddChildren(t ...*Todo) *TodoUpdateOne
- func (tuo *TodoUpdateOne) AddPriority(i int) *TodoUpdateOne
- func (tuo *TodoUpdateOne) ClearChildren() *TodoUpdateOne
- func (tuo *TodoUpdateOne) ClearParent() *TodoUpdateOne
- func (tuo *TodoUpdateOne) Exec(ctx context.Context) error
- func (tuo *TodoUpdateOne) ExecX(ctx context.Context)
- func (tuo *TodoUpdateOne) Mutation() *TodoMutation
- func (tuo *TodoUpdateOne) RemoveChildIDs(ids ...int) *TodoUpdateOne
- func (tuo *TodoUpdateOne) RemoveChildren(t ...*Todo) *TodoUpdateOne
- func (tuo *TodoUpdateOne) Save(ctx context.Context) (*Todo, error)
- func (tuo *TodoUpdateOne) SaveX(ctx context.Context) *Todo
- func (tuo *TodoUpdateOne) Select(field string, fields ...string) *TodoUpdateOne
- func (tuo *TodoUpdateOne) SetNillableParentID(id *int) *TodoUpdateOne
- func (tuo *TodoUpdateOne) SetNillablePriority(i *int) *TodoUpdateOne
- func (tuo *TodoUpdateOne) SetNillableVisibilityStatus(ts *todo.VisibilityStatus) *TodoUpdateOne
- func (tuo *TodoUpdateOne) SetParent(t *Todo) *TodoUpdateOne
- func (tuo *TodoUpdateOne) SetParentID(id int) *TodoUpdateOne
- func (tuo *TodoUpdateOne) SetPriority(i int) *TodoUpdateOne
- func (tuo *TodoUpdateOne) SetStatus(t todo.Status) *TodoUpdateOne
- func (tuo *TodoUpdateOne) SetText(s string) *TodoUpdateOne
- func (tuo *TodoUpdateOne) SetVisibilityStatus(ts todo.VisibilityStatus) *TodoUpdateOne
- type TodoWhereInput
- type Todos
- type Tx
- type User
- type UserClient
- func (c *UserClient) Create() *UserCreate
- func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk
- func (c *UserClient) Delete() *UserDelete
- func (c *UserClient) DeleteOne(u *User) *UserDeleteOne
- func (c *UserClient) DeleteOneID(id int) *UserDeleteOne
- func (c *UserClient) Get(ctx context.Context, id int) (*User, error)
- func (c *UserClient) GetX(ctx context.Context, id int) *User
- func (c *UserClient) Hooks() []Hook
- func (c *UserClient) Query() *UserQuery
- func (c *UserClient) Update() *UserUpdate
- func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
- func (c *UserClient) UpdateOneID(id int) *UserUpdateOne
- func (c *UserClient) Use(hooks ...Hook)
- type UserCreate
- func (uc *UserCreate) Exec(ctx context.Context) error
- func (uc *UserCreate) ExecX(ctx context.Context)
- func (uc *UserCreate) Mutation() *UserMutation
- func (uc *UserCreate) Save(ctx context.Context) (*User, error)
- func (uc *UserCreate) SaveX(ctx context.Context) *User
- func (uc *UserCreate) SetAge(i int) *UserCreate
- func (uc *UserCreate) SetAmount(s schema.Amount) *UserCreate
- func (uc *UserCreate) SetID(i int) *UserCreate
- func (uc *UserCreate) SetNillableNullableString(s *string) *UserCreate
- func (uc *UserCreate) SetNullableString(s string) *UserCreate
- func (uc *UserCreate) SetRole(r role.Role) *UserCreate
- func (uc *UserCreate) SetUsername(s string) *UserCreate
- type UserCreateBulk
- type UserDelete
- type UserDeleteOne
- type UserGroupBy
- func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy
- func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserGroupBy) BoolX(ctx context.Context) bool
- func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *UserGroupBy) BoolsX(ctx context.Context) []bool
- func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserGroupBy) Float64X(ctx context.Context) float64
- func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserGroupBy) Float64sX(ctx context.Context) []float64
- func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *UserGroupBy) IntX(ctx context.Context) int
- func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *UserGroupBy) IntsX(ctx context.Context) []int
- func (ugb *UserGroupBy) Scan(ctx context.Context, v interface{}) error
- func (s *UserGroupBy) ScanX(ctx context.Context, v interface{})
- func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *UserGroupBy) StringX(ctx context.Context) string
- func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *UserGroupBy) StringsX(ctx context.Context) []string
- type UserMutation
- func (m *UserMutation) AddAge(i int)
- func (m *UserMutation) AddAmount(s schema.Amount)
- func (m *UserMutation) AddField(name string, value ent.Value) error
- func (m *UserMutation) AddedAge() (r int, exists bool)
- func (m *UserMutation) AddedAmount() (r schema.Amount, exists bool)
- func (m *UserMutation) AddedEdges() []string
- func (m *UserMutation) AddedField(name string) (ent.Value, bool)
- func (m *UserMutation) AddedFields() []string
- func (m *UserMutation) AddedIDs(name string) []ent.Value
- func (m *UserMutation) Age() (r int, exists bool)
- func (m *UserMutation) Amount() (r schema.Amount, exists bool)
- func (m *UserMutation) ClearEdge(name string) error
- func (m *UserMutation) ClearField(name string) error
- func (m *UserMutation) ClearNullableString()
- func (m *UserMutation) ClearedEdges() []string
- func (m *UserMutation) ClearedFields() []string
- func (m UserMutation) Client() *Client
- func (m *UserMutation) EdgeCleared(name string) bool
- func (m *UserMutation) Field(name string) (ent.Value, bool)
- func (m *UserMutation) FieldCleared(name string) bool
- func (m *UserMutation) Fields() []string
- func (m *UserMutation) ID() (id int, exists bool)
- func (m *UserMutation) IDs(ctx context.Context) ([]int, error)
- func (m *UserMutation) NullableString() (r string, exists bool)
- func (m *UserMutation) NullableStringCleared() bool
- func (m *UserMutation) OldAge(ctx context.Context) (v int, err error)
- func (m *UserMutation) OldAmount(ctx context.Context) (v schema.Amount, err error)
- func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserMutation) OldNullableString(ctx context.Context) (v *string, err error)
- func (m *UserMutation) OldRole(ctx context.Context) (v role.Role, err error)
- func (m *UserMutation) OldUsername(ctx context.Context) (v string, err error)
- func (m *UserMutation) Op() Op
- func (m *UserMutation) RemovedEdges() []string
- func (m *UserMutation) RemovedIDs(name string) []ent.Value
- func (m *UserMutation) ResetAge()
- func (m *UserMutation) ResetAmount()
- func (m *UserMutation) ResetEdge(name string) error
- func (m *UserMutation) ResetField(name string) error
- func (m *UserMutation) ResetNullableString()
- func (m *UserMutation) ResetRole()
- func (m *UserMutation) ResetUsername()
- func (m *UserMutation) Role() (r role.Role, exists bool)
- func (m *UserMutation) SetAge(i int)
- func (m *UserMutation) SetAmount(s schema.Amount)
- func (m *UserMutation) SetField(name string, value ent.Value) error
- func (m *UserMutation) SetID(id int)
- func (m *UserMutation) SetNullableString(s string)
- func (m *UserMutation) SetRole(r role.Role)
- func (m *UserMutation) SetUsername(s string)
- func (m UserMutation) Tx() (*Tx, error)
- func (m *UserMutation) Type() string
- func (m *UserMutation) Username() (r string, exists bool)
- func (m *UserMutation) Where(ps ...predicate.User)
- type UserQuery
- func (uq *UserQuery) All(ctx context.Context) ([]*User, error)
- func (uq *UserQuery) AllX(ctx context.Context) []*User
- func (uq *UserQuery) Clone() *UserQuery
- func (u *UserQuery) CollectFields(ctx context.Context, satisfies ...string) (*UserQuery, error)
- func (uq *UserQuery) Count(ctx context.Context) (int, error)
- func (uq *UserQuery) CountX(ctx context.Context) int
- func (uq *UserQuery) Exist(ctx context.Context) (bool, error)
- func (uq *UserQuery) ExistX(ctx context.Context) bool
- func (uq *UserQuery) First(ctx context.Context) (*User, error)
- func (uq *UserQuery) FirstID(ctx context.Context) (id int, err error)
- func (uq *UserQuery) FirstIDX(ctx context.Context) int
- func (uq *UserQuery) FirstX(ctx context.Context) *User
- func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy
- func (uq *UserQuery) IDs(ctx context.Context) ([]int, error)
- func (uq *UserQuery) IDsX(ctx context.Context) []int
- func (uq *UserQuery) Limit(limit int) *UserQuery
- func (uq *UserQuery) Offset(offset int) *UserQuery
- func (uq *UserQuery) Only(ctx context.Context) (*User, error)
- func (uq *UserQuery) OnlyID(ctx context.Context) (id int, err error)
- func (uq *UserQuery) OnlyIDX(ctx context.Context) int
- func (uq *UserQuery) OnlyX(ctx context.Context) *User
- func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery
- func (u *UserQuery) Paginate(ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, ...) (*MasterUserConnection, error)
- func (uq *UserQuery) Select(fields ...string) *UserSelect
- func (uq *UserQuery) Unique(unique bool) *UserQuery
- func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery
- type UserSelect
- func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserSelect) BoolX(ctx context.Context) bool
- func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *UserSelect) BoolsX(ctx context.Context) []bool
- func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserSelect) Float64X(ctx context.Context) float64
- func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserSelect) Float64sX(ctx context.Context) []float64
- func (s *UserSelect) Int(ctx context.Context) (_ int, err error)
- func (s *UserSelect) IntX(ctx context.Context) int
- func (s *UserSelect) Ints(ctx context.Context) ([]int, error)
- func (s *UserSelect) IntsX(ctx context.Context) []int
- func (us *UserSelect) Scan(ctx context.Context, v interface{}) error
- func (s *UserSelect) ScanX(ctx context.Context, v interface{})
- func (s *UserSelect) String(ctx context.Context) (_ string, err error)
- func (s *UserSelect) StringX(ctx context.Context) string
- func (s *UserSelect) Strings(ctx context.Context) ([]string, error)
- func (s *UserSelect) StringsX(ctx context.Context) []string
- type UserUpdate
- func (uu *UserUpdate) AddAge(i int) *UserUpdate
- func (uu *UserUpdate) AddAmount(s schema.Amount) *UserUpdate
- func (uu *UserUpdate) ClearNullableString() *UserUpdate
- func (uu *UserUpdate) Exec(ctx context.Context) error
- func (uu *UserUpdate) ExecX(ctx context.Context)
- func (uu *UserUpdate) Mutation() *UserMutation
- func (uu *UserUpdate) Save(ctx context.Context) (int, error)
- func (uu *UserUpdate) SaveX(ctx context.Context) int
- func (uu *UserUpdate) SetAge(i int) *UserUpdate
- func (uu *UserUpdate) SetAmount(s schema.Amount) *UserUpdate
- func (uu *UserUpdate) SetNillableNullableString(s *string) *UserUpdate
- func (uu *UserUpdate) SetNullableString(s string) *UserUpdate
- func (uu *UserUpdate) SetRole(r role.Role) *UserUpdate
- func (uu *UserUpdate) SetUsername(s string) *UserUpdate
- func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
- type UserUpdateOne
- func (uuo *UserUpdateOne) AddAge(i int) *UserUpdateOne
- func (uuo *UserUpdateOne) AddAmount(s schema.Amount) *UserUpdateOne
- func (uuo *UserUpdateOne) ClearNullableString() *UserUpdateOne
- func (uuo *UserUpdateOne) Exec(ctx context.Context) error
- func (uuo *UserUpdateOne) ExecX(ctx context.Context)
- func (uuo *UserUpdateOne) Mutation() *UserMutation
- func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)
- func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User
- func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetAge(i int) *UserUpdateOne
- func (uuo *UserUpdateOne) SetAmount(s schema.Amount) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNillableNullableString(s *string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetNullableString(s string) *UserUpdateOne
- func (uuo *UserUpdateOne) SetRole(r role.Role) *UserUpdateOne
- func (uuo *UserUpdateOne) SetUsername(s string) *UserUpdateOne
- type Users
- type ValidationError
- type Value
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeCategory = "Category" TypeTodo = "Todo" TypeUser = "User" )
Variables ¶
var ( // CategoryOrderFieldText orders Category by text. CategoryOrderFieldText = &CategoryOrderField{ field: category.FieldText, toCursor: func(c *Category) Cursor { return Cursor{ ID: c.ID, Value: c.Text, } }, } // CategoryOrderFieldDuration orders Category by duration. CategoryOrderFieldDuration = &CategoryOrderField{ field: category.FieldDuration, toCursor: func(c *Category) Cursor { return Cursor{ ID: c.ID, Value: c.Duration, } }, } )
var ( // TodoOrderFieldCreatedAt orders Todo by created_at. TodoOrderFieldCreatedAt = &TodoOrderField{ field: todo.FieldCreatedAt, toCursor: func(t *Todo) Cursor { return Cursor{ ID: t.ID, Value: t.CreatedAt, } }, } // TodoOrderFieldVisibilityStatus orders Todo by visibility_status. TodoOrderFieldVisibilityStatus = &TodoOrderField{ field: todo.FieldVisibilityStatus, toCursor: func(t *Todo) Cursor { return Cursor{ ID: t.ID, Value: t.VisibilityStatus, } }, } // TodoOrderFieldStatus orders Todo by status. TodoOrderFieldStatus = &TodoOrderField{ field: todo.FieldStatus, toCursor: func(t *Todo) Cursor { return Cursor{ ID: t.ID, Value: t.Status, } }, } // TodoOrderFieldPriority orders Todo by priority. TodoOrderFieldPriority = &TodoOrderField{ field: todo.FieldPriority, toCursor: func(t *Todo) Cursor { return Cursor{ ID: t.ID, Value: t.Priority, } }, } // TodoOrderFieldText orders Todo by text. TodoOrderFieldText = &TodoOrderField{ field: todo.FieldText, toCursor: func(t *Todo) Cursor { return Cursor{ ID: t.ID, Value: t.Text, } }, } )
var DefaultCategoryOrder = &CategoryOrder{ Direction: OrderDirectionAsc, Field: &CategoryOrderField{ field: category.FieldID, toCursor: func(c *Category) Cursor { return Cursor{ID: c.ID} }, }, }
DefaultCategoryOrder is the default ordering of Category.
var DefaultMasterUserOrder = &MasterUserOrder{ Direction: OrderDirectionAsc, Field: &MasterUserOrderField{ field: user.FieldID, toCursor: func(u *MasterUser) Cursor { return Cursor{ID: u.ID} }, }, }
DefaultMasterUserOrder is the default ordering of User.
var DefaultTodoOrder = &TodoOrder{ Direction: OrderDirectionAsc, Field: &TodoOrderField{ field: todo.FieldID, toCursor: func(t *Todo) Cursor { return Cursor{ID: t.ID} }, }, }
DefaultTodoOrder is the default ordering of Todo.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
func NewTxContext ¶
NewTxContext returns a new context with the given Tx attached.
Types ¶
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
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 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"` // UUIDA holds the value of the "uuid_a" field. UUIDA *uuid.UUID `json:"uuid_a,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"` // 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) IsEntity ¶
func (Category) IsEntity()
IsEntity is implemented for GQL Entity interface.
func (*Category) QueryTodos ¶
QueryTodos queries the "todos" edge of the Category entity.
func (*Category) ToEdge ¶
func (c *Category) ToEdge(order *CategoryOrder) *CategoryEdge
ToEdge converts Category into CategoryEdge.
func (*Category) Unwrap ¶
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.
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 create builder for Category.
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 delete builder for the given entity.
func (*CategoryClient) DeleteOneID ¶
func (c *CategoryClient) DeleteOneID(id int) *CategoryDeleteOne
DeleteOneID returns a delete builder for the given 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) Query ¶
func (c *CategoryClient) Query() *CategoryQuery
Query returns a query builder for 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) 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 ¶
func (cc *CategoryCreate) SetConfig(sc *schematype.CategoryConfig) *CategoryCreate
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) 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) SetNillableUUIDA ¶
func (cc *CategoryCreate) SetNillableUUIDA(u *uuid.UUID) *CategoryCreate
SetNillableUUIDA sets the "uuid_a" 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) SetUUIDA ¶
func (cc *CategoryCreate) SetUUIDA(u uuid.UUID) *CategoryCreate
SetUUIDA sets the "uuid_a" 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.
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.
type CategoryEdge ¶
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"` // contains filtered or unexported fields }
CategoryEdges holds the relations/edges for other nodes in the graph.
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 ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CategoryGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CategoryGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CategoryGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CategoryGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CategoryGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CategoryGroupBy) Scan ¶
func (cgb *CategoryGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*CategoryGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
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) 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) 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) ClearTodos ¶
func (m *CategoryMutation) ClearTodos()
ClearTodos clears the "todos" edge to the Todo entity.
func (*CategoryMutation) ClearUUIDA ¶
func (m *CategoryMutation) ClearUUIDA()
ClearUUIDA clears the value of the "uuid_a" 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 ¶
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 ¶
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 ¶
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) OldUUIDA ¶
OldUUIDA returns the old "uuid_a" 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) 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) 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) 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) ResetUUIDA ¶
func (m *CategoryMutation) ResetUUIDA()
ResetUUIDA resets all changes to the "uuid_a" 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) 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) SetUUIDA ¶
func (m *CategoryMutation) SetUUIDA(u uuid.UUID)
SetUUIDA sets the "uuid_a" 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) 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) UUIDA ¶
func (m *CategoryMutation) UUIDA() (r uuid.UUID, exists bool)
UUIDA returns the value of the "uuid_a" field in the mutation.
func (*CategoryMutation) UUIDACleared ¶
func (m *CategoryMutation) UUIDACleared() bool
UUIDACleared returns if the "uuid_a" 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.
type CategoryOrder ¶
type CategoryOrder struct { Direction OrderDirection `json:"direction"` Field *CategoryOrderField `json:"field"` }
CategoryOrder defines the ordering of Category.
type CategoryOrderField ¶
type CategoryOrderField struct {
// 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) 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) ([]int, 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 adds a limit step to the query.
func (*CategoryQuery) Offset ¶
func (cq *CategoryQuery) Offset(offset int) *CategoryQuery
Offset adds an offset step to the query.
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 ¶
func (cq *CategoryQuery) Order(o ...OrderFunc) *CategoryQuery
Order adds an order step to the query.
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) 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) 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) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CategorySelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CategorySelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CategorySelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CategorySelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CategorySelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CategorySelect) Scan ¶
func (cs *CategorySelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*CategorySelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
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) 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) 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) ClearTodos ¶
func (cu *CategoryUpdate) ClearTodos() *CategoryUpdate
ClearTodos clears all "todos" edges to the Todo entity.
func (*CategoryUpdate) ClearUUIDA ¶
func (cu *CategoryUpdate) ClearUUIDA() *CategoryUpdate
ClearUUIDA clears the value of the "uuid_a" 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) Mutation ¶
func (cu *CategoryUpdate) Mutation() *CategoryMutation
Mutation returns the CategoryMutation object of the builder.
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 ¶
func (cu *CategoryUpdate) SetConfig(sc *schematype.CategoryConfig) *CategoryUpdate
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) 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) SetNillableUUIDA ¶
func (cu *CategoryUpdate) SetNillableUUIDA(u *uuid.UUID) *CategoryUpdate
SetNillableUUIDA sets the "uuid_a" 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) SetUUIDA ¶
func (cu *CategoryUpdate) SetUUIDA(u uuid.UUID) *CategoryUpdate
SetUUIDA sets the "uuid_a" 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) 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) 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) ClearTodos ¶
func (cuo *CategoryUpdateOne) ClearTodos() *CategoryUpdateOne
ClearTodos clears all "todos" edges to the Todo entity.
func (*CategoryUpdateOne) ClearUUIDA ¶
func (cuo *CategoryUpdateOne) ClearUUIDA() *CategoryUpdateOne
ClearUUIDA clears the value of the "uuid_a" 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) Mutation ¶
func (cuo *CategoryUpdateOne) Mutation() *CategoryMutation
Mutation returns the CategoryMutation object of the builder.
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 ¶
func (cuo *CategoryUpdateOne) SetConfig(sc *schematype.CategoryConfig) *CategoryUpdateOne
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) 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) SetNillableUUIDA ¶
func (cuo *CategoryUpdateOne) SetNillableUUIDA(u *uuid.UUID) *CategoryUpdateOne
SetNillableUUIDA sets the "uuid_a" field if the given value is not nil.
func (*CategoryUpdateOne) SetStatus ¶
func (cuo *CategoryUpdateOne) SetStatus(c category.Status) *CategoryUpdateOne
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) SetUUIDA ¶
func (cuo *CategoryUpdateOne) SetUUIDA(u uuid.UUID) *CategoryUpdateOne
SetUUIDA sets the "uuid_a" field.
type CategoryWhereInput ¶
type CategoryWhereInput struct { 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"` // "uuid_a" field predicates. UUIDA *uuid.UUID `json:"uuidA,omitempty"` UUIDANEQ *uuid.UUID `json:"uuidANEQ,omitempty"` UUIDAIn []uuid.UUID `json:"uuidAIn,omitempty"` UUIDANotIn []uuid.UUID `json:"uuidANotIn,omitempty"` UUIDAGT *uuid.UUID `json:"uuidAGT,omitempty"` UUIDAGTE *uuid.UUID `json:"uuidAGTE,omitempty"` UUIDALT *uuid.UUID `json:"uuidALT,omitempty"` UUIDALTE *uuid.UUID `json:"uuidALTE,omitempty"` UUIDAIsNil bool `json:"uuidAIsNil,omitempty"` UUIDANotNil bool `json:"uuidANotNil,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"` }
CategoryWhereInput represents a where input for filtering Category queries.
func (*CategoryWhereInput) Filter ¶
func (i *CategoryWhereInput) Filter(q *CategoryQuery) (*CategoryQuery, error)
Filter applies the CategoryWhereInput filter on the CategoryQuery builder.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Category is the client for interacting with the Category builders. Category *CategoryClient // Todo is the client for interacting with the Todo builders. Todo *TodoClient // User is the client for interacting with the User builders. User *UserClient // contains filtered or unexported fields }
Client is the client that holds all ent builders.
func FromContext ¶
FromContext returns a Client stored inside a context, or nil if there isn't one.
func Open ¶
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) Debug ¶
Debug returns a new debug-client. It's used to get verbose logging on specific operations.
client.Debug(). Category. Query(). Count(ctx)
func (*Client) Noder ¶
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(pet.Table))
func (*Client) OpenTx ¶
OpenTx opens a transaction and returns a transactional context along with the created transaction.
type CommitFunc ¶
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.
type CommitHook ¶
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 ConstraintError ¶
type ConstraintError struct {
// contains filtered or unexported fields
}
ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.
func (ConstraintError) Error ¶
func (e ConstraintError) Error() string
Error implements the error interface.
func (*ConstraintError) Unwrap ¶
func (e *ConstraintError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
type Cursor ¶
Cursor of an edge type.
func (Cursor) MarshalGQL ¶
MarshalGQL implements graphql.Marshaler interface.
func (*Cursor) UnmarshalGQL ¶
UnmarshalGQL implements graphql.Unmarshaler interface.
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 MasterUser ¶
type MasterUser = User
MasterUser is the type alias for User.
func (*MasterUser) ToEdge ¶
func (u *MasterUser) ToEdge(order *MasterUserOrder) *MasterUserEdge
ToEdge converts MasterUser into MasterUserEdge.
type MasterUserConnection ¶
type MasterUserConnection struct { Edges []*MasterUserEdge `json:"edges"` PageInfo PageInfo `json:"pageInfo"` TotalCount int `json:"totalCount"` }
MasterUserConnection is the connection containing edges to MasterUser.
type MasterUserEdge ¶
type MasterUserEdge struct { Node *MasterUser `json:"node"` Cursor Cursor `json:"cursor"` }
MasterUserEdge is the edge representation of MasterUser.
type MasterUserOrder ¶
type MasterUserOrder struct { Direction OrderDirection `json:"direction"` Field *MasterUserOrderField `json:"field"` }
MasterUserOrder defines the ordering of User.
type MasterUserOrderField ¶
type MasterUserOrderField struct {
// contains filtered or unexported fields
}
MasterUserOrderField defines the ordering field of User.
type MasterUserPaginateOption ¶
type MasterUserPaginateOption func(*masteruserPager) error
MasterUserPaginateOption enables pagination customization.
func WithMasterUserFilter ¶
func WithMasterUserFilter(filter func(*UserQuery) (*UserQuery, error)) MasterUserPaginateOption
WithMasterUserFilter configures pagination filter.
func WithMasterUserOrder ¶
func WithMasterUserOrder(order *MasterUserOrder) MasterUserPaginateOption
WithMasterUserOrder configures pagination ordering.
type MasterUserWhereInput ¶
type MasterUserWhereInput struct { Not *MasterUserWhereInput `json:"not,omitempty"` Or []*MasterUserWhereInput `json:"or,omitempty"` And []*MasterUserWhereInput `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"` // "username" field predicates. Username *string `json:"username,omitempty"` UsernameNEQ *string `json:"usernameNEQ,omitempty"` UsernameIn []string `json:"usernameIn,omitempty"` UsernameNotIn []string `json:"usernameNotIn,omitempty"` UsernameGT *string `json:"usernameGT,omitempty"` UsernameGTE *string `json:"usernameGTE,omitempty"` UsernameLT *string `json:"usernameLT,omitempty"` UsernameLTE *string `json:"usernameLTE,omitempty"` UsernameContains *string `json:"usernameContains,omitempty"` UsernameHasPrefix *string `json:"usernameHasPrefix,omitempty"` UsernameHasSuffix *string `json:"usernameHasSuffix,omitempty"` UsernameEqualFold *string `json:"usernameEqualFold,omitempty"` UsernameContainsFold *string `json:"usernameContainsFold,omitempty"` // "age" field predicates. Age *int `json:"age,omitempty"` AgeNEQ *int `json:"ageNEQ,omitempty"` AgeIn []int `json:"ageIn,omitempty"` AgeNotIn []int `json:"ageNotIn,omitempty"` AgeGT *int `json:"ageGT,omitempty"` AgeGTE *int `json:"ageGTE,omitempty"` AgeLT *int `json:"ageLT,omitempty"` AgeLTE *int `json:"ageLTE,omitempty"` // "amount" field predicates. Amount *schema.Amount `json:"amount,omitempty"` AmountNEQ *schema.Amount `json:"amountNEQ,omitempty"` AmountIn []schema.Amount `json:"amountIn,omitempty"` AmountNotIn []schema.Amount `json:"amountNotIn,omitempty"` AmountGT *schema.Amount `json:"amountGT,omitempty"` AmountGTE *schema.Amount `json:"amountGTE,omitempty"` AmountLT *schema.Amount `json:"amountLT,omitempty"` AmountLTE *schema.Amount `json:"amountLTE,omitempty"` // "role" field predicates. Role *role.Role `json:"role,omitempty"` RoleNEQ *role.Role `json:"roleNEQ,omitempty"` RoleIn []role.Role `json:"roleIn,omitempty"` RoleNotIn []role.Role `json:"roleNotIn,omitempty"` // "nullable_string" field predicates. NullableString *string `json:"nullableString,omitempty"` NullableStringNEQ *string `json:"nullableStringNEQ,omitempty"` NullableStringIn []string `json:"nullableStringIn,omitempty"` NullableStringNotIn []string `json:"nullableStringNotIn,omitempty"` NullableStringGT *string `json:"nullableStringGT,omitempty"` NullableStringGTE *string `json:"nullableStringGTE,omitempty"` NullableStringLT *string `json:"nullableStringLT,omitempty"` NullableStringLTE *string `json:"nullableStringLTE,omitempty"` NullableStringContains *string `json:"nullableStringContains,omitempty"` NullableStringHasPrefix *string `json:"nullableStringHasPrefix,omitempty"` NullableStringHasSuffix *string `json:"nullableStringHasSuffix,omitempty"` NullableStringIsNil bool `json:"nullableStringIsNil,omitempty"` NullableStringNotNil bool `json:"nullableStringNotNil,omitempty"` NullableStringEqualFold *string `json:"nullableStringEqualFold,omitempty"` NullableStringContainsFold *string `json:"nullableStringContainsFold,omitempty"` }
MasterUserWhereInput represents a where input for filtering User queries.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
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 ¶
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 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 OrderDirection ¶
type OrderDirection string
OrderDirection defines the directions in which to order a list of items.
const ( // OrderDirectionAsc specifies an ascending order. OrderDirectionAsc OrderDirection = "ASC" // OrderDirectionDesc specifies a descending order. OrderDirectionDesc OrderDirection = "DESC" )
func (OrderDirection) MarshalGQL ¶
func (o OrderDirection) MarshalGQL(w io.Writer)
MarshalGQL implements graphql.Marshaler interface.
func (OrderDirection) String ¶
func (o OrderDirection) String() string
String implements fmt.Stringer interface.
func (*OrderDirection) UnmarshalGQL ¶
func (o *OrderDirection) UnmarshalGQL(val interface{}) error
UnmarshalGQL implements graphql.Unmarshaler interface.
func (OrderDirection) Validate ¶
func (o OrderDirection) Validate() error
Validate the order direction value.
type PageInfo ¶
type PageInfo struct { HasNextPage bool `json:"hasNextPage"` HasPreviousPage bool `json:"hasPreviousPage"` StartCursor *Cursor `json:"startCursor"` EndCursor *Cursor `json:"endCursor"` }
PageInfo of a connection type.
type RollbackFunc ¶
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.
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 ¶
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"` // VisibilityStatus holds the value of the "visibility_status" field. VisibilityStatus todo.VisibilityStatus `json:"visibility_status,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"` // 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) QueryChildren ¶
QueryChildren queries the "children" edge of the Todo entity.
func (*Todo) QueryParent ¶
QueryParent queries the "parent" edge of the Todo entity.
func (*Todo) Unwrap ¶
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.
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 create builder for Todo.
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 delete builder for the given entity.
func (*TodoClient) DeleteOneID ¶
func (c *TodoClient) DeleteOneID(id int) *TodoDeleteOne
DeleteOneID returns a delete builder for the given 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) Query ¶
func (c *TodoClient) Query() *TodoQuery
Query returns a query builder for 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) 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) SetCreatedAt ¶
func (tc *TodoCreate) SetCreatedAt(t time.Time) *TodoCreate
SetCreatedAt sets the "created_at" field.
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) SetNillableVisibilityStatus ¶
func (tc *TodoCreate) SetNillableVisibilityStatus(ts *todo.VisibilityStatus) *TodoCreate
SetNillableVisibilityStatus sets the "visibility_status" field 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) 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.
func (*TodoCreate) SetVisibilityStatus ¶
func (tc *TodoCreate) SetVisibilityStatus(ts todo.VisibilityStatus) *TodoCreate
SetVisibilityStatus sets the "visibility_status" 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.
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.
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"` // contains filtered or unexported fields }
TodoEdges holds the relations/edges for other nodes in the graph.
func (TodoEdges) ChildrenOrErr ¶
ChildrenOrErr returns the Children value or an error if the edge was not loaded in eager-loading.
func (TodoEdges) ParentOrErr ¶
ParentOrErr returns the Parent 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 ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TodoGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TodoGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TodoGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TodoGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TodoGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TodoGroupBy) Scan ¶
func (tgb *TodoGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*TodoGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
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) 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) ClearChildren ¶
func (m *TodoMutation) ClearChildren()
ClearChildren clears the "children" edge to the Todo entity.
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) ClearParent ¶
func (m *TodoMutation) ClearParent()
ClearParent clears the "parent" edge to the Todo 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) 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) OldCreatedAt ¶
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) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*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 ¶
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) OldVisibilityStatus ¶
func (m *TodoMutation) OldVisibilityStatus(ctx context.Context) (v todo.VisibilityStatus, err error)
OldVisibilityStatus returns the old "visibility_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) 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) 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) 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) 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) 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) ResetVisibilityStatus ¶
func (m *TodoMutation) ResetVisibilityStatus()
ResetVisibilityStatus resets all changes to the "visibility_status" field.
func (*TodoMutation) SetCreatedAt ¶
func (m *TodoMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" 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) 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) 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) SetVisibilityStatus ¶
func (m *TodoMutation) SetVisibilityStatus(ts todo.VisibilityStatus)
SetVisibilityStatus sets the "visibility_status" 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) VisibilityStatus ¶
func (m *TodoMutation) VisibilityStatus() (r todo.VisibilityStatus, exists bool)
VisibilityStatus returns the value of the "visibility_status" field in the mutation.
func (*TodoMutation) Where ¶
func (m *TodoMutation) Where(ps ...predicate.Todo)
Where appends a list predicates to the TodoMutation builder.
type TodoOrder ¶
type TodoOrder struct { Direction OrderDirection `json:"direction"` Field *TodoOrderField `json:"field"` }
TodoOrder defines the ordering of Todo.
type TodoOrderField ¶
type TodoOrderField struct {
// 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) Clone ¶
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 ¶
CollectFields tells the query-builder to eagerly load connected nodes by resolver context.
func (*TodoQuery) First ¶
First returns the first Todo entity from the query. Returns a *NotFoundError when no Todo was found.
func (*TodoQuery) FirstID ¶
FirstID returns the first Todo ID from the query. Returns a *NotFoundError when no Todo ID was found.
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) Only ¶
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 ¶
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) 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) QueryChildren ¶
QueryChildren chains the current query on the "children" edge.
func (*TodoQuery) QueryParent ¶
QueryParent chains the current query on the "parent" 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 ¶
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) WithChildren ¶
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) WithParent ¶
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 TodoSelect ¶
type TodoSelect struct { *TodoQuery // contains filtered or unexported fields }
TodoSelect is the builder for selecting fields of Todo entities.
func (*TodoSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*TodoSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*TodoSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*TodoSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*TodoSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*TodoSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*TodoSelect) Scan ¶
func (ts *TodoSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*TodoSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
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) ClearChildren ¶
func (tu *TodoUpdate) ClearChildren() *TodoUpdate
ClearChildren clears all "children" edges to the Todo entity.
func (*TodoUpdate) ClearParent ¶
func (tu *TodoUpdate) ClearParent() *TodoUpdate
ClearParent clears the "parent" edge to the Todo 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) 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) 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) SetNillableVisibilityStatus ¶
func (tu *TodoUpdate) SetNillableVisibilityStatus(ts *todo.VisibilityStatus) *TodoUpdate
SetNillableVisibilityStatus sets the "visibility_status" 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) 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) SetVisibilityStatus ¶
func (tu *TodoUpdate) SetVisibilityStatus(ts todo.VisibilityStatus) *TodoUpdate
SetVisibilityStatus sets the "visibility_status" 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) ClearChildren ¶
func (tuo *TodoUpdateOne) ClearChildren() *TodoUpdateOne
ClearChildren clears all "children" edges to the Todo entity.
func (*TodoUpdateOne) ClearParent ¶
func (tuo *TodoUpdateOne) ClearParent() *TodoUpdateOne
ClearParent clears the "parent" edge to the Todo 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) 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) 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) SetNillableVisibilityStatus ¶
func (tuo *TodoUpdateOne) SetNillableVisibilityStatus(ts *todo.VisibilityStatus) *TodoUpdateOne
SetNillableVisibilityStatus sets the "visibility_status" 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) 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) SetVisibilityStatus ¶
func (tuo *TodoUpdateOne) SetVisibilityStatus(ts todo.VisibilityStatus) *TodoUpdateOne
SetVisibilityStatus sets the "visibility_status" field.
type TodoWhereInput ¶
type TodoWhereInput struct { 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"` // "visibility_status" field predicates. VisibilityStatus *todo.VisibilityStatus `json:"visibilityStatus,omitempty"` VisibilityStatusNEQ *todo.VisibilityStatus `json:"visibilityStatusNEQ,omitempty"` VisibilityStatusIn []todo.VisibilityStatus `json:"visibilityStatusIn,omitempty"` VisibilityStatusNotIn []todo.VisibilityStatus `json:"visibilityStatusNotIn,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"` // "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"` }
TodoWhereInput represents a where input for filtering Todo queries.
type Tx ¶
type Tx struct { // Category is the client for interacting with the Category builders. Category *CategoryClient // Todo is the client for interacting with the Todo builders. Todo *TodoClient // User is the client for interacting with the User builders. User *UserClient // contains filtered or unexported fields }
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
type User ¶
type User struct { // ID of the ent. ID int `json:"id,omitempty"` // Username holds the value of the "username" field. Username string `json:"username,omitempty"` // Age holds the value of the "age" field. Age int `json:"age,omitempty"` // Amount holds the value of the "amount" field. Amount schema.Amount `json:"amount,omitempty"` // Role holds the value of the "role" field. Role role.Role `json:"role,omitempty"` // NullableString holds the value of the "nullable_string" field. NullableString *string `json:"nullable_string,omitempty"` // contains filtered or unexported fields }
User is the model entity for the User schema.
func (*User) Unwrap ¶
Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*User) Update ¶
func (u *User) Update() *UserUpdateOne
Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.
type UserClient ¶
type UserClient struct {
// contains filtered or unexported fields
}
UserClient is a client for the User schema.
func NewUserClient ¶
func NewUserClient(c config) *UserClient
NewUserClient returns a client for the User from the given config.
func (*UserClient) Create ¶
func (c *UserClient) Create() *UserCreate
Create returns a create builder for User.
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 delete builder for the given entity.
func (*UserClient) DeleteOneID ¶
func (c *UserClient) DeleteOneID(id int) *UserDeleteOne
DeleteOneID returns a delete builder for the given 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) Query ¶
func (c *UserClient) Query() *UserQuery
Query returns a query builder for User.
func (*UserClient) Update ¶
func (c *UserClient) Update() *UserUpdate
Update returns an update builder for User.
func (*UserClient) UpdateOne ¶
func (c *UserClient) UpdateOne(u *User) *UserUpdateOne
UpdateOne returns an update builder for the given entity.
func (*UserClient) UpdateOneID ¶
func (c *UserClient) UpdateOneID(id int) *UserUpdateOne
UpdateOneID returns an update builder for the given id.
func (*UserClient) Use ¶
func (c *UserClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.
type UserCreate ¶
type UserCreate struct {
// contains filtered or unexported fields
}
UserCreate is the builder for creating a User entity.
func (*UserCreate) 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) SetAge ¶
func (uc *UserCreate) SetAge(i int) *UserCreate
SetAge sets the "age" field.
func (*UserCreate) SetAmount ¶
func (uc *UserCreate) SetAmount(s schema.Amount) *UserCreate
SetAmount sets the "amount" field.
func (*UserCreate) SetID ¶
func (uc *UserCreate) SetID(i int) *UserCreate
SetID sets the "id" field.
func (*UserCreate) SetNillableNullableString ¶
func (uc *UserCreate) SetNillableNullableString(s *string) *UserCreate
SetNillableNullableString sets the "nullable_string" field if the given value is not nil.
func (*UserCreate) SetNullableString ¶
func (uc *UserCreate) SetNullableString(s string) *UserCreate
SetNullableString sets the "nullable_string" field.
func (*UserCreate) SetRole ¶
func (uc *UserCreate) SetRole(r role.Role) *UserCreate
SetRole sets the "role" field.
func (*UserCreate) SetUsername ¶
func (uc *UserCreate) SetUsername(s string) *UserCreate
SetUsername sets the "username" field.
type UserCreateBulk ¶
type UserCreateBulk struct {
// contains filtered or unexported fields
}
UserCreateBulk is the builder for creating many User entities in bulk.
func (*UserCreateBulk) Exec ¶
func (ucb *UserCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserCreateBulk) ExecX ¶
func (ucb *UserCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type UserDelete ¶
type UserDelete struct {
// contains filtered or unexported fields
}
UserDelete is the builder for deleting a User entity.
func (*UserDelete) Exec ¶
func (ud *UserDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*UserDelete) ExecX ¶
func (ud *UserDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*UserDelete) Where ¶
func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete
Where appends a list predicates to the UserDelete builder.
type UserDeleteOne ¶
type UserDeleteOne struct {
// contains filtered or unexported fields
}
UserDeleteOne is the builder for deleting a single User entity.
func (*UserDeleteOne) Exec ¶
func (udo *UserDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*UserDeleteOne) ExecX ¶
func (udo *UserDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type 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 ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserGroupBy) Scan ¶
func (ugb *UserGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*UserGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserMutation ¶
type UserMutation struct {
// contains filtered or unexported fields
}
UserMutation represents an operation that mutates the User nodes in the graph.
func (*UserMutation) AddAge ¶
func (m *UserMutation) AddAge(i int)
AddAge adds i to the "age" field.
func (*UserMutation) AddAmount ¶
func (m *UserMutation) AddAmount(s schema.Amount)
AddAmount adds s to the "amount" field.
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) AddedAge ¶
func (m *UserMutation) AddedAge() (r int, exists bool)
AddedAge returns the value that was added to the "age" field in this mutation.
func (*UserMutation) AddedAmount ¶
func (m *UserMutation) AddedAmount() (r schema.Amount, exists bool)
AddedAmount returns the value that was added to the "amount" field in this mutation.
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) Age ¶
func (m *UserMutation) Age() (r int, exists bool)
Age returns the value of the "age" field in the mutation.
func (*UserMutation) Amount ¶
func (m *UserMutation) Amount() (r schema.Amount, exists bool)
Amount returns the value of the "amount" field in the 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) ClearNullableString ¶
func (m *UserMutation) ClearNullableString()
ClearNullableString clears the value of the "nullable_string" 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) 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) NullableString ¶
func (m *UserMutation) NullableString() (r string, exists bool)
NullableString returns the value of the "nullable_string" field in the mutation.
func (*UserMutation) NullableStringCleared ¶
func (m *UserMutation) NullableStringCleared() bool
NullableStringCleared returns if the "nullable_string" field was cleared in this mutation.
func (*UserMutation) OldAge ¶
func (m *UserMutation) OldAge(ctx context.Context) (v int, err error)
OldAge returns the old "age" 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) OldAmount ¶
OldAmount returns the old "amount" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldField ¶
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) OldNullableString ¶
func (m *UserMutation) OldNullableString(ctx context.Context) (v *string, err error)
OldNullableString returns the old "nullable_string" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldRole ¶
OldRole returns the old "role" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) OldUsername ¶
func (m *UserMutation) OldUsername(ctx context.Context) (v string, err error)
OldUsername returns the old "username" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*UserMutation) RemovedEdges ¶
func (m *UserMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*UserMutation) RemovedIDs ¶
func (m *UserMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*UserMutation) ResetAge ¶
func (m *UserMutation) ResetAge()
ResetAge resets all changes to the "age" field.
func (*UserMutation) ResetAmount ¶
func (m *UserMutation) ResetAmount()
ResetAmount resets all changes to the "amount" field.
func (*UserMutation) ResetEdge ¶
func (m *UserMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*UserMutation) 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) ResetNullableString ¶
func (m *UserMutation) ResetNullableString()
ResetNullableString resets all changes to the "nullable_string" field.
func (*UserMutation) ResetRole ¶
func (m *UserMutation) ResetRole()
ResetRole resets all changes to the "role" field.
func (*UserMutation) ResetUsername ¶
func (m *UserMutation) ResetUsername()
ResetUsername resets all changes to the "username" field.
func (*UserMutation) Role ¶
func (m *UserMutation) Role() (r role.Role, exists bool)
Role returns the value of the "role" field in the mutation.
func (*UserMutation) SetAmount ¶
func (m *UserMutation) SetAmount(s schema.Amount)
SetAmount sets the "amount" 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) SetID ¶
func (m *UserMutation) SetID(id int)
SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.
func (*UserMutation) SetNullableString ¶
func (m *UserMutation) SetNullableString(s string)
SetNullableString sets the "nullable_string" field.
func (*UserMutation) SetRole ¶
func (m *UserMutation) SetRole(r role.Role)
SetRole sets the "role" field.
func (*UserMutation) SetUsername ¶
func (m *UserMutation) SetUsername(s string)
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 string, exists bool)
Username returns the value of the "username" field in the mutation.
func (*UserMutation) Where ¶
func (m *UserMutation) Where(ps ...predicate.User)
Where appends a list predicates to the UserMutation builder.
type UserQuery ¶
type UserQuery struct {
// contains filtered or unexported fields
}
UserQuery is the builder for querying User entities.
func (*UserQuery) Clone ¶
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 ¶
CollectFields tells the query-builder to eagerly load connected nodes by resolver context.
func (*UserQuery) First ¶
First returns the first User entity from the query. Returns a *NotFoundError when no User was found.
func (*UserQuery) FirstID ¶
FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.
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 { Username string `json:"username,omitempty"` Count int `json:"count,omitempty"` } client.User.Query(). GroupBy(user.FieldUsername). Aggregate(ent.Count()). Scan(ctx, &v)
func (*UserQuery) Only ¶
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 ¶
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) Paginate ¶
func (u *UserQuery) Paginate( ctx context.Context, after *Cursor, first *int, before *Cursor, last *int, opts ...MasterUserPaginateOption, ) (*MasterUserConnection, error)
Paginate executes the query and returns a relay based cursor connection to MasterUser.
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 { Username string `json:"username,omitempty"` } client.User.Query(). Select(user.FieldUsername). Scan(ctx, &v)
type UserSelect ¶
type UserSelect struct { *UserQuery // contains filtered or unexported fields }
UserSelect is the builder for selecting fields of User entities.
func (*UserSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserSelect) Scan ¶
func (us *UserSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*UserSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserUpdate ¶
type UserUpdate struct {
// contains filtered or unexported fields
}
UserUpdate is the builder for updating User entities.
func (*UserUpdate) AddAge ¶
func (uu *UserUpdate) AddAge(i int) *UserUpdate
AddAge adds i to the "age" field.
func (*UserUpdate) AddAmount ¶
func (uu *UserUpdate) AddAmount(s schema.Amount) *UserUpdate
AddAmount adds s to the "amount" field.
func (*UserUpdate) ClearNullableString ¶
func (uu *UserUpdate) ClearNullableString() *UserUpdate
ClearNullableString clears the value of the "nullable_string" 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) Mutation ¶
func (uu *UserUpdate) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
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) SetAge ¶
func (uu *UserUpdate) SetAge(i int) *UserUpdate
SetAge sets the "age" field.
func (*UserUpdate) SetAmount ¶
func (uu *UserUpdate) SetAmount(s schema.Amount) *UserUpdate
SetAmount sets the "amount" field.
func (*UserUpdate) SetNillableNullableString ¶
func (uu *UserUpdate) SetNillableNullableString(s *string) *UserUpdate
SetNillableNullableString sets the "nullable_string" field if the given value is not nil.
func (*UserUpdate) SetNullableString ¶
func (uu *UserUpdate) SetNullableString(s string) *UserUpdate
SetNullableString sets the "nullable_string" field.
func (*UserUpdate) SetRole ¶
func (uu *UserUpdate) SetRole(r role.Role) *UserUpdate
SetRole sets the "role" field.
func (*UserUpdate) SetUsername ¶
func (uu *UserUpdate) SetUsername(s string) *UserUpdate
SetUsername sets the "username" field.
func (*UserUpdate) Where ¶
func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate
Where appends a list predicates to the UserUpdate builder.
type UserUpdateOne ¶
type UserUpdateOne struct {
// contains filtered or unexported fields
}
UserUpdateOne is the builder for updating a single User entity.
func (*UserUpdateOne) AddAge ¶
func (uuo *UserUpdateOne) AddAge(i int) *UserUpdateOne
AddAge adds i to the "age" field.
func (*UserUpdateOne) AddAmount ¶
func (uuo *UserUpdateOne) AddAmount(s schema.Amount) *UserUpdateOne
AddAmount adds s to the "amount" field.
func (*UserUpdateOne) ClearNullableString ¶
func (uuo *UserUpdateOne) ClearNullableString() *UserUpdateOne
ClearNullableString clears the value of the "nullable_string" 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) Mutation ¶
func (uuo *UserUpdateOne) Mutation() *UserMutation
Mutation returns the UserMutation object of the builder.
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) SetAge ¶
func (uuo *UserUpdateOne) SetAge(i int) *UserUpdateOne
SetAge sets the "age" field.
func (*UserUpdateOne) SetAmount ¶
func (uuo *UserUpdateOne) SetAmount(s schema.Amount) *UserUpdateOne
SetAmount sets the "amount" field.
func (*UserUpdateOne) SetNillableNullableString ¶
func (uuo *UserUpdateOne) SetNillableNullableString(s *string) *UserUpdateOne
SetNillableNullableString sets the "nullable_string" field if the given value is not nil.
func (*UserUpdateOne) SetNullableString ¶
func (uuo *UserUpdateOne) SetNullableString(s string) *UserUpdateOne
SetNullableString sets the "nullable_string" field.
func (*UserUpdateOne) SetRole ¶
func (uuo *UserUpdateOne) SetRole(r role.Role) *UserUpdateOne
SetRole sets the "role" field.
func (*UserUpdateOne) SetUsername ¶
func (uuo *UserUpdateOne) SetUsername(s string) *UserUpdateOne
SetUsername sets the "username" field.
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.
Source Files ¶
- category.go
- category_create.go
- category_delete.go
- category_query.go
- category_update.go
- client.go
- config.go
- context.go
- ent.go
- gql_collection.go
- gql_edge.go
- gql_interfaces.go
- gql_node.go
- gql_pagination.go
- gql_transaction.go
- gql_where_input.go
- mutation.go
- runtime.go
- todo.go
- todo_create.go
- todo_delete.go
- todo_query.go
- todo_update.go
- tx.go
- user.go
- user_create.go
- user_delete.go
- user_query.go
- user_update.go