Documentation ¶
Index ¶
- Constants
- Variables
- func Asc(fields ...string) func(*sql.Selector)
- func Desc(fields ...string) func(*sql.Selector)
- 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
- type Chapter
- type ChapterClient
- func (c *ChapterClient) Create() *ChapterCreate
- func (c *ChapterClient) CreateBulk(builders ...*ChapterCreate) *ChapterCreateBulk
- func (c *ChapterClient) Delete() *ChapterDelete
- func (c *ChapterClient) DeleteOne(ch *Chapter) *ChapterDeleteOne
- func (c *ChapterClient) DeleteOneID(id int) *ChapterDeleteOne
- func (c *ChapterClient) Get(ctx context.Context, id int) (*Chapter, error)
- func (c *ChapterClient) GetX(ctx context.Context, id int) *Chapter
- func (c *ChapterClient) Hooks() []Hook
- func (c *ChapterClient) Intercept(interceptors ...Interceptor)
- func (c *ChapterClient) Interceptors() []Interceptor
- func (c *ChapterClient) MapCreateBulk(slice any, setFunc func(*ChapterCreate, int)) *ChapterCreateBulk
- func (c *ChapterClient) Query() *ChapterQuery
- func (c *ChapterClient) QueryManga(ch *Chapter) *MangaQuery
- func (c *ChapterClient) Update() *ChapterUpdate
- func (c *ChapterClient) UpdateOne(ch *Chapter) *ChapterUpdateOne
- func (c *ChapterClient) UpdateOneID(id int) *ChapterUpdateOne
- func (c *ChapterClient) Use(hooks ...Hook)
- type ChapterCreate
- func (cc *ChapterCreate) Exec(ctx context.Context) error
- func (cc *ChapterCreate) ExecX(ctx context.Context)
- func (cc *ChapterCreate) Mutation() *ChapterMutation
- func (cc *ChapterCreate) Save(ctx context.Context) (*Chapter, error)
- func (cc *ChapterCreate) SaveX(ctx context.Context) *Chapter
- func (cc *ChapterCreate) SetChapterID(s string) *ChapterCreate
- func (cc *ChapterCreate) SetCreatedOn(t time.Time) *ChapterCreate
- func (cc *ChapterCreate) SetManga(m *Manga) *ChapterCreate
- func (cc *ChapterCreate) SetMangaID(id int) *ChapterCreate
- func (cc *ChapterCreate) SetNillableCreatedOn(t *time.Time) *ChapterCreate
- func (cc *ChapterCreate) SetNillableMangaID(id *int) *ChapterCreate
- func (cc *ChapterCreate) SetNillableTitle(s *string) *ChapterCreate
- func (cc *ChapterCreate) SetNum(s string) *ChapterCreate
- func (cc *ChapterCreate) SetRegisteredOn(t time.Time) *ChapterCreate
- func (cc *ChapterCreate) SetTitle(s string) *ChapterCreate
- type ChapterCreateBulk
- type ChapterDelete
- type ChapterDeleteOne
- type ChapterEdges
- type ChapterGroupBy
- func (cgb *ChapterGroupBy) Aggregate(fns ...AggregateFunc) *ChapterGroupBy
- func (s *ChapterGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *ChapterGroupBy) BoolX(ctx context.Context) bool
- func (s *ChapterGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *ChapterGroupBy) BoolsX(ctx context.Context) []bool
- func (s *ChapterGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *ChapterGroupBy) Float64X(ctx context.Context) float64
- func (s *ChapterGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *ChapterGroupBy) Float64sX(ctx context.Context) []float64
- func (s *ChapterGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *ChapterGroupBy) IntX(ctx context.Context) int
- func (s *ChapterGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *ChapterGroupBy) IntsX(ctx context.Context) []int
- func (cgb *ChapterGroupBy) Scan(ctx context.Context, v any) error
- func (s *ChapterGroupBy) ScanX(ctx context.Context, v any)
- func (s *ChapterGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *ChapterGroupBy) StringX(ctx context.Context) string
- func (s *ChapterGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *ChapterGroupBy) StringsX(ctx context.Context) []string
- type ChapterMutation
- func (m *ChapterMutation) AddField(name string, value ent.Value) error
- func (m *ChapterMutation) AddedEdges() []string
- func (m *ChapterMutation) AddedField(name string) (ent.Value, bool)
- func (m *ChapterMutation) AddedFields() []string
- func (m *ChapterMutation) AddedIDs(name string) []ent.Value
- func (m *ChapterMutation) ChapterID() (r string, exists bool)
- func (m *ChapterMutation) ClearCreatedOn()
- func (m *ChapterMutation) ClearEdge(name string) error
- func (m *ChapterMutation) ClearField(name string) error
- func (m *ChapterMutation) ClearManga()
- func (m *ChapterMutation) ClearTitle()
- func (m *ChapterMutation) ClearedEdges() []string
- func (m *ChapterMutation) ClearedFields() []string
- func (m ChapterMutation) Client() *Client
- func (m *ChapterMutation) CreatedOn() (r time.Time, exists bool)
- func (m *ChapterMutation) CreatedOnCleared() bool
- func (m *ChapterMutation) EdgeCleared(name string) bool
- func (m *ChapterMutation) Field(name string) (ent.Value, bool)
- func (m *ChapterMutation) FieldCleared(name string) bool
- func (m *ChapterMutation) Fields() []string
- func (m *ChapterMutation) ID() (id int, exists bool)
- func (m *ChapterMutation) IDs(ctx context.Context) ([]int, error)
- func (m *ChapterMutation) MangaCleared() bool
- func (m *ChapterMutation) MangaID() (id int, exists bool)
- func (m *ChapterMutation) MangaIDs() (ids []int)
- func (m *ChapterMutation) Num() (r string, exists bool)
- func (m *ChapterMutation) OldChapterID(ctx context.Context) (v string, err error)
- func (m *ChapterMutation) OldCreatedOn(ctx context.Context) (v time.Time, err error)
- func (m *ChapterMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ChapterMutation) OldNum(ctx context.Context) (v string, err error)
- func (m *ChapterMutation) OldRegisteredOn(ctx context.Context) (v time.Time, err error)
- func (m *ChapterMutation) OldTitle(ctx context.Context) (v string, err error)
- func (m *ChapterMutation) Op() Op
- func (m *ChapterMutation) RegisteredOn() (r time.Time, exists bool)
- func (m *ChapterMutation) RemovedEdges() []string
- func (m *ChapterMutation) RemovedIDs(name string) []ent.Value
- func (m *ChapterMutation) ResetChapterID()
- func (m *ChapterMutation) ResetCreatedOn()
- func (m *ChapterMutation) ResetEdge(name string) error
- func (m *ChapterMutation) ResetField(name string) error
- func (m *ChapterMutation) ResetManga()
- func (m *ChapterMutation) ResetNum()
- func (m *ChapterMutation) ResetRegisteredOn()
- func (m *ChapterMutation) ResetTitle()
- func (m *ChapterMutation) SetChapterID(s string)
- func (m *ChapterMutation) SetCreatedOn(t time.Time)
- func (m *ChapterMutation) SetField(name string, value ent.Value) error
- func (m *ChapterMutation) SetMangaID(id int)
- func (m *ChapterMutation) SetNum(s string)
- func (m *ChapterMutation) SetOp(op Op)
- func (m *ChapterMutation) SetRegisteredOn(t time.Time)
- func (m *ChapterMutation) SetTitle(s string)
- func (m *ChapterMutation) Title() (r string, exists bool)
- func (m *ChapterMutation) TitleCleared() bool
- func (m ChapterMutation) Tx() (*Tx, error)
- func (m *ChapterMutation) Type() string
- func (m *ChapterMutation) Where(ps ...predicate.Chapter)
- func (m *ChapterMutation) WhereP(ps ...func(*sql.Selector))
- type ChapterQuery
- func (cq *ChapterQuery) Aggregate(fns ...AggregateFunc) *ChapterSelect
- func (cq *ChapterQuery) All(ctx context.Context) ([]*Chapter, error)
- func (cq *ChapterQuery) AllX(ctx context.Context) []*Chapter
- func (cq *ChapterQuery) Clone() *ChapterQuery
- func (cq *ChapterQuery) Count(ctx context.Context) (int, error)
- func (cq *ChapterQuery) CountX(ctx context.Context) int
- func (cq *ChapterQuery) Exist(ctx context.Context) (bool, error)
- func (cq *ChapterQuery) ExistX(ctx context.Context) bool
- func (cq *ChapterQuery) First(ctx context.Context) (*Chapter, error)
- func (cq *ChapterQuery) FirstID(ctx context.Context) (id int, err error)
- func (cq *ChapterQuery) FirstIDX(ctx context.Context) int
- func (cq *ChapterQuery) FirstX(ctx context.Context) *Chapter
- func (cq *ChapterQuery) GroupBy(field string, fields ...string) *ChapterGroupBy
- func (cq *ChapterQuery) IDs(ctx context.Context) (ids []int, err error)
- func (cq *ChapterQuery) IDsX(ctx context.Context) []int
- func (cq *ChapterQuery) Limit(limit int) *ChapterQuery
- func (cq *ChapterQuery) Offset(offset int) *ChapterQuery
- func (cq *ChapterQuery) Only(ctx context.Context) (*Chapter, error)
- func (cq *ChapterQuery) OnlyID(ctx context.Context) (id int, err error)
- func (cq *ChapterQuery) OnlyIDX(ctx context.Context) int
- func (cq *ChapterQuery) OnlyX(ctx context.Context) *Chapter
- func (cq *ChapterQuery) Order(o ...chapter.OrderOption) *ChapterQuery
- func (cq *ChapterQuery) QueryManga() *MangaQuery
- func (cq *ChapterQuery) Select(fields ...string) *ChapterSelect
- func (cq *ChapterQuery) Unique(unique bool) *ChapterQuery
- func (cq *ChapterQuery) Where(ps ...predicate.Chapter) *ChapterQuery
- func (cq *ChapterQuery) WithManga(opts ...func(*MangaQuery)) *ChapterQuery
- type ChapterSelect
- func (cs *ChapterSelect) Aggregate(fns ...AggregateFunc) *ChapterSelect
- func (s *ChapterSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *ChapterSelect) BoolX(ctx context.Context) bool
- func (s *ChapterSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *ChapterSelect) BoolsX(ctx context.Context) []bool
- func (s *ChapterSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *ChapterSelect) Float64X(ctx context.Context) float64
- func (s *ChapterSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *ChapterSelect) Float64sX(ctx context.Context) []float64
- func (s *ChapterSelect) Int(ctx context.Context) (_ int, err error)
- func (s *ChapterSelect) IntX(ctx context.Context) int
- func (s *ChapterSelect) Ints(ctx context.Context) ([]int, error)
- func (s *ChapterSelect) IntsX(ctx context.Context) []int
- func (cs *ChapterSelect) Scan(ctx context.Context, v any) error
- func (s *ChapterSelect) ScanX(ctx context.Context, v any)
- func (s *ChapterSelect) String(ctx context.Context) (_ string, err error)
- func (s *ChapterSelect) StringX(ctx context.Context) string
- func (s *ChapterSelect) Strings(ctx context.Context) ([]string, error)
- func (s *ChapterSelect) StringsX(ctx context.Context) []string
- type ChapterUpdate
- func (cu *ChapterUpdate) ClearCreatedOn() *ChapterUpdate
- func (cu *ChapterUpdate) ClearManga() *ChapterUpdate
- func (cu *ChapterUpdate) ClearTitle() *ChapterUpdate
- func (cu *ChapterUpdate) Exec(ctx context.Context) error
- func (cu *ChapterUpdate) ExecX(ctx context.Context)
- func (cu *ChapterUpdate) Mutation() *ChapterMutation
- func (cu *ChapterUpdate) Save(ctx context.Context) (int, error)
- func (cu *ChapterUpdate) SaveX(ctx context.Context) int
- func (cu *ChapterUpdate) SetChapterID(s string) *ChapterUpdate
- func (cu *ChapterUpdate) SetCreatedOn(t time.Time) *ChapterUpdate
- func (cu *ChapterUpdate) SetManga(m *Manga) *ChapterUpdate
- func (cu *ChapterUpdate) SetMangaID(id int) *ChapterUpdate
- func (cu *ChapterUpdate) SetNillableChapterID(s *string) *ChapterUpdate
- func (cu *ChapterUpdate) SetNillableCreatedOn(t *time.Time) *ChapterUpdate
- func (cu *ChapterUpdate) SetNillableMangaID(id *int) *ChapterUpdate
- func (cu *ChapterUpdate) SetNillableNum(s *string) *ChapterUpdate
- func (cu *ChapterUpdate) SetNillableRegisteredOn(t *time.Time) *ChapterUpdate
- func (cu *ChapterUpdate) SetNillableTitle(s *string) *ChapterUpdate
- func (cu *ChapterUpdate) SetNum(s string) *ChapterUpdate
- func (cu *ChapterUpdate) SetRegisteredOn(t time.Time) *ChapterUpdate
- func (cu *ChapterUpdate) SetTitle(s string) *ChapterUpdate
- func (cu *ChapterUpdate) Where(ps ...predicate.Chapter) *ChapterUpdate
- type ChapterUpdateOne
- func (cuo *ChapterUpdateOne) ClearCreatedOn() *ChapterUpdateOne
- func (cuo *ChapterUpdateOne) ClearManga() *ChapterUpdateOne
- func (cuo *ChapterUpdateOne) ClearTitle() *ChapterUpdateOne
- func (cuo *ChapterUpdateOne) Exec(ctx context.Context) error
- func (cuo *ChapterUpdateOne) ExecX(ctx context.Context)
- func (cuo *ChapterUpdateOne) Mutation() *ChapterMutation
- func (cuo *ChapterUpdateOne) Save(ctx context.Context) (*Chapter, error)
- func (cuo *ChapterUpdateOne) SaveX(ctx context.Context) *Chapter
- func (cuo *ChapterUpdateOne) Select(field string, fields ...string) *ChapterUpdateOne
- func (cuo *ChapterUpdateOne) SetChapterID(s string) *ChapterUpdateOne
- func (cuo *ChapterUpdateOne) SetCreatedOn(t time.Time) *ChapterUpdateOne
- func (cuo *ChapterUpdateOne) SetManga(m *Manga) *ChapterUpdateOne
- func (cuo *ChapterUpdateOne) SetMangaID(id int) *ChapterUpdateOne
- func (cuo *ChapterUpdateOne) SetNillableChapterID(s *string) *ChapterUpdateOne
- func (cuo *ChapterUpdateOne) SetNillableCreatedOn(t *time.Time) *ChapterUpdateOne
- func (cuo *ChapterUpdateOne) SetNillableMangaID(id *int) *ChapterUpdateOne
- func (cuo *ChapterUpdateOne) SetNillableNum(s *string) *ChapterUpdateOne
- func (cuo *ChapterUpdateOne) SetNillableRegisteredOn(t *time.Time) *ChapterUpdateOne
- func (cuo *ChapterUpdateOne) SetNillableTitle(s *string) *ChapterUpdateOne
- func (cuo *ChapterUpdateOne) SetNum(s string) *ChapterUpdateOne
- func (cuo *ChapterUpdateOne) SetRegisteredOn(t time.Time) *ChapterUpdateOne
- func (cuo *ChapterUpdateOne) SetTitle(s string) *ChapterUpdateOne
- func (cuo *ChapterUpdateOne) Where(ps ...predicate.Chapter) *ChapterUpdateOne
- type Chapters
- 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) Intercept(interceptors ...Interceptor)
- func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, 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 Hook
- type InterceptFunc
- type Interceptor
- type Manga
- type MangaClient
- func (c *MangaClient) Create() *MangaCreate
- func (c *MangaClient) CreateBulk(builders ...*MangaCreate) *MangaCreateBulk
- func (c *MangaClient) Delete() *MangaDelete
- func (c *MangaClient) DeleteOne(m *Manga) *MangaDeleteOne
- func (c *MangaClient) DeleteOneID(id int) *MangaDeleteOne
- func (c *MangaClient) Get(ctx context.Context, id int) (*Manga, error)
- func (c *MangaClient) GetX(ctx context.Context, id int) *Manga
- func (c *MangaClient) Hooks() []Hook
- func (c *MangaClient) Intercept(interceptors ...Interceptor)
- func (c *MangaClient) Interceptors() []Interceptor
- func (c *MangaClient) MapCreateBulk(slice any, setFunc func(*MangaCreate, int)) *MangaCreateBulk
- func (c *MangaClient) Query() *MangaQuery
- func (c *MangaClient) QueryChapters(m *Manga) *ChapterQuery
- func (c *MangaClient) Update() *MangaUpdate
- func (c *MangaClient) UpdateOne(m *Manga) *MangaUpdateOne
- func (c *MangaClient) UpdateOneID(id int) *MangaUpdateOne
- func (c *MangaClient) Use(hooks ...Hook)
- type MangaCreate
- func (mc *MangaCreate) AddChapterIDs(ids ...int) *MangaCreate
- func (mc *MangaCreate) AddChapters(c ...*Chapter) *MangaCreate
- func (mc *MangaCreate) Exec(ctx context.Context) error
- func (mc *MangaCreate) ExecX(ctx context.Context)
- func (mc *MangaCreate) Mutation() *MangaMutation
- func (mc *MangaCreate) Save(ctx context.Context) (*Manga, error)
- func (mc *MangaCreate) SaveX(ctx context.Context) *Manga
- func (mc *MangaCreate) SetExcludedGroups(s []string) *MangaCreate
- func (mc *MangaCreate) SetFilteredGroups(s []string) *MangaCreate
- func (mc *MangaCreate) SetMangaID(s string) *MangaCreate
- func (mc *MangaCreate) SetMapping(s string) *MangaCreate
- func (mc *MangaCreate) SetRegisteredOn(t time.Time) *MangaCreate
- func (mc *MangaCreate) SetSource(s string) *MangaCreate
- func (mc *MangaCreate) SetTitle(s string) *MangaCreate
- type MangaCreateBulk
- type MangaDelete
- type MangaDeleteOne
- type MangaEdges
- type MangaGroupBy
- func (mgb *MangaGroupBy) Aggregate(fns ...AggregateFunc) *MangaGroupBy
- func (s *MangaGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *MangaGroupBy) BoolX(ctx context.Context) bool
- func (s *MangaGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *MangaGroupBy) BoolsX(ctx context.Context) []bool
- func (s *MangaGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *MangaGroupBy) Float64X(ctx context.Context) float64
- func (s *MangaGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *MangaGroupBy) Float64sX(ctx context.Context) []float64
- func (s *MangaGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *MangaGroupBy) IntX(ctx context.Context) int
- func (s *MangaGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *MangaGroupBy) IntsX(ctx context.Context) []int
- func (mgb *MangaGroupBy) Scan(ctx context.Context, v any) error
- func (s *MangaGroupBy) ScanX(ctx context.Context, v any)
- func (s *MangaGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *MangaGroupBy) StringX(ctx context.Context) string
- func (s *MangaGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *MangaGroupBy) StringsX(ctx context.Context) []string
- type MangaMutation
- func (m *MangaMutation) AddChapterIDs(ids ...int)
- func (m *MangaMutation) AddField(name string, value ent.Value) error
- func (m *MangaMutation) AddedEdges() []string
- func (m *MangaMutation) AddedField(name string) (ent.Value, bool)
- func (m *MangaMutation) AddedFields() []string
- func (m *MangaMutation) AddedIDs(name string) []ent.Value
- func (m *MangaMutation) AppendExcludedGroups(s []string)
- func (m *MangaMutation) AppendFilteredGroups(s []string)
- func (m *MangaMutation) AppendedExcludedGroups() ([]string, bool)
- func (m *MangaMutation) AppendedFilteredGroups() ([]string, bool)
- func (m *MangaMutation) ChaptersCleared() bool
- func (m *MangaMutation) ChaptersIDs() (ids []int)
- func (m *MangaMutation) ClearChapters()
- func (m *MangaMutation) ClearEdge(name string) error
- func (m *MangaMutation) ClearExcludedGroups()
- func (m *MangaMutation) ClearField(name string) error
- func (m *MangaMutation) ClearFilteredGroups()
- func (m *MangaMutation) ClearedEdges() []string
- func (m *MangaMutation) ClearedFields() []string
- func (m MangaMutation) Client() *Client
- func (m *MangaMutation) EdgeCleared(name string) bool
- func (m *MangaMutation) ExcludedGroups() (r []string, exists bool)
- func (m *MangaMutation) ExcludedGroupsCleared() bool
- func (m *MangaMutation) Field(name string) (ent.Value, bool)
- func (m *MangaMutation) FieldCleared(name string) bool
- func (m *MangaMutation) Fields() []string
- func (m *MangaMutation) FilteredGroups() (r []string, exists bool)
- func (m *MangaMutation) FilteredGroupsCleared() bool
- func (m *MangaMutation) ID() (id int, exists bool)
- func (m *MangaMutation) IDs(ctx context.Context) ([]int, error)
- func (m *MangaMutation) MangaID() (r string, exists bool)
- func (m *MangaMutation) Mapping() (r string, exists bool)
- func (m *MangaMutation) OldExcludedGroups(ctx context.Context) (v []string, err error)
- func (m *MangaMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *MangaMutation) OldFilteredGroups(ctx context.Context) (v []string, err error)
- func (m *MangaMutation) OldMangaID(ctx context.Context) (v string, err error)
- func (m *MangaMutation) OldMapping(ctx context.Context) (v string, err error)
- func (m *MangaMutation) OldRegisteredOn(ctx context.Context) (v time.Time, err error)
- func (m *MangaMutation) OldSource(ctx context.Context) (v string, err error)
- func (m *MangaMutation) OldTitle(ctx context.Context) (v string, err error)
- func (m *MangaMutation) Op() Op
- func (m *MangaMutation) RegisteredOn() (r time.Time, exists bool)
- func (m *MangaMutation) RemoveChapterIDs(ids ...int)
- func (m *MangaMutation) RemovedChaptersIDs() (ids []int)
- func (m *MangaMutation) RemovedEdges() []string
- func (m *MangaMutation) RemovedIDs(name string) []ent.Value
- func (m *MangaMutation) ResetChapters()
- func (m *MangaMutation) ResetEdge(name string) error
- func (m *MangaMutation) ResetExcludedGroups()
- func (m *MangaMutation) ResetField(name string) error
- func (m *MangaMutation) ResetFilteredGroups()
- func (m *MangaMutation) ResetMangaID()
- func (m *MangaMutation) ResetMapping()
- func (m *MangaMutation) ResetRegisteredOn()
- func (m *MangaMutation) ResetSource()
- func (m *MangaMutation) ResetTitle()
- func (m *MangaMutation) SetExcludedGroups(s []string)
- func (m *MangaMutation) SetField(name string, value ent.Value) error
- func (m *MangaMutation) SetFilteredGroups(s []string)
- func (m *MangaMutation) SetMangaID(s string)
- func (m *MangaMutation) SetMapping(s string)
- func (m *MangaMutation) SetOp(op Op)
- func (m *MangaMutation) SetRegisteredOn(t time.Time)
- func (m *MangaMutation) SetSource(s string)
- func (m *MangaMutation) SetTitle(s string)
- func (m *MangaMutation) Source() (r string, exists bool)
- func (m *MangaMutation) Title() (r string, exists bool)
- func (m MangaMutation) Tx() (*Tx, error)
- func (m *MangaMutation) Type() string
- func (m *MangaMutation) Where(ps ...predicate.Manga)
- func (m *MangaMutation) WhereP(ps ...func(*sql.Selector))
- type MangaQuery
- func (mq *MangaQuery) Aggregate(fns ...AggregateFunc) *MangaSelect
- func (mq *MangaQuery) All(ctx context.Context) ([]*Manga, error)
- func (mq *MangaQuery) AllX(ctx context.Context) []*Manga
- func (mq *MangaQuery) Clone() *MangaQuery
- func (mq *MangaQuery) Count(ctx context.Context) (int, error)
- func (mq *MangaQuery) CountX(ctx context.Context) int
- func (mq *MangaQuery) Exist(ctx context.Context) (bool, error)
- func (mq *MangaQuery) ExistX(ctx context.Context) bool
- func (mq *MangaQuery) First(ctx context.Context) (*Manga, error)
- func (mq *MangaQuery) FirstID(ctx context.Context) (id int, err error)
- func (mq *MangaQuery) FirstIDX(ctx context.Context) int
- func (mq *MangaQuery) FirstX(ctx context.Context) *Manga
- func (mq *MangaQuery) GroupBy(field string, fields ...string) *MangaGroupBy
- func (mq *MangaQuery) IDs(ctx context.Context) (ids []int, err error)
- func (mq *MangaQuery) IDsX(ctx context.Context) []int
- func (mq *MangaQuery) Limit(limit int) *MangaQuery
- func (mq *MangaQuery) Offset(offset int) *MangaQuery
- func (mq *MangaQuery) Only(ctx context.Context) (*Manga, error)
- func (mq *MangaQuery) OnlyID(ctx context.Context) (id int, err error)
- func (mq *MangaQuery) OnlyIDX(ctx context.Context) int
- func (mq *MangaQuery) OnlyX(ctx context.Context) *Manga
- func (mq *MangaQuery) Order(o ...manga.OrderOption) *MangaQuery
- func (mq *MangaQuery) QueryChapters() *ChapterQuery
- func (mq *MangaQuery) Select(fields ...string) *MangaSelect
- func (mq *MangaQuery) Unique(unique bool) *MangaQuery
- func (mq *MangaQuery) Where(ps ...predicate.Manga) *MangaQuery
- func (mq *MangaQuery) WithChapters(opts ...func(*ChapterQuery)) *MangaQuery
- type MangaSelect
- func (ms *MangaSelect) Aggregate(fns ...AggregateFunc) *MangaSelect
- func (s *MangaSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *MangaSelect) BoolX(ctx context.Context) bool
- func (s *MangaSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *MangaSelect) BoolsX(ctx context.Context) []bool
- func (s *MangaSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *MangaSelect) Float64X(ctx context.Context) float64
- func (s *MangaSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *MangaSelect) Float64sX(ctx context.Context) []float64
- func (s *MangaSelect) Int(ctx context.Context) (_ int, err error)
- func (s *MangaSelect) IntX(ctx context.Context) int
- func (s *MangaSelect) Ints(ctx context.Context) ([]int, error)
- func (s *MangaSelect) IntsX(ctx context.Context) []int
- func (ms *MangaSelect) Scan(ctx context.Context, v any) error
- func (s *MangaSelect) ScanX(ctx context.Context, v any)
- func (s *MangaSelect) String(ctx context.Context) (_ string, err error)
- func (s *MangaSelect) StringX(ctx context.Context) string
- func (s *MangaSelect) Strings(ctx context.Context) ([]string, error)
- func (s *MangaSelect) StringsX(ctx context.Context) []string
- type MangaUpdate
- func (mu *MangaUpdate) AddChapterIDs(ids ...int) *MangaUpdate
- func (mu *MangaUpdate) AddChapters(c ...*Chapter) *MangaUpdate
- func (mu *MangaUpdate) AppendExcludedGroups(s []string) *MangaUpdate
- func (mu *MangaUpdate) AppendFilteredGroups(s []string) *MangaUpdate
- func (mu *MangaUpdate) ClearChapters() *MangaUpdate
- func (mu *MangaUpdate) ClearExcludedGroups() *MangaUpdate
- func (mu *MangaUpdate) ClearFilteredGroups() *MangaUpdate
- func (mu *MangaUpdate) Exec(ctx context.Context) error
- func (mu *MangaUpdate) ExecX(ctx context.Context)
- func (mu *MangaUpdate) Mutation() *MangaMutation
- func (mu *MangaUpdate) RemoveChapterIDs(ids ...int) *MangaUpdate
- func (mu *MangaUpdate) RemoveChapters(c ...*Chapter) *MangaUpdate
- func (mu *MangaUpdate) Save(ctx context.Context) (int, error)
- func (mu *MangaUpdate) SaveX(ctx context.Context) int
- func (mu *MangaUpdate) SetExcludedGroups(s []string) *MangaUpdate
- func (mu *MangaUpdate) SetFilteredGroups(s []string) *MangaUpdate
- func (mu *MangaUpdate) SetMangaID(s string) *MangaUpdate
- func (mu *MangaUpdate) SetMapping(s string) *MangaUpdate
- func (mu *MangaUpdate) SetNillableMangaID(s *string) *MangaUpdate
- func (mu *MangaUpdate) SetNillableMapping(s *string) *MangaUpdate
- func (mu *MangaUpdate) SetNillableRegisteredOn(t *time.Time) *MangaUpdate
- func (mu *MangaUpdate) SetNillableSource(s *string) *MangaUpdate
- func (mu *MangaUpdate) SetNillableTitle(s *string) *MangaUpdate
- func (mu *MangaUpdate) SetRegisteredOn(t time.Time) *MangaUpdate
- func (mu *MangaUpdate) SetSource(s string) *MangaUpdate
- func (mu *MangaUpdate) SetTitle(s string) *MangaUpdate
- func (mu *MangaUpdate) Where(ps ...predicate.Manga) *MangaUpdate
- type MangaUpdateOne
- func (muo *MangaUpdateOne) AddChapterIDs(ids ...int) *MangaUpdateOne
- func (muo *MangaUpdateOne) AddChapters(c ...*Chapter) *MangaUpdateOne
- func (muo *MangaUpdateOne) AppendExcludedGroups(s []string) *MangaUpdateOne
- func (muo *MangaUpdateOne) AppendFilteredGroups(s []string) *MangaUpdateOne
- func (muo *MangaUpdateOne) ClearChapters() *MangaUpdateOne
- func (muo *MangaUpdateOne) ClearExcludedGroups() *MangaUpdateOne
- func (muo *MangaUpdateOne) ClearFilteredGroups() *MangaUpdateOne
- func (muo *MangaUpdateOne) Exec(ctx context.Context) error
- func (muo *MangaUpdateOne) ExecX(ctx context.Context)
- func (muo *MangaUpdateOne) Mutation() *MangaMutation
- func (muo *MangaUpdateOne) RemoveChapterIDs(ids ...int) *MangaUpdateOne
- func (muo *MangaUpdateOne) RemoveChapters(c ...*Chapter) *MangaUpdateOne
- func (muo *MangaUpdateOne) Save(ctx context.Context) (*Manga, error)
- func (muo *MangaUpdateOne) SaveX(ctx context.Context) *Manga
- func (muo *MangaUpdateOne) Select(field string, fields ...string) *MangaUpdateOne
- func (muo *MangaUpdateOne) SetExcludedGroups(s []string) *MangaUpdateOne
- func (muo *MangaUpdateOne) SetFilteredGroups(s []string) *MangaUpdateOne
- func (muo *MangaUpdateOne) SetMangaID(s string) *MangaUpdateOne
- func (muo *MangaUpdateOne) SetMapping(s string) *MangaUpdateOne
- func (muo *MangaUpdateOne) SetNillableMangaID(s *string) *MangaUpdateOne
- func (muo *MangaUpdateOne) SetNillableMapping(s *string) *MangaUpdateOne
- func (muo *MangaUpdateOne) SetNillableRegisteredOn(t *time.Time) *MangaUpdateOne
- func (muo *MangaUpdateOne) SetNillableSource(s *string) *MangaUpdateOne
- func (muo *MangaUpdateOne) SetNillableTitle(s *string) *MangaUpdateOne
- func (muo *MangaUpdateOne) SetRegisteredOn(t time.Time) *MangaUpdateOne
- func (muo *MangaUpdateOne) SetSource(s string) *MangaUpdateOne
- func (muo *MangaUpdateOne) SetTitle(s string) *MangaUpdateOne
- func (muo *MangaUpdateOne) Where(ps ...predicate.Manga) *MangaUpdateOne
- type Mangas
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type TraverseFunc
- type Traverser
- type Tx
- 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. TypeChapter = "Chapter" TypeManga = "Manga" )
Variables ¶
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")
ErrTxStarted is returned when trying to start a new transaction from a transactional client.
Functions ¶
func 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.
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 Chapter ¶
type Chapter struct { // ID of the ent. ID int `json:"id,omitempty"` // ChapterID holds the value of the "ChapterID" field. ChapterID string `json:"ChapterID,omitempty"` // Num holds the value of the "Num" field. Num string `json:"Num,omitempty"` // Title holds the value of the "Title" field. Title string `json:"Title,omitempty"` // CreatedOn holds the value of the "CreatedOn" field. CreatedOn time.Time `json:"CreatedOn,omitempty"` // RegisteredOn holds the value of the "RegisteredOn" field. RegisteredOn time.Time `json:"RegisteredOn,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the ChapterQuery when eager-loading is set. Edges ChapterEdges `json:"edges"` // contains filtered or unexported fields }
Chapter is the model entity for the Chapter schema.
func (*Chapter) QueryManga ¶
func (c *Chapter) QueryManga() *MangaQuery
QueryManga queries the "Manga" edge of the Chapter entity.
func (*Chapter) Unwrap ¶
Unwrap unwraps the Chapter 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 (*Chapter) Update ¶
func (c *Chapter) Update() *ChapterUpdateOne
Update returns a builder for updating this Chapter. Note that you need to call Chapter.Unwrap() before calling this method if this Chapter was returned from a transaction, and the transaction was committed or rolled back.
type ChapterClient ¶
type ChapterClient struct {
// contains filtered or unexported fields
}
ChapterClient is a client for the Chapter schema.
func NewChapterClient ¶
func NewChapterClient(c config) *ChapterClient
NewChapterClient returns a client for the Chapter from the given config.
func (*ChapterClient) Create ¶
func (c *ChapterClient) Create() *ChapterCreate
Create returns a builder for creating a Chapter entity.
func (*ChapterClient) CreateBulk ¶
func (c *ChapterClient) CreateBulk(builders ...*ChapterCreate) *ChapterCreateBulk
CreateBulk returns a builder for creating a bulk of Chapter entities.
func (*ChapterClient) Delete ¶
func (c *ChapterClient) Delete() *ChapterDelete
Delete returns a delete builder for Chapter.
func (*ChapterClient) DeleteOne ¶
func (c *ChapterClient) DeleteOne(ch *Chapter) *ChapterDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*ChapterClient) DeleteOneID ¶
func (c *ChapterClient) DeleteOneID(id int) *ChapterDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*ChapterClient) GetX ¶
func (c *ChapterClient) GetX(ctx context.Context, id int) *Chapter
GetX is like Get, but panics if an error occurs.
func (*ChapterClient) Hooks ¶
func (c *ChapterClient) Hooks() []Hook
Hooks returns the client hooks.
func (*ChapterClient) Intercept ¶
func (c *ChapterClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `chapter.Intercept(f(g(h())))`.
func (*ChapterClient) Interceptors ¶
func (c *ChapterClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*ChapterClient) MapCreateBulk ¶ added in v2.3.0
func (c *ChapterClient) MapCreateBulk(slice any, setFunc func(*ChapterCreate, int)) *ChapterCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*ChapterClient) Query ¶
func (c *ChapterClient) Query() *ChapterQuery
Query returns a query builder for Chapter.
func (*ChapterClient) QueryManga ¶
func (c *ChapterClient) QueryManga(ch *Chapter) *MangaQuery
QueryManga queries the Manga edge of a Chapter.
func (*ChapterClient) Update ¶
func (c *ChapterClient) Update() *ChapterUpdate
Update returns an update builder for Chapter.
func (*ChapterClient) UpdateOne ¶
func (c *ChapterClient) UpdateOne(ch *Chapter) *ChapterUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ChapterClient) UpdateOneID ¶
func (c *ChapterClient) UpdateOneID(id int) *ChapterUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ChapterClient) Use ¶
func (c *ChapterClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `chapter.Hooks(f(g(h())))`.
type ChapterCreate ¶
type ChapterCreate struct {
// contains filtered or unexported fields
}
ChapterCreate is the builder for creating a Chapter entity.
func (*ChapterCreate) Exec ¶
func (cc *ChapterCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ChapterCreate) ExecX ¶
func (cc *ChapterCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ChapterCreate) Mutation ¶
func (cc *ChapterCreate) Mutation() *ChapterMutation
Mutation returns the ChapterMutation object of the builder.
func (*ChapterCreate) Save ¶
func (cc *ChapterCreate) Save(ctx context.Context) (*Chapter, error)
Save creates the Chapter in the database.
func (*ChapterCreate) SaveX ¶
func (cc *ChapterCreate) SaveX(ctx context.Context) *Chapter
SaveX calls Save and panics if Save returns an error.
func (*ChapterCreate) SetChapterID ¶
func (cc *ChapterCreate) SetChapterID(s string) *ChapterCreate
SetChapterID sets the "ChapterID" field.
func (*ChapterCreate) SetCreatedOn ¶
func (cc *ChapterCreate) SetCreatedOn(t time.Time) *ChapterCreate
SetCreatedOn sets the "CreatedOn" field.
func (*ChapterCreate) SetManga ¶
func (cc *ChapterCreate) SetManga(m *Manga) *ChapterCreate
SetManga sets the "Manga" edge to the Manga entity.
func (*ChapterCreate) SetMangaID ¶
func (cc *ChapterCreate) SetMangaID(id int) *ChapterCreate
SetMangaID sets the "Manga" edge to the Manga entity by ID.
func (*ChapterCreate) SetNillableCreatedOn ¶
func (cc *ChapterCreate) SetNillableCreatedOn(t *time.Time) *ChapterCreate
SetNillableCreatedOn sets the "CreatedOn" field if the given value is not nil.
func (*ChapterCreate) SetNillableMangaID ¶
func (cc *ChapterCreate) SetNillableMangaID(id *int) *ChapterCreate
SetNillableMangaID sets the "Manga" edge to the Manga entity by ID if the given value is not nil.
func (*ChapterCreate) SetNillableTitle ¶
func (cc *ChapterCreate) SetNillableTitle(s *string) *ChapterCreate
SetNillableTitle sets the "Title" field if the given value is not nil.
func (*ChapterCreate) SetNum ¶
func (cc *ChapterCreate) SetNum(s string) *ChapterCreate
SetNum sets the "Num" field.
func (*ChapterCreate) SetRegisteredOn ¶
func (cc *ChapterCreate) SetRegisteredOn(t time.Time) *ChapterCreate
SetRegisteredOn sets the "RegisteredOn" field.
func (*ChapterCreate) SetTitle ¶
func (cc *ChapterCreate) SetTitle(s string) *ChapterCreate
SetTitle sets the "Title" field.
type ChapterCreateBulk ¶
type ChapterCreateBulk struct {
// contains filtered or unexported fields
}
ChapterCreateBulk is the builder for creating many Chapter entities in bulk.
func (*ChapterCreateBulk) Exec ¶
func (ccb *ChapterCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ChapterCreateBulk) ExecX ¶
func (ccb *ChapterCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type ChapterDelete ¶
type ChapterDelete struct {
// contains filtered or unexported fields
}
ChapterDelete is the builder for deleting a Chapter entity.
func (*ChapterDelete) Exec ¶
func (cd *ChapterDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ChapterDelete) ExecX ¶
func (cd *ChapterDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ChapterDelete) Where ¶
func (cd *ChapterDelete) Where(ps ...predicate.Chapter) *ChapterDelete
Where appends a list predicates to the ChapterDelete builder.
type ChapterDeleteOne ¶
type ChapterDeleteOne struct {
// contains filtered or unexported fields
}
ChapterDeleteOne is the builder for deleting a single Chapter entity.
func (*ChapterDeleteOne) Exec ¶
func (cdo *ChapterDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ChapterDeleteOne) ExecX ¶
func (cdo *ChapterDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ChapterDeleteOne) Where ¶
func (cdo *ChapterDeleteOne) Where(ps ...predicate.Chapter) *ChapterDeleteOne
Where appends a list predicates to the ChapterDelete builder.
type ChapterEdges ¶
type ChapterEdges struct { // Manga holds the value of the Manga edge. Manga *Manga `json:"Manga,omitempty"` // contains filtered or unexported fields }
ChapterEdges holds the relations/edges for other nodes in the graph.
func (ChapterEdges) MangaOrErr ¶
func (e ChapterEdges) MangaOrErr() (*Manga, error)
MangaOrErr returns the Manga value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type ChapterGroupBy ¶
type ChapterGroupBy struct {
// contains filtered or unexported fields
}
ChapterGroupBy is the group-by builder for Chapter entities.
func (*ChapterGroupBy) Aggregate ¶
func (cgb *ChapterGroupBy) Aggregate(fns ...AggregateFunc) *ChapterGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ChapterGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ChapterGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ChapterGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ChapterGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ChapterGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ChapterGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ChapterGroupBy) Scan ¶
func (cgb *ChapterGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ChapterGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ChapterMutation ¶
type ChapterMutation struct {
// contains filtered or unexported fields
}
ChapterMutation represents an operation that mutates the Chapter nodes in the graph.
func (*ChapterMutation) AddField ¶
func (m *ChapterMutation) 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 (*ChapterMutation) AddedEdges ¶
func (m *ChapterMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ChapterMutation) AddedField ¶
func (m *ChapterMutation) 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 (*ChapterMutation) AddedFields ¶
func (m *ChapterMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ChapterMutation) AddedIDs ¶
func (m *ChapterMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ChapterMutation) ChapterID ¶
func (m *ChapterMutation) ChapterID() (r string, exists bool)
ChapterID returns the value of the "ChapterID" field in the mutation.
func (*ChapterMutation) ClearCreatedOn ¶
func (m *ChapterMutation) ClearCreatedOn()
ClearCreatedOn clears the value of the "CreatedOn" field.
func (*ChapterMutation) ClearEdge ¶
func (m *ChapterMutation) 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 (*ChapterMutation) ClearField ¶
func (m *ChapterMutation) 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 (*ChapterMutation) ClearManga ¶
func (m *ChapterMutation) ClearManga()
ClearManga clears the "Manga" edge to the Manga entity.
func (*ChapterMutation) ClearTitle ¶
func (m *ChapterMutation) ClearTitle()
ClearTitle clears the value of the "Title" field.
func (*ChapterMutation) ClearedEdges ¶
func (m *ChapterMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ChapterMutation) ClearedFields ¶
func (m *ChapterMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ChapterMutation) Client ¶
func (m ChapterMutation) 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 (*ChapterMutation) CreatedOn ¶
func (m *ChapterMutation) CreatedOn() (r time.Time, exists bool)
CreatedOn returns the value of the "CreatedOn" field in the mutation.
func (*ChapterMutation) CreatedOnCleared ¶
func (m *ChapterMutation) CreatedOnCleared() bool
CreatedOnCleared returns if the "CreatedOn" field was cleared in this mutation.
func (*ChapterMutation) EdgeCleared ¶
func (m *ChapterMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ChapterMutation) Field ¶
func (m *ChapterMutation) 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 (*ChapterMutation) FieldCleared ¶
func (m *ChapterMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ChapterMutation) Fields ¶
func (m *ChapterMutation) 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 (*ChapterMutation) ID ¶
func (m *ChapterMutation) 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 (*ChapterMutation) IDs ¶
func (m *ChapterMutation) 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 (*ChapterMutation) MangaCleared ¶
func (m *ChapterMutation) MangaCleared() bool
MangaCleared reports if the "Manga" edge to the Manga entity was cleared.
func (*ChapterMutation) MangaID ¶
func (m *ChapterMutation) MangaID() (id int, exists bool)
MangaID returns the "Manga" edge ID in the mutation.
func (*ChapterMutation) MangaIDs ¶
func (m *ChapterMutation) MangaIDs() (ids []int)
MangaIDs returns the "Manga" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use MangaID instead. It exists only for internal usage by the builders.
func (*ChapterMutation) Num ¶
func (m *ChapterMutation) Num() (r string, exists bool)
Num returns the value of the "Num" field in the mutation.
func (*ChapterMutation) OldChapterID ¶
func (m *ChapterMutation) OldChapterID(ctx context.Context) (v string, err error)
OldChapterID returns the old "ChapterID" field's value of the Chapter entity. If the Chapter 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 (*ChapterMutation) OldCreatedOn ¶
OldCreatedOn returns the old "CreatedOn" field's value of the Chapter entity. If the Chapter 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 (*ChapterMutation) 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 (*ChapterMutation) OldNum ¶
func (m *ChapterMutation) OldNum(ctx context.Context) (v string, err error)
OldNum returns the old "Num" field's value of the Chapter entity. If the Chapter 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 (*ChapterMutation) OldRegisteredOn ¶
OldRegisteredOn returns the old "RegisteredOn" field's value of the Chapter entity. If the Chapter 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 (*ChapterMutation) OldTitle ¶
func (m *ChapterMutation) OldTitle(ctx context.Context) (v string, err error)
OldTitle returns the old "Title" field's value of the Chapter entity. If the Chapter 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 (*ChapterMutation) RegisteredOn ¶
func (m *ChapterMutation) RegisteredOn() (r time.Time, exists bool)
RegisteredOn returns the value of the "RegisteredOn" field in the mutation.
func (*ChapterMutation) RemovedEdges ¶
func (m *ChapterMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ChapterMutation) RemovedIDs ¶
func (m *ChapterMutation) 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 (*ChapterMutation) ResetChapterID ¶
func (m *ChapterMutation) ResetChapterID()
ResetChapterID resets all changes to the "ChapterID" field.
func (*ChapterMutation) ResetCreatedOn ¶
func (m *ChapterMutation) ResetCreatedOn()
ResetCreatedOn resets all changes to the "CreatedOn" field.
func (*ChapterMutation) ResetEdge ¶
func (m *ChapterMutation) 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 (*ChapterMutation) ResetField ¶
func (m *ChapterMutation) 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 (*ChapterMutation) ResetManga ¶
func (m *ChapterMutation) ResetManga()
ResetManga resets all changes to the "Manga" edge.
func (*ChapterMutation) ResetNum ¶
func (m *ChapterMutation) ResetNum()
ResetNum resets all changes to the "Num" field.
func (*ChapterMutation) ResetRegisteredOn ¶
func (m *ChapterMutation) ResetRegisteredOn()
ResetRegisteredOn resets all changes to the "RegisteredOn" field.
func (*ChapterMutation) ResetTitle ¶
func (m *ChapterMutation) ResetTitle()
ResetTitle resets all changes to the "Title" field.
func (*ChapterMutation) SetChapterID ¶
func (m *ChapterMutation) SetChapterID(s string)
SetChapterID sets the "ChapterID" field.
func (*ChapterMutation) SetCreatedOn ¶
func (m *ChapterMutation) SetCreatedOn(t time.Time)
SetCreatedOn sets the "CreatedOn" field.
func (*ChapterMutation) SetField ¶
func (m *ChapterMutation) 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 (*ChapterMutation) SetMangaID ¶
func (m *ChapterMutation) SetMangaID(id int)
SetMangaID sets the "Manga" edge to the Manga entity by id.
func (*ChapterMutation) SetNum ¶
func (m *ChapterMutation) SetNum(s string)
SetNum sets the "Num" field.
func (*ChapterMutation) SetOp ¶
func (m *ChapterMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*ChapterMutation) SetRegisteredOn ¶
func (m *ChapterMutation) SetRegisteredOn(t time.Time)
SetRegisteredOn sets the "RegisteredOn" field.
func (*ChapterMutation) SetTitle ¶
func (m *ChapterMutation) SetTitle(s string)
SetTitle sets the "Title" field.
func (*ChapterMutation) Title ¶
func (m *ChapterMutation) Title() (r string, exists bool)
Title returns the value of the "Title" field in the mutation.
func (*ChapterMutation) TitleCleared ¶
func (m *ChapterMutation) TitleCleared() bool
TitleCleared returns if the "Title" field was cleared in this mutation.
func (ChapterMutation) Tx ¶
func (m ChapterMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ChapterMutation) Type ¶
func (m *ChapterMutation) Type() string
Type returns the node type of this mutation (Chapter).
func (*ChapterMutation) Where ¶
func (m *ChapterMutation) Where(ps ...predicate.Chapter)
Where appends a list predicates to the ChapterMutation builder.
func (*ChapterMutation) WhereP ¶
func (m *ChapterMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the ChapterMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type ChapterQuery ¶
type ChapterQuery struct {
// contains filtered or unexported fields
}
ChapterQuery is the builder for querying Chapter entities.
func (*ChapterQuery) Aggregate ¶
func (cq *ChapterQuery) Aggregate(fns ...AggregateFunc) *ChapterSelect
Aggregate returns a ChapterSelect configured with the given aggregations.
func (*ChapterQuery) All ¶
func (cq *ChapterQuery) All(ctx context.Context) ([]*Chapter, error)
All executes the query and returns a list of Chapters.
func (*ChapterQuery) AllX ¶
func (cq *ChapterQuery) AllX(ctx context.Context) []*Chapter
AllX is like All, but panics if an error occurs.
func (*ChapterQuery) Clone ¶
func (cq *ChapterQuery) Clone() *ChapterQuery
Clone returns a duplicate of the ChapterQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ChapterQuery) Count ¶
func (cq *ChapterQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ChapterQuery) CountX ¶
func (cq *ChapterQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ChapterQuery) Exist ¶
func (cq *ChapterQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ChapterQuery) ExistX ¶
func (cq *ChapterQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ChapterQuery) First ¶
func (cq *ChapterQuery) First(ctx context.Context) (*Chapter, error)
First returns the first Chapter entity from the query. Returns a *NotFoundError when no Chapter was found.
func (*ChapterQuery) FirstID ¶
func (cq *ChapterQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Chapter ID from the query. Returns a *NotFoundError when no Chapter ID was found.
func (*ChapterQuery) FirstIDX ¶
func (cq *ChapterQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*ChapterQuery) FirstX ¶
func (cq *ChapterQuery) FirstX(ctx context.Context) *Chapter
FirstX is like First, but panics if an error occurs.
func (*ChapterQuery) GroupBy ¶
func (cq *ChapterQuery) GroupBy(field string, fields ...string) *ChapterGroupBy
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 { ChapterID string `json:"ChapterID,omitempty"` Count int `json:"count,omitempty"` } client.Chapter.Query(). GroupBy(chapter.FieldChapterID). Aggregate(ent.Count()). Scan(ctx, &v)
func (*ChapterQuery) IDs ¶
func (cq *ChapterQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Chapter IDs.
func (*ChapterQuery) IDsX ¶
func (cq *ChapterQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*ChapterQuery) Limit ¶
func (cq *ChapterQuery) Limit(limit int) *ChapterQuery
Limit the number of records to be returned by this query.
func (*ChapterQuery) Offset ¶
func (cq *ChapterQuery) Offset(offset int) *ChapterQuery
Offset to start from.
func (*ChapterQuery) Only ¶
func (cq *ChapterQuery) Only(ctx context.Context) (*Chapter, error)
Only returns a single Chapter entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Chapter entity is found. Returns a *NotFoundError when no Chapter entities are found.
func (*ChapterQuery) OnlyID ¶
func (cq *ChapterQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Chapter ID in the query. Returns a *NotSingularError when more than one Chapter ID is found. Returns a *NotFoundError when no entities are found.
func (*ChapterQuery) OnlyIDX ¶
func (cq *ChapterQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ChapterQuery) OnlyX ¶
func (cq *ChapterQuery) OnlyX(ctx context.Context) *Chapter
OnlyX is like Only, but panics if an error occurs.
func (*ChapterQuery) Order ¶
func (cq *ChapterQuery) Order(o ...chapter.OrderOption) *ChapterQuery
Order specifies how the records should be ordered.
func (*ChapterQuery) QueryManga ¶
func (cq *ChapterQuery) QueryManga() *MangaQuery
QueryManga chains the current query on the "Manga" edge.
func (*ChapterQuery) Select ¶
func (cq *ChapterQuery) Select(fields ...string) *ChapterSelect
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 { ChapterID string `json:"ChapterID,omitempty"` } client.Chapter.Query(). Select(chapter.FieldChapterID). Scan(ctx, &v)
func (*ChapterQuery) Unique ¶
func (cq *ChapterQuery) Unique(unique bool) *ChapterQuery
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 (*ChapterQuery) Where ¶
func (cq *ChapterQuery) Where(ps ...predicate.Chapter) *ChapterQuery
Where adds a new predicate for the ChapterQuery builder.
func (*ChapterQuery) WithManga ¶
func (cq *ChapterQuery) WithManga(opts ...func(*MangaQuery)) *ChapterQuery
WithManga tells the query-builder to eager-load the nodes that are connected to the "Manga" edge. The optional arguments are used to configure the query builder of the edge.
type ChapterSelect ¶
type ChapterSelect struct { *ChapterQuery // contains filtered or unexported fields }
ChapterSelect is the builder for selecting fields of Chapter entities.
func (*ChapterSelect) Aggregate ¶
func (cs *ChapterSelect) Aggregate(fns ...AggregateFunc) *ChapterSelect
Aggregate adds the given aggregation functions to the selector query.
func (*ChapterSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ChapterSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ChapterSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ChapterSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ChapterSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ChapterSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ChapterSelect) Scan ¶
func (cs *ChapterSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ChapterSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ChapterUpdate ¶
type ChapterUpdate struct {
// contains filtered or unexported fields
}
ChapterUpdate is the builder for updating Chapter entities.
func (*ChapterUpdate) ClearCreatedOn ¶
func (cu *ChapterUpdate) ClearCreatedOn() *ChapterUpdate
ClearCreatedOn clears the value of the "CreatedOn" field.
func (*ChapterUpdate) ClearManga ¶
func (cu *ChapterUpdate) ClearManga() *ChapterUpdate
ClearManga clears the "Manga" edge to the Manga entity.
func (*ChapterUpdate) ClearTitle ¶
func (cu *ChapterUpdate) ClearTitle() *ChapterUpdate
ClearTitle clears the value of the "Title" field.
func (*ChapterUpdate) Exec ¶
func (cu *ChapterUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ChapterUpdate) ExecX ¶
func (cu *ChapterUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ChapterUpdate) Mutation ¶
func (cu *ChapterUpdate) Mutation() *ChapterMutation
Mutation returns the ChapterMutation object of the builder.
func (*ChapterUpdate) Save ¶
func (cu *ChapterUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ChapterUpdate) SaveX ¶
func (cu *ChapterUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ChapterUpdate) SetChapterID ¶
func (cu *ChapterUpdate) SetChapterID(s string) *ChapterUpdate
SetChapterID sets the "ChapterID" field.
func (*ChapterUpdate) SetCreatedOn ¶
func (cu *ChapterUpdate) SetCreatedOn(t time.Time) *ChapterUpdate
SetCreatedOn sets the "CreatedOn" field.
func (*ChapterUpdate) SetManga ¶
func (cu *ChapterUpdate) SetManga(m *Manga) *ChapterUpdate
SetManga sets the "Manga" edge to the Manga entity.
func (*ChapterUpdate) SetMangaID ¶
func (cu *ChapterUpdate) SetMangaID(id int) *ChapterUpdate
SetMangaID sets the "Manga" edge to the Manga entity by ID.
func (*ChapterUpdate) SetNillableChapterID ¶ added in v2.3.0
func (cu *ChapterUpdate) SetNillableChapterID(s *string) *ChapterUpdate
SetNillableChapterID sets the "ChapterID" field if the given value is not nil.
func (*ChapterUpdate) SetNillableCreatedOn ¶
func (cu *ChapterUpdate) SetNillableCreatedOn(t *time.Time) *ChapterUpdate
SetNillableCreatedOn sets the "CreatedOn" field if the given value is not nil.
func (*ChapterUpdate) SetNillableMangaID ¶
func (cu *ChapterUpdate) SetNillableMangaID(id *int) *ChapterUpdate
SetNillableMangaID sets the "Manga" edge to the Manga entity by ID if the given value is not nil.
func (*ChapterUpdate) SetNillableNum ¶ added in v2.3.0
func (cu *ChapterUpdate) SetNillableNum(s *string) *ChapterUpdate
SetNillableNum sets the "Num" field if the given value is not nil.
func (*ChapterUpdate) SetNillableRegisteredOn ¶ added in v2.3.0
func (cu *ChapterUpdate) SetNillableRegisteredOn(t *time.Time) *ChapterUpdate
SetNillableRegisteredOn sets the "RegisteredOn" field if the given value is not nil.
func (*ChapterUpdate) SetNillableTitle ¶
func (cu *ChapterUpdate) SetNillableTitle(s *string) *ChapterUpdate
SetNillableTitle sets the "Title" field if the given value is not nil.
func (*ChapterUpdate) SetNum ¶
func (cu *ChapterUpdate) SetNum(s string) *ChapterUpdate
SetNum sets the "Num" field.
func (*ChapterUpdate) SetRegisteredOn ¶
func (cu *ChapterUpdate) SetRegisteredOn(t time.Time) *ChapterUpdate
SetRegisteredOn sets the "RegisteredOn" field.
func (*ChapterUpdate) SetTitle ¶
func (cu *ChapterUpdate) SetTitle(s string) *ChapterUpdate
SetTitle sets the "Title" field.
func (*ChapterUpdate) Where ¶
func (cu *ChapterUpdate) Where(ps ...predicate.Chapter) *ChapterUpdate
Where appends a list predicates to the ChapterUpdate builder.
type ChapterUpdateOne ¶
type ChapterUpdateOne struct {
// contains filtered or unexported fields
}
ChapterUpdateOne is the builder for updating a single Chapter entity.
func (*ChapterUpdateOne) ClearCreatedOn ¶
func (cuo *ChapterUpdateOne) ClearCreatedOn() *ChapterUpdateOne
ClearCreatedOn clears the value of the "CreatedOn" field.
func (*ChapterUpdateOne) ClearManga ¶
func (cuo *ChapterUpdateOne) ClearManga() *ChapterUpdateOne
ClearManga clears the "Manga" edge to the Manga entity.
func (*ChapterUpdateOne) ClearTitle ¶
func (cuo *ChapterUpdateOne) ClearTitle() *ChapterUpdateOne
ClearTitle clears the value of the "Title" field.
func (*ChapterUpdateOne) Exec ¶
func (cuo *ChapterUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ChapterUpdateOne) ExecX ¶
func (cuo *ChapterUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ChapterUpdateOne) Mutation ¶
func (cuo *ChapterUpdateOne) Mutation() *ChapterMutation
Mutation returns the ChapterMutation object of the builder.
func (*ChapterUpdateOne) Save ¶
func (cuo *ChapterUpdateOne) Save(ctx context.Context) (*Chapter, error)
Save executes the query and returns the updated Chapter entity.
func (*ChapterUpdateOne) SaveX ¶
func (cuo *ChapterUpdateOne) SaveX(ctx context.Context) *Chapter
SaveX is like Save, but panics if an error occurs.
func (*ChapterUpdateOne) Select ¶
func (cuo *ChapterUpdateOne) Select(field string, fields ...string) *ChapterUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ChapterUpdateOne) SetChapterID ¶
func (cuo *ChapterUpdateOne) SetChapterID(s string) *ChapterUpdateOne
SetChapterID sets the "ChapterID" field.
func (*ChapterUpdateOne) SetCreatedOn ¶
func (cuo *ChapterUpdateOne) SetCreatedOn(t time.Time) *ChapterUpdateOne
SetCreatedOn sets the "CreatedOn" field.
func (*ChapterUpdateOne) SetManga ¶
func (cuo *ChapterUpdateOne) SetManga(m *Manga) *ChapterUpdateOne
SetManga sets the "Manga" edge to the Manga entity.
func (*ChapterUpdateOne) SetMangaID ¶
func (cuo *ChapterUpdateOne) SetMangaID(id int) *ChapterUpdateOne
SetMangaID sets the "Manga" edge to the Manga entity by ID.
func (*ChapterUpdateOne) SetNillableChapterID ¶ added in v2.3.0
func (cuo *ChapterUpdateOne) SetNillableChapterID(s *string) *ChapterUpdateOne
SetNillableChapterID sets the "ChapterID" field if the given value is not nil.
func (*ChapterUpdateOne) SetNillableCreatedOn ¶
func (cuo *ChapterUpdateOne) SetNillableCreatedOn(t *time.Time) *ChapterUpdateOne
SetNillableCreatedOn sets the "CreatedOn" field if the given value is not nil.
func (*ChapterUpdateOne) SetNillableMangaID ¶
func (cuo *ChapterUpdateOne) SetNillableMangaID(id *int) *ChapterUpdateOne
SetNillableMangaID sets the "Manga" edge to the Manga entity by ID if the given value is not nil.
func (*ChapterUpdateOne) SetNillableNum ¶ added in v2.3.0
func (cuo *ChapterUpdateOne) SetNillableNum(s *string) *ChapterUpdateOne
SetNillableNum sets the "Num" field if the given value is not nil.
func (*ChapterUpdateOne) SetNillableRegisteredOn ¶ added in v2.3.0
func (cuo *ChapterUpdateOne) SetNillableRegisteredOn(t *time.Time) *ChapterUpdateOne
SetNillableRegisteredOn sets the "RegisteredOn" field if the given value is not nil.
func (*ChapterUpdateOne) SetNillableTitle ¶
func (cuo *ChapterUpdateOne) SetNillableTitle(s *string) *ChapterUpdateOne
SetNillableTitle sets the "Title" field if the given value is not nil.
func (*ChapterUpdateOne) SetNum ¶
func (cuo *ChapterUpdateOne) SetNum(s string) *ChapterUpdateOne
SetNum sets the "Num" field.
func (*ChapterUpdateOne) SetRegisteredOn ¶
func (cuo *ChapterUpdateOne) SetRegisteredOn(t time.Time) *ChapterUpdateOne
SetRegisteredOn sets the "RegisteredOn" field.
func (*ChapterUpdateOne) SetTitle ¶
func (cuo *ChapterUpdateOne) SetTitle(s string) *ChapterUpdateOne
SetTitle sets the "Title" field.
func (*ChapterUpdateOne) Where ¶
func (cuo *ChapterUpdateOne) Where(ps ...predicate.Chapter) *ChapterUpdateOne
Where appends a list predicates to the ChapterUpdate builder.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Chapter is the client for interacting with the Chapter builders. Chapter *ChapterClient // Manga is the client for interacting with the Manga builders. Manga *MangaClient // 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(). Chapter. Query(). Count(ctx)
func (*Client) Intercept ¶
func (c *Client) Intercept(interceptors ...Interceptor)
Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.
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 InterceptFunc ¶
type InterceptFunc = ent.InterceptFunc
ent aliases to avoid import conflicts in user's code.
type Interceptor ¶
type Interceptor = ent.Interceptor
ent aliases to avoid import conflicts in user's code.
type Manga ¶
type Manga struct { // ID of the ent. ID int `json:"id,omitempty"` // MangaID holds the value of the "MangaID" field. MangaID string `json:"MangaID,omitempty"` // Source holds the value of the "Source" field. Source string `json:"Source,omitempty"` // Title holds the value of the "Title" field. Title string `json:"Title,omitempty"` // Mapping holds the value of the "Mapping" field. Mapping string `json:"Mapping,omitempty"` // RegisteredOn holds the value of the "RegisteredOn" field. RegisteredOn time.Time `json:"RegisteredOn,omitempty"` // FilteredGroups holds the value of the "FilteredGroups" field. FilteredGroups []string `json:"FilteredGroups,omitempty"` // ExcludedGroups holds the value of the "ExcludedGroups" field. ExcludedGroups []string `json:"ExcludedGroups,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the MangaQuery when eager-loading is set. Edges MangaEdges `json:"edges"` // contains filtered or unexported fields }
Manga is the model entity for the Manga schema.
func (*Manga) QueryChapters ¶
func (m *Manga) QueryChapters() *ChapterQuery
QueryChapters queries the "Chapters" edge of the Manga entity.
func (*Manga) Unwrap ¶
Unwrap unwraps the Manga 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 (*Manga) Update ¶
func (m *Manga) Update() *MangaUpdateOne
Update returns a builder for updating this Manga. Note that you need to call Manga.Unwrap() before calling this method if this Manga was returned from a transaction, and the transaction was committed or rolled back.
type MangaClient ¶
type MangaClient struct {
// contains filtered or unexported fields
}
MangaClient is a client for the Manga schema.
func NewMangaClient ¶
func NewMangaClient(c config) *MangaClient
NewMangaClient returns a client for the Manga from the given config.
func (*MangaClient) Create ¶
func (c *MangaClient) Create() *MangaCreate
Create returns a builder for creating a Manga entity.
func (*MangaClient) CreateBulk ¶
func (c *MangaClient) CreateBulk(builders ...*MangaCreate) *MangaCreateBulk
CreateBulk returns a builder for creating a bulk of Manga entities.
func (*MangaClient) Delete ¶
func (c *MangaClient) Delete() *MangaDelete
Delete returns a delete builder for Manga.
func (*MangaClient) DeleteOne ¶
func (c *MangaClient) DeleteOne(m *Manga) *MangaDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*MangaClient) DeleteOneID ¶
func (c *MangaClient) DeleteOneID(id int) *MangaDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*MangaClient) GetX ¶
func (c *MangaClient) GetX(ctx context.Context, id int) *Manga
GetX is like Get, but panics if an error occurs.
func (*MangaClient) Intercept ¶
func (c *MangaClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `manga.Intercept(f(g(h())))`.
func (*MangaClient) Interceptors ¶
func (c *MangaClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*MangaClient) MapCreateBulk ¶ added in v2.3.0
func (c *MangaClient) MapCreateBulk(slice any, setFunc func(*MangaCreate, int)) *MangaCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*MangaClient) Query ¶
func (c *MangaClient) Query() *MangaQuery
Query returns a query builder for Manga.
func (*MangaClient) QueryChapters ¶
func (c *MangaClient) QueryChapters(m *Manga) *ChapterQuery
QueryChapters queries the Chapters edge of a Manga.
func (*MangaClient) Update ¶
func (c *MangaClient) Update() *MangaUpdate
Update returns an update builder for Manga.
func (*MangaClient) UpdateOne ¶
func (c *MangaClient) UpdateOne(m *Manga) *MangaUpdateOne
UpdateOne returns an update builder for the given entity.
func (*MangaClient) UpdateOneID ¶
func (c *MangaClient) UpdateOneID(id int) *MangaUpdateOne
UpdateOneID returns an update builder for the given id.
func (*MangaClient) Use ¶
func (c *MangaClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `manga.Hooks(f(g(h())))`.
type MangaCreate ¶
type MangaCreate struct {
// contains filtered or unexported fields
}
MangaCreate is the builder for creating a Manga entity.
func (*MangaCreate) AddChapterIDs ¶
func (mc *MangaCreate) AddChapterIDs(ids ...int) *MangaCreate
AddChapterIDs adds the "Chapters" edge to the Chapter entity by IDs.
func (*MangaCreate) AddChapters ¶
func (mc *MangaCreate) AddChapters(c ...*Chapter) *MangaCreate
AddChapters adds the "Chapters" edges to the Chapter entity.
func (*MangaCreate) Exec ¶
func (mc *MangaCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*MangaCreate) ExecX ¶
func (mc *MangaCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MangaCreate) Mutation ¶
func (mc *MangaCreate) Mutation() *MangaMutation
Mutation returns the MangaMutation object of the builder.
func (*MangaCreate) Save ¶
func (mc *MangaCreate) Save(ctx context.Context) (*Manga, error)
Save creates the Manga in the database.
func (*MangaCreate) SaveX ¶
func (mc *MangaCreate) SaveX(ctx context.Context) *Manga
SaveX calls Save and panics if Save returns an error.
func (*MangaCreate) SetExcludedGroups ¶ added in v2.4.0
func (mc *MangaCreate) SetExcludedGroups(s []string) *MangaCreate
SetExcludedGroups sets the "ExcludedGroups" field.
func (*MangaCreate) SetFilteredGroups ¶
func (mc *MangaCreate) SetFilteredGroups(s []string) *MangaCreate
SetFilteredGroups sets the "FilteredGroups" field.
func (*MangaCreate) SetMangaID ¶
func (mc *MangaCreate) SetMangaID(s string) *MangaCreate
SetMangaID sets the "MangaID" field.
func (*MangaCreate) SetMapping ¶
func (mc *MangaCreate) SetMapping(s string) *MangaCreate
SetMapping sets the "Mapping" field.
func (*MangaCreate) SetRegisteredOn ¶
func (mc *MangaCreate) SetRegisteredOn(t time.Time) *MangaCreate
SetRegisteredOn sets the "RegisteredOn" field.
func (*MangaCreate) SetSource ¶
func (mc *MangaCreate) SetSource(s string) *MangaCreate
SetSource sets the "Source" field.
func (*MangaCreate) SetTitle ¶
func (mc *MangaCreate) SetTitle(s string) *MangaCreate
SetTitle sets the "Title" field.
type MangaCreateBulk ¶
type MangaCreateBulk struct {
// contains filtered or unexported fields
}
MangaCreateBulk is the builder for creating many Manga entities in bulk.
func (*MangaCreateBulk) Exec ¶
func (mcb *MangaCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*MangaCreateBulk) ExecX ¶
func (mcb *MangaCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type MangaDelete ¶
type MangaDelete struct {
// contains filtered or unexported fields
}
MangaDelete is the builder for deleting a Manga entity.
func (*MangaDelete) Exec ¶
func (md *MangaDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*MangaDelete) ExecX ¶
func (md *MangaDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*MangaDelete) Where ¶
func (md *MangaDelete) Where(ps ...predicate.Manga) *MangaDelete
Where appends a list predicates to the MangaDelete builder.
type MangaDeleteOne ¶
type MangaDeleteOne struct {
// contains filtered or unexported fields
}
MangaDeleteOne is the builder for deleting a single Manga entity.
func (*MangaDeleteOne) Exec ¶
func (mdo *MangaDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*MangaDeleteOne) ExecX ¶
func (mdo *MangaDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MangaDeleteOne) Where ¶
func (mdo *MangaDeleteOne) Where(ps ...predicate.Manga) *MangaDeleteOne
Where appends a list predicates to the MangaDelete builder.
type MangaEdges ¶
type MangaEdges struct { // Chapters holds the value of the Chapters edge. Chapters []*Chapter `json:"Chapters,omitempty"` // contains filtered or unexported fields }
MangaEdges holds the relations/edges for other nodes in the graph.
func (MangaEdges) ChaptersOrErr ¶
func (e MangaEdges) ChaptersOrErr() ([]*Chapter, error)
ChaptersOrErr returns the Chapters value or an error if the edge was not loaded in eager-loading.
type MangaGroupBy ¶
type MangaGroupBy struct {
// contains filtered or unexported fields
}
MangaGroupBy is the group-by builder for Manga entities.
func (*MangaGroupBy) Aggregate ¶
func (mgb *MangaGroupBy) Aggregate(fns ...AggregateFunc) *MangaGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*MangaGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*MangaGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*MangaGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*MangaGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*MangaGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*MangaGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*MangaGroupBy) Scan ¶
func (mgb *MangaGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*MangaGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type MangaMutation ¶
type MangaMutation struct {
// contains filtered or unexported fields
}
MangaMutation represents an operation that mutates the Manga nodes in the graph.
func (*MangaMutation) AddChapterIDs ¶
func (m *MangaMutation) AddChapterIDs(ids ...int)
AddChapterIDs adds the "Chapters" edge to the Chapter entity by ids.
func (*MangaMutation) AddField ¶
func (m *MangaMutation) 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 (*MangaMutation) AddedEdges ¶
func (m *MangaMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*MangaMutation) AddedField ¶
func (m *MangaMutation) 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 (*MangaMutation) AddedFields ¶
func (m *MangaMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*MangaMutation) AddedIDs ¶
func (m *MangaMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*MangaMutation) AppendExcludedGroups ¶ added in v2.4.0
func (m *MangaMutation) AppendExcludedGroups(s []string)
AppendExcludedGroups adds s to the "ExcludedGroups" field.
func (*MangaMutation) AppendFilteredGroups ¶
func (m *MangaMutation) AppendFilteredGroups(s []string)
AppendFilteredGroups adds s to the "FilteredGroups" field.
func (*MangaMutation) AppendedExcludedGroups ¶ added in v2.4.0
func (m *MangaMutation) AppendedExcludedGroups() ([]string, bool)
AppendedExcludedGroups returns the list of values that were appended to the "ExcludedGroups" field in this mutation.
func (*MangaMutation) AppendedFilteredGroups ¶
func (m *MangaMutation) AppendedFilteredGroups() ([]string, bool)
AppendedFilteredGroups returns the list of values that were appended to the "FilteredGroups" field in this mutation.
func (*MangaMutation) ChaptersCleared ¶
func (m *MangaMutation) ChaptersCleared() bool
ChaptersCleared reports if the "Chapters" edge to the Chapter entity was cleared.
func (*MangaMutation) ChaptersIDs ¶
func (m *MangaMutation) ChaptersIDs() (ids []int)
ChaptersIDs returns the "Chapters" edge IDs in the mutation.
func (*MangaMutation) ClearChapters ¶
func (m *MangaMutation) ClearChapters()
ClearChapters clears the "Chapters" edge to the Chapter entity.
func (*MangaMutation) ClearEdge ¶
func (m *MangaMutation) 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 (*MangaMutation) ClearExcludedGroups ¶ added in v2.4.0
func (m *MangaMutation) ClearExcludedGroups()
ClearExcludedGroups clears the value of the "ExcludedGroups" field.
func (*MangaMutation) ClearField ¶
func (m *MangaMutation) 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 (*MangaMutation) ClearFilteredGroups ¶ added in v2.4.0
func (m *MangaMutation) ClearFilteredGroups()
ClearFilteredGroups clears the value of the "FilteredGroups" field.
func (*MangaMutation) ClearedEdges ¶
func (m *MangaMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*MangaMutation) ClearedFields ¶
func (m *MangaMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (MangaMutation) Client ¶
func (m MangaMutation) 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 (*MangaMutation) EdgeCleared ¶
func (m *MangaMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*MangaMutation) ExcludedGroups ¶ added in v2.4.0
func (m *MangaMutation) ExcludedGroups() (r []string, exists bool)
ExcludedGroups returns the value of the "ExcludedGroups" field in the mutation.
func (*MangaMutation) ExcludedGroupsCleared ¶ added in v2.4.0
func (m *MangaMutation) ExcludedGroupsCleared() bool
ExcludedGroupsCleared returns if the "ExcludedGroups" field was cleared in this mutation.
func (*MangaMutation) Field ¶
func (m *MangaMutation) 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 (*MangaMutation) FieldCleared ¶
func (m *MangaMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*MangaMutation) Fields ¶
func (m *MangaMutation) 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 (*MangaMutation) FilteredGroups ¶
func (m *MangaMutation) FilteredGroups() (r []string, exists bool)
FilteredGroups returns the value of the "FilteredGroups" field in the mutation.
func (*MangaMutation) FilteredGroupsCleared ¶ added in v2.4.0
func (m *MangaMutation) FilteredGroupsCleared() bool
FilteredGroupsCleared returns if the "FilteredGroups" field was cleared in this mutation.
func (*MangaMutation) ID ¶
func (m *MangaMutation) 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 (*MangaMutation) IDs ¶
func (m *MangaMutation) 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 (*MangaMutation) MangaID ¶
func (m *MangaMutation) MangaID() (r string, exists bool)
MangaID returns the value of the "MangaID" field in the mutation.
func (*MangaMutation) Mapping ¶
func (m *MangaMutation) Mapping() (r string, exists bool)
Mapping returns the value of the "Mapping" field in the mutation.
func (*MangaMutation) OldExcludedGroups ¶ added in v2.4.0
func (m *MangaMutation) OldExcludedGroups(ctx context.Context) (v []string, err error)
OldExcludedGroups returns the old "ExcludedGroups" field's value of the Manga entity. If the Manga 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 (*MangaMutation) 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 (*MangaMutation) OldFilteredGroups ¶
func (m *MangaMutation) OldFilteredGroups(ctx context.Context) (v []string, err error)
OldFilteredGroups returns the old "FilteredGroups" field's value of the Manga entity. If the Manga 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 (*MangaMutation) OldMangaID ¶
func (m *MangaMutation) OldMangaID(ctx context.Context) (v string, err error)
OldMangaID returns the old "MangaID" field's value of the Manga entity. If the Manga 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 (*MangaMutation) OldMapping ¶
func (m *MangaMutation) OldMapping(ctx context.Context) (v string, err error)
OldMapping returns the old "Mapping" field's value of the Manga entity. If the Manga 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 (*MangaMutation) OldRegisteredOn ¶
OldRegisteredOn returns the old "RegisteredOn" field's value of the Manga entity. If the Manga 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 (*MangaMutation) OldSource ¶
func (m *MangaMutation) OldSource(ctx context.Context) (v string, err error)
OldSource returns the old "Source" field's value of the Manga entity. If the Manga 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 (*MangaMutation) OldTitle ¶
func (m *MangaMutation) OldTitle(ctx context.Context) (v string, err error)
OldTitle returns the old "Title" field's value of the Manga entity. If the Manga 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 (*MangaMutation) RegisteredOn ¶
func (m *MangaMutation) RegisteredOn() (r time.Time, exists bool)
RegisteredOn returns the value of the "RegisteredOn" field in the mutation.
func (*MangaMutation) RemoveChapterIDs ¶
func (m *MangaMutation) RemoveChapterIDs(ids ...int)
RemoveChapterIDs removes the "Chapters" edge to the Chapter entity by IDs.
func (*MangaMutation) RemovedChaptersIDs ¶
func (m *MangaMutation) RemovedChaptersIDs() (ids []int)
RemovedChapters returns the removed IDs of the "Chapters" edge to the Chapter entity.
func (*MangaMutation) RemovedEdges ¶
func (m *MangaMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*MangaMutation) RemovedIDs ¶
func (m *MangaMutation) 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 (*MangaMutation) ResetChapters ¶
func (m *MangaMutation) ResetChapters()
ResetChapters resets all changes to the "Chapters" edge.
func (*MangaMutation) ResetEdge ¶
func (m *MangaMutation) 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 (*MangaMutation) ResetExcludedGroups ¶ added in v2.4.0
func (m *MangaMutation) ResetExcludedGroups()
ResetExcludedGroups resets all changes to the "ExcludedGroups" field.
func (*MangaMutation) ResetField ¶
func (m *MangaMutation) 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 (*MangaMutation) ResetFilteredGroups ¶
func (m *MangaMutation) ResetFilteredGroups()
ResetFilteredGroups resets all changes to the "FilteredGroups" field.
func (*MangaMutation) ResetMangaID ¶
func (m *MangaMutation) ResetMangaID()
ResetMangaID resets all changes to the "MangaID" field.
func (*MangaMutation) ResetMapping ¶
func (m *MangaMutation) ResetMapping()
ResetMapping resets all changes to the "Mapping" field.
func (*MangaMutation) ResetRegisteredOn ¶
func (m *MangaMutation) ResetRegisteredOn()
ResetRegisteredOn resets all changes to the "RegisteredOn" field.
func (*MangaMutation) ResetSource ¶
func (m *MangaMutation) ResetSource()
ResetSource resets all changes to the "Source" field.
func (*MangaMutation) ResetTitle ¶
func (m *MangaMutation) ResetTitle()
ResetTitle resets all changes to the "Title" field.
func (*MangaMutation) SetExcludedGroups ¶ added in v2.4.0
func (m *MangaMutation) SetExcludedGroups(s []string)
SetExcludedGroups sets the "ExcludedGroups" field.
func (*MangaMutation) SetField ¶
func (m *MangaMutation) 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 (*MangaMutation) SetFilteredGroups ¶
func (m *MangaMutation) SetFilteredGroups(s []string)
SetFilteredGroups sets the "FilteredGroups" field.
func (*MangaMutation) SetMangaID ¶
func (m *MangaMutation) SetMangaID(s string)
SetMangaID sets the "MangaID" field.
func (*MangaMutation) SetMapping ¶
func (m *MangaMutation) SetMapping(s string)
SetMapping sets the "Mapping" field.
func (*MangaMutation) SetOp ¶
func (m *MangaMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*MangaMutation) SetRegisteredOn ¶
func (m *MangaMutation) SetRegisteredOn(t time.Time)
SetRegisteredOn sets the "RegisteredOn" field.
func (*MangaMutation) SetSource ¶
func (m *MangaMutation) SetSource(s string)
SetSource sets the "Source" field.
func (*MangaMutation) SetTitle ¶
func (m *MangaMutation) SetTitle(s string)
SetTitle sets the "Title" field.
func (*MangaMutation) Source ¶
func (m *MangaMutation) Source() (r string, exists bool)
Source returns the value of the "Source" field in the mutation.
func (*MangaMutation) Title ¶
func (m *MangaMutation) Title() (r string, exists bool)
Title returns the value of the "Title" field in the mutation.
func (MangaMutation) Tx ¶
func (m MangaMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*MangaMutation) Type ¶
func (m *MangaMutation) Type() string
Type returns the node type of this mutation (Manga).
func (*MangaMutation) Where ¶
func (m *MangaMutation) Where(ps ...predicate.Manga)
Where appends a list predicates to the MangaMutation builder.
func (*MangaMutation) WhereP ¶
func (m *MangaMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the MangaMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type MangaQuery ¶
type MangaQuery struct {
// contains filtered or unexported fields
}
MangaQuery is the builder for querying Manga entities.
func (*MangaQuery) Aggregate ¶
func (mq *MangaQuery) Aggregate(fns ...AggregateFunc) *MangaSelect
Aggregate returns a MangaSelect configured with the given aggregations.
func (*MangaQuery) All ¶
func (mq *MangaQuery) All(ctx context.Context) ([]*Manga, error)
All executes the query and returns a list of Mangas.
func (*MangaQuery) AllX ¶
func (mq *MangaQuery) AllX(ctx context.Context) []*Manga
AllX is like All, but panics if an error occurs.
func (*MangaQuery) Clone ¶
func (mq *MangaQuery) Clone() *MangaQuery
Clone returns a duplicate of the MangaQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*MangaQuery) Count ¶
func (mq *MangaQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*MangaQuery) CountX ¶
func (mq *MangaQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*MangaQuery) Exist ¶
func (mq *MangaQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*MangaQuery) ExistX ¶
func (mq *MangaQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*MangaQuery) First ¶
func (mq *MangaQuery) First(ctx context.Context) (*Manga, error)
First returns the first Manga entity from the query. Returns a *NotFoundError when no Manga was found.
func (*MangaQuery) FirstID ¶
func (mq *MangaQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Manga ID from the query. Returns a *NotFoundError when no Manga ID was found.
func (*MangaQuery) FirstIDX ¶
func (mq *MangaQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*MangaQuery) FirstX ¶
func (mq *MangaQuery) FirstX(ctx context.Context) *Manga
FirstX is like First, but panics if an error occurs.
func (*MangaQuery) GroupBy ¶
func (mq *MangaQuery) GroupBy(field string, fields ...string) *MangaGroupBy
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 { MangaID string `json:"MangaID,omitempty"` Count int `json:"count,omitempty"` } client.Manga.Query(). GroupBy(manga.FieldMangaID). Aggregate(ent.Count()). Scan(ctx, &v)
func (*MangaQuery) IDs ¶
func (mq *MangaQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Manga IDs.
func (*MangaQuery) IDsX ¶
func (mq *MangaQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*MangaQuery) Limit ¶
func (mq *MangaQuery) Limit(limit int) *MangaQuery
Limit the number of records to be returned by this query.
func (*MangaQuery) Offset ¶
func (mq *MangaQuery) Offset(offset int) *MangaQuery
Offset to start from.
func (*MangaQuery) Only ¶
func (mq *MangaQuery) Only(ctx context.Context) (*Manga, error)
Only returns a single Manga entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Manga entity is found. Returns a *NotFoundError when no Manga entities are found.
func (*MangaQuery) OnlyID ¶
func (mq *MangaQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Manga ID in the query. Returns a *NotSingularError when more than one Manga ID is found. Returns a *NotFoundError when no entities are found.
func (*MangaQuery) OnlyIDX ¶
func (mq *MangaQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*MangaQuery) OnlyX ¶
func (mq *MangaQuery) OnlyX(ctx context.Context) *Manga
OnlyX is like Only, but panics if an error occurs.
func (*MangaQuery) Order ¶
func (mq *MangaQuery) Order(o ...manga.OrderOption) *MangaQuery
Order specifies how the records should be ordered.
func (*MangaQuery) QueryChapters ¶
func (mq *MangaQuery) QueryChapters() *ChapterQuery
QueryChapters chains the current query on the "Chapters" edge.
func (*MangaQuery) Select ¶
func (mq *MangaQuery) Select(fields ...string) *MangaSelect
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 { MangaID string `json:"MangaID,omitempty"` } client.Manga.Query(). Select(manga.FieldMangaID). Scan(ctx, &v)
func (*MangaQuery) Unique ¶
func (mq *MangaQuery) Unique(unique bool) *MangaQuery
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 (*MangaQuery) Where ¶
func (mq *MangaQuery) Where(ps ...predicate.Manga) *MangaQuery
Where adds a new predicate for the MangaQuery builder.
func (*MangaQuery) WithChapters ¶
func (mq *MangaQuery) WithChapters(opts ...func(*ChapterQuery)) *MangaQuery
WithChapters tells the query-builder to eager-load the nodes that are connected to the "Chapters" edge. The optional arguments are used to configure the query builder of the edge.
type MangaSelect ¶
type MangaSelect struct { *MangaQuery // contains filtered or unexported fields }
MangaSelect is the builder for selecting fields of Manga entities.
func (*MangaSelect) Aggregate ¶
func (ms *MangaSelect) Aggregate(fns ...AggregateFunc) *MangaSelect
Aggregate adds the given aggregation functions to the selector query.
func (*MangaSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*MangaSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*MangaSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*MangaSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*MangaSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*MangaSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*MangaSelect) Scan ¶
func (ms *MangaSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*MangaSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type MangaUpdate ¶
type MangaUpdate struct {
// contains filtered or unexported fields
}
MangaUpdate is the builder for updating Manga entities.
func (*MangaUpdate) AddChapterIDs ¶
func (mu *MangaUpdate) AddChapterIDs(ids ...int) *MangaUpdate
AddChapterIDs adds the "Chapters" edge to the Chapter entity by IDs.
func (*MangaUpdate) AddChapters ¶
func (mu *MangaUpdate) AddChapters(c ...*Chapter) *MangaUpdate
AddChapters adds the "Chapters" edges to the Chapter entity.
func (*MangaUpdate) AppendExcludedGroups ¶ added in v2.4.0
func (mu *MangaUpdate) AppendExcludedGroups(s []string) *MangaUpdate
AppendExcludedGroups appends s to the "ExcludedGroups" field.
func (*MangaUpdate) AppendFilteredGroups ¶
func (mu *MangaUpdate) AppendFilteredGroups(s []string) *MangaUpdate
AppendFilteredGroups appends s to the "FilteredGroups" field.
func (*MangaUpdate) ClearChapters ¶
func (mu *MangaUpdate) ClearChapters() *MangaUpdate
ClearChapters clears all "Chapters" edges to the Chapter entity.
func (*MangaUpdate) ClearExcludedGroups ¶ added in v2.4.0
func (mu *MangaUpdate) ClearExcludedGroups() *MangaUpdate
ClearExcludedGroups clears the value of the "ExcludedGroups" field.
func (*MangaUpdate) ClearFilteredGroups ¶ added in v2.4.0
func (mu *MangaUpdate) ClearFilteredGroups() *MangaUpdate
ClearFilteredGroups clears the value of the "FilteredGroups" field.
func (*MangaUpdate) Exec ¶
func (mu *MangaUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*MangaUpdate) ExecX ¶
func (mu *MangaUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MangaUpdate) Mutation ¶
func (mu *MangaUpdate) Mutation() *MangaMutation
Mutation returns the MangaMutation object of the builder.
func (*MangaUpdate) RemoveChapterIDs ¶
func (mu *MangaUpdate) RemoveChapterIDs(ids ...int) *MangaUpdate
RemoveChapterIDs removes the "Chapters" edge to Chapter entities by IDs.
func (*MangaUpdate) RemoveChapters ¶
func (mu *MangaUpdate) RemoveChapters(c ...*Chapter) *MangaUpdate
RemoveChapters removes "Chapters" edges to Chapter entities.
func (*MangaUpdate) Save ¶
func (mu *MangaUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*MangaUpdate) SaveX ¶
func (mu *MangaUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*MangaUpdate) SetExcludedGroups ¶ added in v2.4.0
func (mu *MangaUpdate) SetExcludedGroups(s []string) *MangaUpdate
SetExcludedGroups sets the "ExcludedGroups" field.
func (*MangaUpdate) SetFilteredGroups ¶
func (mu *MangaUpdate) SetFilteredGroups(s []string) *MangaUpdate
SetFilteredGroups sets the "FilteredGroups" field.
func (*MangaUpdate) SetMangaID ¶
func (mu *MangaUpdate) SetMangaID(s string) *MangaUpdate
SetMangaID sets the "MangaID" field.
func (*MangaUpdate) SetMapping ¶
func (mu *MangaUpdate) SetMapping(s string) *MangaUpdate
SetMapping sets the "Mapping" field.
func (*MangaUpdate) SetNillableMangaID ¶ added in v2.3.0
func (mu *MangaUpdate) SetNillableMangaID(s *string) *MangaUpdate
SetNillableMangaID sets the "MangaID" field if the given value is not nil.
func (*MangaUpdate) SetNillableMapping ¶ added in v2.3.0
func (mu *MangaUpdate) SetNillableMapping(s *string) *MangaUpdate
SetNillableMapping sets the "Mapping" field if the given value is not nil.
func (*MangaUpdate) SetNillableRegisteredOn ¶ added in v2.3.0
func (mu *MangaUpdate) SetNillableRegisteredOn(t *time.Time) *MangaUpdate
SetNillableRegisteredOn sets the "RegisteredOn" field if the given value is not nil.
func (*MangaUpdate) SetNillableSource ¶ added in v2.3.0
func (mu *MangaUpdate) SetNillableSource(s *string) *MangaUpdate
SetNillableSource sets the "Source" field if the given value is not nil.
func (*MangaUpdate) SetNillableTitle ¶ added in v2.3.0
func (mu *MangaUpdate) SetNillableTitle(s *string) *MangaUpdate
SetNillableTitle sets the "Title" field if the given value is not nil.
func (*MangaUpdate) SetRegisteredOn ¶
func (mu *MangaUpdate) SetRegisteredOn(t time.Time) *MangaUpdate
SetRegisteredOn sets the "RegisteredOn" field.
func (*MangaUpdate) SetSource ¶
func (mu *MangaUpdate) SetSource(s string) *MangaUpdate
SetSource sets the "Source" field.
func (*MangaUpdate) SetTitle ¶
func (mu *MangaUpdate) SetTitle(s string) *MangaUpdate
SetTitle sets the "Title" field.
func (*MangaUpdate) Where ¶
func (mu *MangaUpdate) Where(ps ...predicate.Manga) *MangaUpdate
Where appends a list predicates to the MangaUpdate builder.
type MangaUpdateOne ¶
type MangaUpdateOne struct {
// contains filtered or unexported fields
}
MangaUpdateOne is the builder for updating a single Manga entity.
func (*MangaUpdateOne) AddChapterIDs ¶
func (muo *MangaUpdateOne) AddChapterIDs(ids ...int) *MangaUpdateOne
AddChapterIDs adds the "Chapters" edge to the Chapter entity by IDs.
func (*MangaUpdateOne) AddChapters ¶
func (muo *MangaUpdateOne) AddChapters(c ...*Chapter) *MangaUpdateOne
AddChapters adds the "Chapters" edges to the Chapter entity.
func (*MangaUpdateOne) AppendExcludedGroups ¶ added in v2.4.0
func (muo *MangaUpdateOne) AppendExcludedGroups(s []string) *MangaUpdateOne
AppendExcludedGroups appends s to the "ExcludedGroups" field.
func (*MangaUpdateOne) AppendFilteredGroups ¶
func (muo *MangaUpdateOne) AppendFilteredGroups(s []string) *MangaUpdateOne
AppendFilteredGroups appends s to the "FilteredGroups" field.
func (*MangaUpdateOne) ClearChapters ¶
func (muo *MangaUpdateOne) ClearChapters() *MangaUpdateOne
ClearChapters clears all "Chapters" edges to the Chapter entity.
func (*MangaUpdateOne) ClearExcludedGroups ¶ added in v2.4.0
func (muo *MangaUpdateOne) ClearExcludedGroups() *MangaUpdateOne
ClearExcludedGroups clears the value of the "ExcludedGroups" field.
func (*MangaUpdateOne) ClearFilteredGroups ¶ added in v2.4.0
func (muo *MangaUpdateOne) ClearFilteredGroups() *MangaUpdateOne
ClearFilteredGroups clears the value of the "FilteredGroups" field.
func (*MangaUpdateOne) Exec ¶
func (muo *MangaUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*MangaUpdateOne) ExecX ¶
func (muo *MangaUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MangaUpdateOne) Mutation ¶
func (muo *MangaUpdateOne) Mutation() *MangaMutation
Mutation returns the MangaMutation object of the builder.
func (*MangaUpdateOne) RemoveChapterIDs ¶
func (muo *MangaUpdateOne) RemoveChapterIDs(ids ...int) *MangaUpdateOne
RemoveChapterIDs removes the "Chapters" edge to Chapter entities by IDs.
func (*MangaUpdateOne) RemoveChapters ¶
func (muo *MangaUpdateOne) RemoveChapters(c ...*Chapter) *MangaUpdateOne
RemoveChapters removes "Chapters" edges to Chapter entities.
func (*MangaUpdateOne) Save ¶
func (muo *MangaUpdateOne) Save(ctx context.Context) (*Manga, error)
Save executes the query and returns the updated Manga entity.
func (*MangaUpdateOne) SaveX ¶
func (muo *MangaUpdateOne) SaveX(ctx context.Context) *Manga
SaveX is like Save, but panics if an error occurs.
func (*MangaUpdateOne) Select ¶
func (muo *MangaUpdateOne) Select(field string, fields ...string) *MangaUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*MangaUpdateOne) SetExcludedGroups ¶ added in v2.4.0
func (muo *MangaUpdateOne) SetExcludedGroups(s []string) *MangaUpdateOne
SetExcludedGroups sets the "ExcludedGroups" field.
func (*MangaUpdateOne) SetFilteredGroups ¶
func (muo *MangaUpdateOne) SetFilteredGroups(s []string) *MangaUpdateOne
SetFilteredGroups sets the "FilteredGroups" field.
func (*MangaUpdateOne) SetMangaID ¶
func (muo *MangaUpdateOne) SetMangaID(s string) *MangaUpdateOne
SetMangaID sets the "MangaID" field.
func (*MangaUpdateOne) SetMapping ¶
func (muo *MangaUpdateOne) SetMapping(s string) *MangaUpdateOne
SetMapping sets the "Mapping" field.
func (*MangaUpdateOne) SetNillableMangaID ¶ added in v2.3.0
func (muo *MangaUpdateOne) SetNillableMangaID(s *string) *MangaUpdateOne
SetNillableMangaID sets the "MangaID" field if the given value is not nil.
func (*MangaUpdateOne) SetNillableMapping ¶ added in v2.3.0
func (muo *MangaUpdateOne) SetNillableMapping(s *string) *MangaUpdateOne
SetNillableMapping sets the "Mapping" field if the given value is not nil.
func (*MangaUpdateOne) SetNillableRegisteredOn ¶ added in v2.3.0
func (muo *MangaUpdateOne) SetNillableRegisteredOn(t *time.Time) *MangaUpdateOne
SetNillableRegisteredOn sets the "RegisteredOn" field if the given value is not nil.
func (*MangaUpdateOne) SetNillableSource ¶ added in v2.3.0
func (muo *MangaUpdateOne) SetNillableSource(s *string) *MangaUpdateOne
SetNillableSource sets the "Source" field if the given value is not nil.
func (*MangaUpdateOne) SetNillableTitle ¶ added in v2.3.0
func (muo *MangaUpdateOne) SetNillableTitle(s *string) *MangaUpdateOne
SetNillableTitle sets the "Title" field if the given value is not nil.
func (*MangaUpdateOne) SetRegisteredOn ¶
func (muo *MangaUpdateOne) SetRegisteredOn(t time.Time) *MangaUpdateOne
SetRegisteredOn sets the "RegisteredOn" field.
func (*MangaUpdateOne) SetSource ¶
func (muo *MangaUpdateOne) SetSource(s string) *MangaUpdateOne
SetSource sets the "Source" field.
func (*MangaUpdateOne) SetTitle ¶
func (muo *MangaUpdateOne) SetTitle(s string) *MangaUpdateOne
SetTitle sets the "Title" field.
func (*MangaUpdateOne) Where ¶
func (muo *MangaUpdateOne) Where(ps ...predicate.Manga) *MangaUpdateOne
Where appends a list predicates to the MangaUpdate builder.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError returns when trying to fetch a specific entity and it was not found in the database.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Error implements the error interface.
type NotLoadedError ¶
type NotLoadedError struct {
// contains filtered or unexported fields
}
NotLoadedError returns when trying to get a node that was not loaded by the query.
func (*NotLoadedError) Error ¶
func (e *NotLoadedError) Error() string
Error implements the error interface.
type NotSingularError ¶
type NotSingularError struct {
// contains filtered or unexported fields
}
NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.
func (*NotSingularError) Error ¶
func (e *NotSingularError) Error() string
Error implements the error interface.
type OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
type QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
ent aliases to avoid import conflicts in user's code.
type QueryContext ¶
type QueryContext = ent.QueryContext
ent aliases to avoid import conflicts in user's code.
type RollbackFunc ¶
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 TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // Chapter is the client for interacting with the Chapter builders. Chapter *ChapterClient // Manga is the client for interacting with the Manga builders. Manga *MangaClient // 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 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.