Versions in this module Expand all Collapse all v0 v0.10.2 Jan 14, 2022 v0.10.1 Jan 14, 2022 v0.10.0 Jan 14, 2022 Changes in this version + const OpCreate + const OpDelete + const OpDeleteOne + const OpUpdate + const OpUpdateOne + const TypeComment + const TypePost + const TypeUser + 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 + type AggregateFunc func(*sql.Selector) string + func As(fn AggregateFunc, end string) AggregateFunc + func Count() AggregateFunc + func Max(field string) AggregateFunc + func Mean(field string) AggregateFunc + func Min(field string) AggregateFunc + func Sum(field string) AggregateFunc + type Client struct + Comment *CommentClient + Post *PostClient + Schema *migrate.Schema + User *UserClient + func FromContext(ctx context.Context) *Client + func NewClient(opts ...Option) *Client + func Open(driverName, dataSourceName string, options ...Option) (*Client, error) + 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) Tx(ctx context.Context) (*Tx, error) + func (c *Client) Use(hooks ...Hook) + type Comment struct + Edges CommentEdges + ID int + PostID int + Text string + func (c *Comment) QueryPost() *PostQuery + func (c *Comment) String() string + func (c *Comment) Unwrap() *Comment + func (c *Comment) Update() *CommentUpdateOne + type CommentClient struct + func NewCommentClient(c config) *CommentClient + func (c *CommentClient) Create() *CommentCreate + func (c *CommentClient) CreateBulk(builders ...*CommentCreate) *CommentCreateBulk + func (c *CommentClient) Delete() *CommentDelete + func (c *CommentClient) DeleteOne(co *Comment) *CommentDeleteOne + func (c *CommentClient) DeleteOneID(id int) *CommentDeleteOne + func (c *CommentClient) Get(ctx context.Context, id int) (*Comment, error) + func (c *CommentClient) GetX(ctx context.Context, id int) *Comment + func (c *CommentClient) Hooks() []Hook + func (c *CommentClient) Query() *CommentQuery + func (c *CommentClient) QueryPost(co *Comment) *PostQuery + func (c *CommentClient) Update() *CommentUpdate + func (c *CommentClient) UpdateOne(co *Comment) *CommentUpdateOne + func (c *CommentClient) UpdateOneID(id int) *CommentUpdateOne + func (c *CommentClient) Use(hooks ...Hook) + type CommentCreate struct + func (cc *CommentCreate) Exec(ctx context.Context) error + func (cc *CommentCreate) ExecX(ctx context.Context) + func (cc *CommentCreate) Mutation() *CommentMutation + func (cc *CommentCreate) Save(ctx context.Context) (*Comment, error) + func (cc *CommentCreate) SaveX(ctx context.Context) *Comment + func (cc *CommentCreate) SetPost(p *Post) *CommentCreate + func (cc *CommentCreate) SetPostID(i int) *CommentCreate + func (cc *CommentCreate) SetText(s string) *CommentCreate + type CommentCreateBulk struct + func (ccb *CommentCreateBulk) Exec(ctx context.Context) error + func (ccb *CommentCreateBulk) ExecX(ctx context.Context) + func (ccb *CommentCreateBulk) Save(ctx context.Context) ([]*Comment, error) + func (ccb *CommentCreateBulk) SaveX(ctx context.Context) []*Comment + type CommentDelete struct + func (cd *CommentDelete) Exec(ctx context.Context) (int, error) + func (cd *CommentDelete) ExecX(ctx context.Context) int + func (cd *CommentDelete) Where(ps ...predicate.Comment) *CommentDelete + type CommentDeleteOne struct + func (cdo *CommentDeleteOne) Exec(ctx context.Context) error + func (cdo *CommentDeleteOne) ExecX(ctx context.Context) + type CommentEdges struct + Post *Post + func (e CommentEdges) PostOrErr() (*Post, error) + type CommentGroupBy struct + func (cgb *CommentGroupBy) Aggregate(fns ...AggregateFunc) *CommentGroupBy + func (cgb *CommentGroupBy) Bool(ctx context.Context) (_ bool, err error) + func (cgb *CommentGroupBy) BoolX(ctx context.Context) bool + func (cgb *CommentGroupBy) Bools(ctx context.Context) ([]bool, error) + func (cgb *CommentGroupBy) BoolsX(ctx context.Context) []bool + func (cgb *CommentGroupBy) Float64(ctx context.Context) (_ float64, err error) + func (cgb *CommentGroupBy) Float64X(ctx context.Context) float64 + func (cgb *CommentGroupBy) Float64s(ctx context.Context) ([]float64, error) + func (cgb *CommentGroupBy) Float64sX(ctx context.Context) []float64 + func (cgb *CommentGroupBy) Int(ctx context.Context) (_ int, err error) + func (cgb *CommentGroupBy) IntX(ctx context.Context) int + func (cgb *CommentGroupBy) Ints(ctx context.Context) ([]int, error) + func (cgb *CommentGroupBy) IntsX(ctx context.Context) []int + func (cgb *CommentGroupBy) Scan(ctx context.Context, v interface{}) error + func (cgb *CommentGroupBy) ScanX(ctx context.Context, v interface{}) + func (cgb *CommentGroupBy) String(ctx context.Context) (_ string, err error) + func (cgb *CommentGroupBy) StringX(ctx context.Context) string + func (cgb *CommentGroupBy) Strings(ctx context.Context) ([]string, error) + func (cgb *CommentGroupBy) StringsX(ctx context.Context) []string + type CommentMutation struct + func (m *CommentMutation) AddField(name string, value ent.Value) error + func (m *CommentMutation) AddedEdges() []string + func (m *CommentMutation) AddedField(name string) (ent.Value, bool) + func (m *CommentMutation) AddedFields() []string + func (m *CommentMutation) AddedIDs(name string) []ent.Value + func (m *CommentMutation) ClearEdge(name string) error + func (m *CommentMutation) ClearField(name string) error + func (m *CommentMutation) ClearPost() + func (m *CommentMutation) ClearedEdges() []string + func (m *CommentMutation) ClearedFields() []string + func (m *CommentMutation) EdgeCleared(name string) bool + func (m *CommentMutation) Field(name string) (ent.Value, bool) + func (m *CommentMutation) FieldCleared(name string) bool + func (m *CommentMutation) Fields() []string + func (m *CommentMutation) ID() (id int, exists bool) + func (m *CommentMutation) IDs(ctx context.Context) ([]int, error) + func (m *CommentMutation) OldField(ctx context.Context, name string) (ent.Value, error) + func (m *CommentMutation) OldPostID(ctx context.Context) (v int, err error) + func (m *CommentMutation) OldText(ctx context.Context) (v string, err error) + func (m *CommentMutation) Op() Op + func (m *CommentMutation) PostCleared() bool + func (m *CommentMutation) PostID() (r int, exists bool) + func (m *CommentMutation) PostIDs() (ids []int) + func (m *CommentMutation) RemovedEdges() []string + func (m *CommentMutation) RemovedIDs(name string) []ent.Value + func (m *CommentMutation) ResetEdge(name string) error + func (m *CommentMutation) ResetField(name string) error + func (m *CommentMutation) ResetPost() + func (m *CommentMutation) ResetPostID() + func (m *CommentMutation) ResetText() + func (m *CommentMutation) SetField(name string, value ent.Value) error + func (m *CommentMutation) SetPostID(i int) + func (m *CommentMutation) SetText(s string) + func (m *CommentMutation) Text() (r string, exists bool) + func (m *CommentMutation) Type() string + func (m *CommentMutation) Where(ps ...predicate.Comment) + func (m CommentMutation) Client() *Client + func (m CommentMutation) Tx() (*Tx, error) + type CommentQuery struct + func (cq *CommentQuery) All(ctx context.Context) ([]*Comment, error) + func (cq *CommentQuery) AllX(ctx context.Context) []*Comment + func (cq *CommentQuery) Clone() *CommentQuery + func (cq *CommentQuery) Count(ctx context.Context) (int, error) + func (cq *CommentQuery) CountX(ctx context.Context) int + func (cq *CommentQuery) Exist(ctx context.Context) (bool, error) + func (cq *CommentQuery) ExistX(ctx context.Context) bool + func (cq *CommentQuery) First(ctx context.Context) (*Comment, error) + func (cq *CommentQuery) FirstID(ctx context.Context) (id int, err error) + func (cq *CommentQuery) FirstIDX(ctx context.Context) int + func (cq *CommentQuery) FirstX(ctx context.Context) *Comment + func (cq *CommentQuery) GroupBy(field string, fields ...string) *CommentGroupBy + func (cq *CommentQuery) IDs(ctx context.Context) ([]int, error) + func (cq *CommentQuery) IDsX(ctx context.Context) []int + func (cq *CommentQuery) Limit(limit int) *CommentQuery + func (cq *CommentQuery) Offset(offset int) *CommentQuery + func (cq *CommentQuery) Only(ctx context.Context) (*Comment, error) + func (cq *CommentQuery) OnlyID(ctx context.Context) (id int, err error) + func (cq *CommentQuery) OnlyIDX(ctx context.Context) int + func (cq *CommentQuery) OnlyX(ctx context.Context) *Comment + func (cq *CommentQuery) Order(o ...OrderFunc) *CommentQuery + func (cq *CommentQuery) QueryPost() *PostQuery + func (cq *CommentQuery) Select(fields ...string) *CommentSelect + func (cq *CommentQuery) Unique(unique bool) *CommentQuery + func (cq *CommentQuery) Where(ps ...predicate.Comment) *CommentQuery + func (cq *CommentQuery) WithPost(opts ...func(*PostQuery)) *CommentQuery + type CommentSelect struct + func (cs *CommentSelect) Bool(ctx context.Context) (_ bool, err error) + func (cs *CommentSelect) BoolX(ctx context.Context) bool + func (cs *CommentSelect) Bools(ctx context.Context) ([]bool, error) + func (cs *CommentSelect) BoolsX(ctx context.Context) []bool + func (cs *CommentSelect) Float64(ctx context.Context) (_ float64, err error) + func (cs *CommentSelect) Float64X(ctx context.Context) float64 + func (cs *CommentSelect) Float64s(ctx context.Context) ([]float64, error) + func (cs *CommentSelect) Float64sX(ctx context.Context) []float64 + func (cs *CommentSelect) Int(ctx context.Context) (_ int, err error) + func (cs *CommentSelect) IntX(ctx context.Context) int + func (cs *CommentSelect) Ints(ctx context.Context) ([]int, error) + func (cs *CommentSelect) IntsX(ctx context.Context) []int + func (cs *CommentSelect) Scan(ctx context.Context, v interface{}) error + func (cs *CommentSelect) ScanX(ctx context.Context, v interface{}) + func (cs *CommentSelect) String(ctx context.Context) (_ string, err error) + func (cs *CommentSelect) StringX(ctx context.Context) string + func (cs *CommentSelect) Strings(ctx context.Context) ([]string, error) + func (cs *CommentSelect) StringsX(ctx context.Context) []string + type CommentUpdate struct + func (cu *CommentUpdate) ClearPost() *CommentUpdate + func (cu *CommentUpdate) Exec(ctx context.Context) error + func (cu *CommentUpdate) ExecX(ctx context.Context) + func (cu *CommentUpdate) Mutation() *CommentMutation + func (cu *CommentUpdate) Save(ctx context.Context) (int, error) + func (cu *CommentUpdate) SaveX(ctx context.Context) int + func (cu *CommentUpdate) SetPost(p *Post) *CommentUpdate + func (cu *CommentUpdate) SetPostID(i int) *CommentUpdate + func (cu *CommentUpdate) SetText(s string) *CommentUpdate + func (cu *CommentUpdate) Where(ps ...predicate.Comment) *CommentUpdate + type CommentUpdateOne struct + func (cuo *CommentUpdateOne) ClearPost() *CommentUpdateOne + func (cuo *CommentUpdateOne) Exec(ctx context.Context) error + func (cuo *CommentUpdateOne) ExecX(ctx context.Context) + func (cuo *CommentUpdateOne) Mutation() *CommentMutation + func (cuo *CommentUpdateOne) Save(ctx context.Context) (*Comment, error) + func (cuo *CommentUpdateOne) SaveX(ctx context.Context) *Comment + func (cuo *CommentUpdateOne) Select(field string, fields ...string) *CommentUpdateOne + func (cuo *CommentUpdateOne) SetPost(p *Post) *CommentUpdateOne + func (cuo *CommentUpdateOne) SetPostID(i int) *CommentUpdateOne + func (cuo *CommentUpdateOne) SetText(s string) *CommentUpdateOne + type Comments []*Comment + type CommitFunc func(context.Context, *Tx) error + func (f CommitFunc) Commit(ctx context.Context, tx *Tx) error + type CommitHook func(Committer) Committer + type Committer interface + Commit func(context.Context, *Tx) error + type ConstraintError struct + func (e *ConstraintError) Unwrap() error + func (e ConstraintError) Error() string + type Hook = ent.Hook + type MutateFunc = ent.MutateFunc + type Mutation = ent.Mutation + type Mutator = ent.Mutator + type NotFoundError struct + func (e *NotFoundError) Error() string + type NotLoadedError struct + func (e *NotLoadedError) Error() string + type NotSingularError struct + func (e *NotSingularError) Error() string + type Op = ent.Op + type Option func(*config) + func Debug() Option + func Driver(driver dialect.Driver) Option + func Log(fn func(...interface{})) Option + type OrderFunc func(*sql.Selector) + func Asc(fields ...string) OrderFunc + func Desc(fields ...string) OrderFunc + type Policy = ent.Policy + type Post struct + AuthorID int + Edges PostEdges + ID int + Text string + func (po *Post) QueryAuthor() *UserQuery + func (po *Post) QueryComments() *CommentQuery + func (po *Post) String() string + func (po *Post) Unwrap() *Post + func (po *Post) Update() *PostUpdateOne + type PostClient struct + func NewPostClient(c config) *PostClient + func (c *PostClient) Create() *PostCreate + func (c *PostClient) CreateBulk(builders ...*PostCreate) *PostCreateBulk + func (c *PostClient) Delete() *PostDelete + func (c *PostClient) DeleteOne(po *Post) *PostDeleteOne + func (c *PostClient) DeleteOneID(id int) *PostDeleteOne + func (c *PostClient) Get(ctx context.Context, id int) (*Post, error) + func (c *PostClient) GetX(ctx context.Context, id int) *Post + func (c *PostClient) Hooks() []Hook + func (c *PostClient) Query() *PostQuery + func (c *PostClient) QueryAuthor(po *Post) *UserQuery + func (c *PostClient) QueryComments(po *Post) *CommentQuery + func (c *PostClient) Update() *PostUpdate + func (c *PostClient) UpdateOne(po *Post) *PostUpdateOne + func (c *PostClient) UpdateOneID(id int) *PostUpdateOne + func (c *PostClient) Use(hooks ...Hook) + type PostCreate struct + func (pc *PostCreate) AddCommentIDs(ids ...int) *PostCreate + func (pc *PostCreate) AddComments(c ...*Comment) *PostCreate + func (pc *PostCreate) Exec(ctx context.Context) error + func (pc *PostCreate) ExecX(ctx context.Context) + func (pc *PostCreate) Mutation() *PostMutation + func (pc *PostCreate) Save(ctx context.Context) (*Post, error) + func (pc *PostCreate) SaveX(ctx context.Context) *Post + func (pc *PostCreate) SetAuthor(u *User) *PostCreate + func (pc *PostCreate) SetAuthorID(i int) *PostCreate + func (pc *PostCreate) SetNillableAuthorID(i *int) *PostCreate + func (pc *PostCreate) SetNillableText(s *string) *PostCreate + func (pc *PostCreate) SetText(s string) *PostCreate + type PostCreateBulk struct + func (pcb *PostCreateBulk) Exec(ctx context.Context) error + func (pcb *PostCreateBulk) ExecX(ctx context.Context) + func (pcb *PostCreateBulk) Save(ctx context.Context) ([]*Post, error) + func (pcb *PostCreateBulk) SaveX(ctx context.Context) []*Post + type PostDelete struct + func (pd *PostDelete) Exec(ctx context.Context) (int, error) + func (pd *PostDelete) ExecX(ctx context.Context) int + func (pd *PostDelete) Where(ps ...predicate.Post) *PostDelete + type PostDeleteOne struct + func (pdo *PostDeleteOne) Exec(ctx context.Context) error + func (pdo *PostDeleteOne) ExecX(ctx context.Context) + type PostEdges struct + Author *User + Comments []*Comment + func (e PostEdges) AuthorOrErr() (*User, error) + func (e PostEdges) CommentsOrErr() ([]*Comment, error) + type PostGroupBy struct + func (pgb *PostGroupBy) Aggregate(fns ...AggregateFunc) *PostGroupBy + func (pgb *PostGroupBy) Bool(ctx context.Context) (_ bool, err error) + func (pgb *PostGroupBy) BoolX(ctx context.Context) bool + func (pgb *PostGroupBy) Bools(ctx context.Context) ([]bool, error) + func (pgb *PostGroupBy) BoolsX(ctx context.Context) []bool + func (pgb *PostGroupBy) Float64(ctx context.Context) (_ float64, err error) + func (pgb *PostGroupBy) Float64X(ctx context.Context) float64 + func (pgb *PostGroupBy) Float64s(ctx context.Context) ([]float64, error) + func (pgb *PostGroupBy) Float64sX(ctx context.Context) []float64 + func (pgb *PostGroupBy) Int(ctx context.Context) (_ int, err error) + func (pgb *PostGroupBy) IntX(ctx context.Context) int + func (pgb *PostGroupBy) Ints(ctx context.Context) ([]int, error) + func (pgb *PostGroupBy) IntsX(ctx context.Context) []int + func (pgb *PostGroupBy) Scan(ctx context.Context, v interface{}) error + func (pgb *PostGroupBy) ScanX(ctx context.Context, v interface{}) + func (pgb *PostGroupBy) String(ctx context.Context) (_ string, err error) + func (pgb *PostGroupBy) StringX(ctx context.Context) string + func (pgb *PostGroupBy) Strings(ctx context.Context) ([]string, error) + func (pgb *PostGroupBy) StringsX(ctx context.Context) []string + type PostMutation struct + func (m *PostMutation) AddCommentIDs(ids ...int) + func (m *PostMutation) AddField(name string, value ent.Value) error + func (m *PostMutation) AddedEdges() []string + func (m *PostMutation) AddedField(name string) (ent.Value, bool) + func (m *PostMutation) AddedFields() []string + func (m *PostMutation) AddedIDs(name string) []ent.Value + func (m *PostMutation) AuthorCleared() bool + func (m *PostMutation) AuthorID() (r int, exists bool) + func (m *PostMutation) AuthorIDCleared() bool + func (m *PostMutation) AuthorIDs() (ids []int) + func (m *PostMutation) ClearAuthor() + func (m *PostMutation) ClearAuthorID() + func (m *PostMutation) ClearComments() + func (m *PostMutation) ClearEdge(name string) error + func (m *PostMutation) ClearField(name string) error + func (m *PostMutation) ClearedEdges() []string + func (m *PostMutation) ClearedFields() []string + func (m *PostMutation) CommentsCleared() bool + func (m *PostMutation) CommentsIDs() (ids []int) + func (m *PostMutation) EdgeCleared(name string) bool + func (m *PostMutation) Field(name string) (ent.Value, bool) + func (m *PostMutation) FieldCleared(name string) bool + func (m *PostMutation) Fields() []string + func (m *PostMutation) ID() (id int, exists bool) + func (m *PostMutation) IDs(ctx context.Context) ([]int, error) + func (m *PostMutation) OldAuthorID(ctx context.Context) (v int, err error) + func (m *PostMutation) OldField(ctx context.Context, name string) (ent.Value, error) + func (m *PostMutation) OldText(ctx context.Context) (v string, err error) + func (m *PostMutation) Op() Op + func (m *PostMutation) RemoveCommentIDs(ids ...int) + func (m *PostMutation) RemovedCommentsIDs() (ids []int) + func (m *PostMutation) RemovedEdges() []string + func (m *PostMutation) RemovedIDs(name string) []ent.Value + func (m *PostMutation) ResetAuthor() + func (m *PostMutation) ResetAuthorID() + func (m *PostMutation) ResetComments() + func (m *PostMutation) ResetEdge(name string) error + func (m *PostMutation) ResetField(name string) error + func (m *PostMutation) ResetText() + func (m *PostMutation) SetAuthorID(i int) + func (m *PostMutation) SetField(name string, value ent.Value) error + func (m *PostMutation) SetText(s string) + func (m *PostMutation) Text() (r string, exists bool) + func (m *PostMutation) Type() string + func (m *PostMutation) Where(ps ...predicate.Post) + func (m PostMutation) Client() *Client + func (m PostMutation) Tx() (*Tx, error) + type PostQuery struct + func (pq *PostQuery) All(ctx context.Context) ([]*Post, error) + func (pq *PostQuery) AllX(ctx context.Context) []*Post + func (pq *PostQuery) Clone() *PostQuery + func (pq *PostQuery) Count(ctx context.Context) (int, error) + func (pq *PostQuery) CountX(ctx context.Context) int + func (pq *PostQuery) Exist(ctx context.Context) (bool, error) + func (pq *PostQuery) ExistX(ctx context.Context) bool + func (pq *PostQuery) First(ctx context.Context) (*Post, error) + func (pq *PostQuery) FirstID(ctx context.Context) (id int, err error) + func (pq *PostQuery) FirstIDX(ctx context.Context) int + func (pq *PostQuery) FirstX(ctx context.Context) *Post + func (pq *PostQuery) GroupBy(field string, fields ...string) *PostGroupBy + func (pq *PostQuery) IDs(ctx context.Context) ([]int, error) + func (pq *PostQuery) IDsX(ctx context.Context) []int + func (pq *PostQuery) Limit(limit int) *PostQuery + func (pq *PostQuery) Offset(offset int) *PostQuery + func (pq *PostQuery) Only(ctx context.Context) (*Post, error) + func (pq *PostQuery) OnlyID(ctx context.Context) (id int, err error) + func (pq *PostQuery) OnlyIDX(ctx context.Context) int + func (pq *PostQuery) OnlyX(ctx context.Context) *Post + func (pq *PostQuery) Order(o ...OrderFunc) *PostQuery + func (pq *PostQuery) QueryAuthor() *UserQuery + func (pq *PostQuery) QueryComments() *CommentQuery + func (pq *PostQuery) Select(fields ...string) *PostSelect + func (pq *PostQuery) Unique(unique bool) *PostQuery + func (pq *PostQuery) Where(ps ...predicate.Post) *PostQuery + func (pq *PostQuery) WithAuthor(opts ...func(*UserQuery)) *PostQuery + func (pq *PostQuery) WithComments(opts ...func(*CommentQuery)) *PostQuery + type PostSelect struct + func (ps *PostSelect) Bool(ctx context.Context) (_ bool, err error) + func (ps *PostSelect) BoolX(ctx context.Context) bool + func (ps *PostSelect) Bools(ctx context.Context) ([]bool, error) + func (ps *PostSelect) BoolsX(ctx context.Context) []bool + func (ps *PostSelect) Float64(ctx context.Context) (_ float64, err error) + func (ps *PostSelect) Float64X(ctx context.Context) float64 + func (ps *PostSelect) Float64s(ctx context.Context) ([]float64, error) + func (ps *PostSelect) Float64sX(ctx context.Context) []float64 + func (ps *PostSelect) Int(ctx context.Context) (_ int, err error) + func (ps *PostSelect) IntX(ctx context.Context) int + func (ps *PostSelect) Ints(ctx context.Context) ([]int, error) + func (ps *PostSelect) IntsX(ctx context.Context) []int + func (ps *PostSelect) Scan(ctx context.Context, v interface{}) error + func (ps *PostSelect) ScanX(ctx context.Context, v interface{}) + func (ps *PostSelect) String(ctx context.Context) (_ string, err error) + func (ps *PostSelect) StringX(ctx context.Context) string + func (ps *PostSelect) Strings(ctx context.Context) ([]string, error) + func (ps *PostSelect) StringsX(ctx context.Context) []string + type PostUpdate struct + func (pu *PostUpdate) AddCommentIDs(ids ...int) *PostUpdate + func (pu *PostUpdate) AddComments(c ...*Comment) *PostUpdate + func (pu *PostUpdate) ClearAuthor() *PostUpdate + func (pu *PostUpdate) ClearAuthorID() *PostUpdate + func (pu *PostUpdate) ClearComments() *PostUpdate + func (pu *PostUpdate) Exec(ctx context.Context) error + func (pu *PostUpdate) ExecX(ctx context.Context) + func (pu *PostUpdate) Mutation() *PostMutation + func (pu *PostUpdate) RemoveCommentIDs(ids ...int) *PostUpdate + func (pu *PostUpdate) RemoveComments(c ...*Comment) *PostUpdate + func (pu *PostUpdate) Save(ctx context.Context) (int, error) + func (pu *PostUpdate) SaveX(ctx context.Context) int + func (pu *PostUpdate) SetAuthor(u *User) *PostUpdate + func (pu *PostUpdate) SetAuthorID(i int) *PostUpdate + func (pu *PostUpdate) SetNillableAuthorID(i *int) *PostUpdate + func (pu *PostUpdate) SetNillableText(s *string) *PostUpdate + func (pu *PostUpdate) SetText(s string) *PostUpdate + func (pu *PostUpdate) Where(ps ...predicate.Post) *PostUpdate + type PostUpdateOne struct + func (puo *PostUpdateOne) AddCommentIDs(ids ...int) *PostUpdateOne + func (puo *PostUpdateOne) AddComments(c ...*Comment) *PostUpdateOne + func (puo *PostUpdateOne) ClearAuthor() *PostUpdateOne + func (puo *PostUpdateOne) ClearAuthorID() *PostUpdateOne + func (puo *PostUpdateOne) ClearComments() *PostUpdateOne + func (puo *PostUpdateOne) Exec(ctx context.Context) error + func (puo *PostUpdateOne) ExecX(ctx context.Context) + func (puo *PostUpdateOne) Mutation() *PostMutation + func (puo *PostUpdateOne) RemoveCommentIDs(ids ...int) *PostUpdateOne + func (puo *PostUpdateOne) RemoveComments(c ...*Comment) *PostUpdateOne + func (puo *PostUpdateOne) Save(ctx context.Context) (*Post, error) + func (puo *PostUpdateOne) SaveX(ctx context.Context) *Post + func (puo *PostUpdateOne) Select(field string, fields ...string) *PostUpdateOne + func (puo *PostUpdateOne) SetAuthor(u *User) *PostUpdateOne + func (puo *PostUpdateOne) SetAuthorID(i int) *PostUpdateOne + func (puo *PostUpdateOne) SetNillableAuthorID(i *int) *PostUpdateOne + func (puo *PostUpdateOne) SetNillableText(s *string) *PostUpdateOne + func (puo *PostUpdateOne) SetText(s string) *PostUpdateOne + type Posts []*Post + type Query = ent.Query + type RollbackFunc func(context.Context, *Tx) error + func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error + type RollbackHook func(Rollbacker) Rollbacker + type Rollbacker interface + Rollback func(context.Context, *Tx) error + type Tx struct + Comment *CommentClient + Post *PostClient + User *UserClient + func TxFromContext(ctx context.Context) *Tx + func (tx *Tx) Client() *Client + func (tx *Tx) Commit() error + func (tx *Tx) OnCommit(f CommitHook) + func (tx *Tx) OnRollback(f RollbackHook) + func (tx *Tx) Rollback() error + type User struct + Edges UserEdges + ID int + Name string + func (u *User) QueryPosts() *PostQuery + func (u *User) String() string + func (u *User) Unwrap() *User + func (u *User) Update() *UserUpdateOne + type UserClient struct + func NewUserClient(c config) *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) QueryPosts(u *User) *PostQuery + 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 struct + func (uc *UserCreate) AddPostIDs(ids ...int) *UserCreate + func (uc *UserCreate) AddPosts(p ...*Post) *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) SetName(s string) *UserCreate + func (uc *UserCreate) SetNillableName(s *string) *UserCreate + type UserCreateBulk struct + func (ucb *UserCreateBulk) Exec(ctx context.Context) error + func (ucb *UserCreateBulk) ExecX(ctx context.Context) + func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error) + func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User + type UserDelete struct + func (ud *UserDelete) Exec(ctx context.Context) (int, error) + func (ud *UserDelete) ExecX(ctx context.Context) int + func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete + type UserDeleteOne struct + func (udo *UserDeleteOne) Exec(ctx context.Context) error + func (udo *UserDeleteOne) ExecX(ctx context.Context) + type UserEdges struct + Posts []*Post + func (e UserEdges) PostsOrErr() ([]*Post, error) + type UserGroupBy struct + func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy + func (ugb *UserGroupBy) Bool(ctx context.Context) (_ bool, err error) + func (ugb *UserGroupBy) BoolX(ctx context.Context) bool + func (ugb *UserGroupBy) Bools(ctx context.Context) ([]bool, error) + func (ugb *UserGroupBy) BoolsX(ctx context.Context) []bool + func (ugb *UserGroupBy) Float64(ctx context.Context) (_ float64, err error) + func (ugb *UserGroupBy) Float64X(ctx context.Context) float64 + func (ugb *UserGroupBy) Float64s(ctx context.Context) ([]float64, error) + func (ugb *UserGroupBy) Float64sX(ctx context.Context) []float64 + func (ugb *UserGroupBy) Int(ctx context.Context) (_ int, err error) + func (ugb *UserGroupBy) IntX(ctx context.Context) int + func (ugb *UserGroupBy) Ints(ctx context.Context) ([]int, error) + func (ugb *UserGroupBy) IntsX(ctx context.Context) []int + func (ugb *UserGroupBy) Scan(ctx context.Context, v interface{}) error + func (ugb *UserGroupBy) ScanX(ctx context.Context, v interface{}) + func (ugb *UserGroupBy) String(ctx context.Context) (_ string, err error) + func (ugb *UserGroupBy) StringX(ctx context.Context) string + func (ugb *UserGroupBy) Strings(ctx context.Context) ([]string, error) + func (ugb *UserGroupBy) StringsX(ctx context.Context) []string + type UserMutation struct + func (m *UserMutation) AddField(name string, value ent.Value) error + func (m *UserMutation) AddPostIDs(ids ...int) + 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) ClearEdge(name string) error + func (m *UserMutation) ClearField(name string) error + func (m *UserMutation) ClearPosts() + func (m *UserMutation) ClearedEdges() []string + func (m *UserMutation) ClearedFields() []string + 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) Name() (r string, exists bool) + func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error) + func (m *UserMutation) OldName(ctx context.Context) (v string, err error) + func (m *UserMutation) Op() Op + func (m *UserMutation) PostsCleared() bool + func (m *UserMutation) PostsIDs() (ids []int) + func (m *UserMutation) RemovePostIDs(ids ...int) + func (m *UserMutation) RemovedEdges() []string + func (m *UserMutation) RemovedIDs(name string) []ent.Value + func (m *UserMutation) RemovedPostsIDs() (ids []int) + func (m *UserMutation) ResetEdge(name string) error + func (m *UserMutation) ResetField(name string) error + func (m *UserMutation) ResetName() + func (m *UserMutation) ResetPosts() + func (m *UserMutation) SetField(name string, value ent.Value) error + func (m *UserMutation) SetName(s string) + func (m *UserMutation) Type() string + func (m *UserMutation) Where(ps ...predicate.User) + func (m UserMutation) Client() *Client + func (m UserMutation) Tx() (*Tx, error) + type UserQuery struct + func (uq *UserQuery) All(ctx context.Context) ([]*User, error) + func (uq *UserQuery) AllX(ctx context.Context) []*User + func (uq *UserQuery) Clone() *UserQuery + 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 (uq *UserQuery) QueryPosts() *PostQuery + func (uq *UserQuery) Select(fields ...string) *UserSelect + func (uq *UserQuery) Unique(unique bool) *UserQuery + func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery + func (uq *UserQuery) WithPosts(opts ...func(*PostQuery)) *UserQuery + type UserSelect struct + func (us *UserSelect) Bool(ctx context.Context) (_ bool, err error) + func (us *UserSelect) BoolX(ctx context.Context) bool + func (us *UserSelect) Bools(ctx context.Context) ([]bool, error) + func (us *UserSelect) BoolsX(ctx context.Context) []bool + func (us *UserSelect) Float64(ctx context.Context) (_ float64, err error) + func (us *UserSelect) Float64X(ctx context.Context) float64 + func (us *UserSelect) Float64s(ctx context.Context) ([]float64, error) + func (us *UserSelect) Float64sX(ctx context.Context) []float64 + func (us *UserSelect) Int(ctx context.Context) (_ int, err error) + func (us *UserSelect) IntX(ctx context.Context) int + func (us *UserSelect) Ints(ctx context.Context) ([]int, error) + func (us *UserSelect) IntsX(ctx context.Context) []int + func (us *UserSelect) Scan(ctx context.Context, v interface{}) error + func (us *UserSelect) ScanX(ctx context.Context, v interface{}) + func (us *UserSelect) String(ctx context.Context) (_ string, err error) + func (us *UserSelect) StringX(ctx context.Context) string + func (us *UserSelect) Strings(ctx context.Context) ([]string, error) + func (us *UserSelect) StringsX(ctx context.Context) []string + type UserUpdate struct + func (uu *UserUpdate) AddPostIDs(ids ...int) *UserUpdate + func (uu *UserUpdate) AddPosts(p ...*Post) *UserUpdate + func (uu *UserUpdate) ClearPosts() *UserUpdate + func (uu *UserUpdate) Exec(ctx context.Context) error + func (uu *UserUpdate) ExecX(ctx context.Context) + func (uu *UserUpdate) Mutation() *UserMutation + func (uu *UserUpdate) RemovePostIDs(ids ...int) *UserUpdate + func (uu *UserUpdate) RemovePosts(p ...*Post) *UserUpdate + func (uu *UserUpdate) Save(ctx context.Context) (int, error) + func (uu *UserUpdate) SaveX(ctx context.Context) int + func (uu *UserUpdate) SetName(s string) *UserUpdate + func (uu *UserUpdate) SetNillableName(s *string) *UserUpdate + func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate + type UserUpdateOne struct + func (uuo *UserUpdateOne) AddPostIDs(ids ...int) *UserUpdateOne + func (uuo *UserUpdateOne) AddPosts(p ...*Post) *UserUpdateOne + func (uuo *UserUpdateOne) ClearPosts() *UserUpdateOne + func (uuo *UserUpdateOne) Exec(ctx context.Context) error + func (uuo *UserUpdateOne) ExecX(ctx context.Context) + func (uuo *UserUpdateOne) Mutation() *UserMutation + func (uuo *UserUpdateOne) RemovePostIDs(ids ...int) *UserUpdateOne + func (uuo *UserUpdateOne) RemovePosts(p ...*Post) *UserUpdateOne + 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) SetName(s string) *UserUpdateOne + func (uuo *UserUpdateOne) SetNillableName(s *string) *UserUpdateOne + type Users []*User + type ValidationError struct + Name string + func (e *ValidationError) Error() string + func (e *ValidationError) Unwrap() error + type Value = ent.Value