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 Blocks
- type BlocksClient
- func (c *BlocksClient) Create() *BlocksCreate
- func (c *BlocksClient) CreateBulk(builders ...*BlocksCreate) *BlocksCreateBulk
- func (c *BlocksClient) Delete() *BlocksDelete
- func (c *BlocksClient) DeleteOne(b *Blocks) *BlocksDeleteOne
- func (c *BlocksClient) DeleteOneID(id int) *BlocksDeleteOne
- func (c *BlocksClient) Get(ctx context.Context, id int) (*Blocks, error)
- func (c *BlocksClient) GetX(ctx context.Context, id int) *Blocks
- func (c *BlocksClient) Hooks() []Hook
- func (c *BlocksClient) Intercept(interceptors ...Interceptor)
- func (c *BlocksClient) Interceptors() []Interceptor
- func (c *BlocksClient) MapCreateBulk(slice any, setFunc func(*BlocksCreate, int)) *BlocksCreateBulk
- func (c *BlocksClient) Query() *BlocksQuery
- func (c *BlocksClient) QueryIsp(b *Blocks) *IspsQuery
- func (c *BlocksClient) QuerySite(b *Blocks) *SitesQuery
- func (c *BlocksClient) Update() *BlocksUpdate
- func (c *BlocksClient) UpdateOne(b *Blocks) *BlocksUpdateOne
- func (c *BlocksClient) UpdateOneID(id int) *BlocksUpdateOne
- func (c *BlocksClient) Use(hooks ...Hook)
- type BlocksCreate
- func (bc *BlocksCreate) Exec(ctx context.Context) error
- func (bc *BlocksCreate) ExecX(ctx context.Context)
- func (bc *BlocksCreate) Mutation() *BlocksMutation
- func (bc *BlocksCreate) Save(ctx context.Context) (*Blocks, error)
- func (bc *BlocksCreate) SaveX(ctx context.Context) *Blocks
- func (bc *BlocksCreate) SetBlockReports(i int) *BlocksCreate
- func (bc *BlocksCreate) SetCreatedAt(t time.Time) *BlocksCreate
- func (bc *BlocksCreate) SetIsp(i *Isps) *BlocksCreate
- func (bc *BlocksCreate) SetIspID(i int) *BlocksCreate
- func (bc *BlocksCreate) SetLastReportedAt(t time.Time) *BlocksCreate
- func (bc *BlocksCreate) SetNillableBlockReports(i *int) *BlocksCreate
- func (bc *BlocksCreate) SetNillableCreatedAt(t *time.Time) *BlocksCreate
- func (bc *BlocksCreate) SetNillableUnblockReports(i *int) *BlocksCreate
- func (bc *BlocksCreate) SetNillableUpdatedAt(t *time.Time) *BlocksCreate
- func (bc *BlocksCreate) SetSite(s *Sites) *BlocksCreate
- func (bc *BlocksCreate) SetSiteID(i int) *BlocksCreate
- func (bc *BlocksCreate) SetUnblockReports(i int) *BlocksCreate
- func (bc *BlocksCreate) SetUpdatedAt(t time.Time) *BlocksCreate
- type BlocksCreateBulk
- type BlocksDelete
- type BlocksDeleteOne
- type BlocksEdges
- type BlocksGroupBy
- func (bgb *BlocksGroupBy) Aggregate(fns ...AggregateFunc) *BlocksGroupBy
- func (s *BlocksGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *BlocksGroupBy) BoolX(ctx context.Context) bool
- func (s *BlocksGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *BlocksGroupBy) BoolsX(ctx context.Context) []bool
- func (s *BlocksGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *BlocksGroupBy) Float64X(ctx context.Context) float64
- func (s *BlocksGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *BlocksGroupBy) Float64sX(ctx context.Context) []float64
- func (s *BlocksGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *BlocksGroupBy) IntX(ctx context.Context) int
- func (s *BlocksGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *BlocksGroupBy) IntsX(ctx context.Context) []int
- func (bgb *BlocksGroupBy) Scan(ctx context.Context, v any) error
- func (s *BlocksGroupBy) ScanX(ctx context.Context, v any)
- func (s *BlocksGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *BlocksGroupBy) StringX(ctx context.Context) string
- func (s *BlocksGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *BlocksGroupBy) StringsX(ctx context.Context) []string
- type BlocksMutation
- func (m *BlocksMutation) AddBlockReports(i int)
- func (m *BlocksMutation) AddField(name string, value ent.Value) error
- func (m *BlocksMutation) AddUnblockReports(i int)
- func (m *BlocksMutation) AddedBlockReports() (r int, exists bool)
- func (m *BlocksMutation) AddedEdges() []string
- func (m *BlocksMutation) AddedField(name string) (ent.Value, bool)
- func (m *BlocksMutation) AddedFields() []string
- func (m *BlocksMutation) AddedIDs(name string) []ent.Value
- func (m *BlocksMutation) AddedUnblockReports() (r int, exists bool)
- func (m *BlocksMutation) BlockReports() (r int, exists bool)
- func (m *BlocksMutation) ClearEdge(name string) error
- func (m *BlocksMutation) ClearField(name string) error
- func (m *BlocksMutation) ClearIsp()
- func (m *BlocksMutation) ClearSite()
- func (m *BlocksMutation) ClearedEdges() []string
- func (m *BlocksMutation) ClearedFields() []string
- func (m BlocksMutation) Client() *Client
- func (m *BlocksMutation) CreatedAt() (r time.Time, exists bool)
- func (m *BlocksMutation) EdgeCleared(name string) bool
- func (m *BlocksMutation) Field(name string) (ent.Value, bool)
- func (m *BlocksMutation) FieldCleared(name string) bool
- func (m *BlocksMutation) Fields() []string
- func (m *BlocksMutation) ID() (id int, exists bool)
- func (m *BlocksMutation) IDs(ctx context.Context) ([]int, error)
- func (m *BlocksMutation) IspCleared() bool
- func (m *BlocksMutation) IspID() (r int, exists bool)
- func (m *BlocksMutation) IspIDs() (ids []int)
- func (m *BlocksMutation) LastReportedAt() (r time.Time, exists bool)
- func (m *BlocksMutation) OldBlockReports(ctx context.Context) (v int, err error)
- func (m *BlocksMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *BlocksMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *BlocksMutation) OldIspID(ctx context.Context) (v int, err error)
- func (m *BlocksMutation) OldLastReportedAt(ctx context.Context) (v time.Time, err error)
- func (m *BlocksMutation) OldSiteID(ctx context.Context) (v int, err error)
- func (m *BlocksMutation) OldUnblockReports(ctx context.Context) (v int, err error)
- func (m *BlocksMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *BlocksMutation) Op() Op
- func (m *BlocksMutation) RemovedEdges() []string
- func (m *BlocksMutation) RemovedIDs(name string) []ent.Value
- func (m *BlocksMutation) ResetBlockReports()
- func (m *BlocksMutation) ResetCreatedAt()
- func (m *BlocksMutation) ResetEdge(name string) error
- func (m *BlocksMutation) ResetField(name string) error
- func (m *BlocksMutation) ResetIsp()
- func (m *BlocksMutation) ResetIspID()
- func (m *BlocksMutation) ResetLastReportedAt()
- func (m *BlocksMutation) ResetSite()
- func (m *BlocksMutation) ResetSiteID()
- func (m *BlocksMutation) ResetUnblockReports()
- func (m *BlocksMutation) ResetUpdatedAt()
- func (m *BlocksMutation) SetBlockReports(i int)
- func (m *BlocksMutation) SetCreatedAt(t time.Time)
- func (m *BlocksMutation) SetField(name string, value ent.Value) error
- func (m *BlocksMutation) SetIspID(i int)
- func (m *BlocksMutation) SetLastReportedAt(t time.Time)
- func (m *BlocksMutation) SetOp(op Op)
- func (m *BlocksMutation) SetSiteID(i int)
- func (m *BlocksMutation) SetUnblockReports(i int)
- func (m *BlocksMutation) SetUpdatedAt(t time.Time)
- func (m *BlocksMutation) SiteCleared() bool
- func (m *BlocksMutation) SiteID() (r int, exists bool)
- func (m *BlocksMutation) SiteIDs() (ids []int)
- func (m BlocksMutation) Tx() (*Tx, error)
- func (m *BlocksMutation) Type() string
- func (m *BlocksMutation) UnblockReports() (r int, exists bool)
- func (m *BlocksMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *BlocksMutation) Where(ps ...predicate.Blocks)
- func (m *BlocksMutation) WhereP(ps ...func(*sql.Selector))
- type BlocksQuery
- func (bq *BlocksQuery) Aggregate(fns ...AggregateFunc) *BlocksSelect
- func (bq *BlocksQuery) All(ctx context.Context) ([]*Blocks, error)
- func (bq *BlocksQuery) AllX(ctx context.Context) []*Blocks
- func (bq *BlocksQuery) Clone() *BlocksQuery
- func (bq *BlocksQuery) Count(ctx context.Context) (int, error)
- func (bq *BlocksQuery) CountX(ctx context.Context) int
- func (bq *BlocksQuery) Exist(ctx context.Context) (bool, error)
- func (bq *BlocksQuery) ExistX(ctx context.Context) bool
- func (bq *BlocksQuery) First(ctx context.Context) (*Blocks, error)
- func (bq *BlocksQuery) FirstID(ctx context.Context) (id int, err error)
- func (bq *BlocksQuery) FirstIDX(ctx context.Context) int
- func (bq *BlocksQuery) FirstX(ctx context.Context) *Blocks
- func (bq *BlocksQuery) GroupBy(field string, fields ...string) *BlocksGroupBy
- func (bq *BlocksQuery) IDs(ctx context.Context) (ids []int, err error)
- func (bq *BlocksQuery) IDsX(ctx context.Context) []int
- func (bq *BlocksQuery) Limit(limit int) *BlocksQuery
- func (bq *BlocksQuery) Offset(offset int) *BlocksQuery
- func (bq *BlocksQuery) Only(ctx context.Context) (*Blocks, error)
- func (bq *BlocksQuery) OnlyID(ctx context.Context) (id int, err error)
- func (bq *BlocksQuery) OnlyIDX(ctx context.Context) int
- func (bq *BlocksQuery) OnlyX(ctx context.Context) *Blocks
- func (bq *BlocksQuery) Order(o ...blocks.OrderOption) *BlocksQuery
- func (bq *BlocksQuery) QueryIsp() *IspsQuery
- func (bq *BlocksQuery) QuerySite() *SitesQuery
- func (bq *BlocksQuery) Select(fields ...string) *BlocksSelect
- func (bq *BlocksQuery) Unique(unique bool) *BlocksQuery
- func (bq *BlocksQuery) Where(ps ...predicate.Blocks) *BlocksQuery
- func (bq *BlocksQuery) WithIsp(opts ...func(*IspsQuery)) *BlocksQuery
- func (bq *BlocksQuery) WithSite(opts ...func(*SitesQuery)) *BlocksQuery
- type BlocksSelect
- func (bs *BlocksSelect) Aggregate(fns ...AggregateFunc) *BlocksSelect
- func (s *BlocksSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *BlocksSelect) BoolX(ctx context.Context) bool
- func (s *BlocksSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *BlocksSelect) BoolsX(ctx context.Context) []bool
- func (s *BlocksSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *BlocksSelect) Float64X(ctx context.Context) float64
- func (s *BlocksSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *BlocksSelect) Float64sX(ctx context.Context) []float64
- func (s *BlocksSelect) Int(ctx context.Context) (_ int, err error)
- func (s *BlocksSelect) IntX(ctx context.Context) int
- func (s *BlocksSelect) Ints(ctx context.Context) ([]int, error)
- func (s *BlocksSelect) IntsX(ctx context.Context) []int
- func (bs *BlocksSelect) Scan(ctx context.Context, v any) error
- func (s *BlocksSelect) ScanX(ctx context.Context, v any)
- func (s *BlocksSelect) String(ctx context.Context) (_ string, err error)
- func (s *BlocksSelect) StringX(ctx context.Context) string
- func (s *BlocksSelect) Strings(ctx context.Context) ([]string, error)
- func (s *BlocksSelect) StringsX(ctx context.Context) []string
- type BlocksSlice
- type BlocksUpdate
- func (bu *BlocksUpdate) AddBlockReports(i int) *BlocksUpdate
- func (bu *BlocksUpdate) AddUnblockReports(i int) *BlocksUpdate
- func (bu *BlocksUpdate) ClearIsp() *BlocksUpdate
- func (bu *BlocksUpdate) ClearSite() *BlocksUpdate
- func (bu *BlocksUpdate) Exec(ctx context.Context) error
- func (bu *BlocksUpdate) ExecX(ctx context.Context)
- func (bu *BlocksUpdate) Mutation() *BlocksMutation
- func (bu *BlocksUpdate) Save(ctx context.Context) (int, error)
- func (bu *BlocksUpdate) SaveX(ctx context.Context) int
- func (bu *BlocksUpdate) SetBlockReports(i int) *BlocksUpdate
- func (bu *BlocksUpdate) SetIsp(i *Isps) *BlocksUpdate
- func (bu *BlocksUpdate) SetIspID(i int) *BlocksUpdate
- func (bu *BlocksUpdate) SetLastReportedAt(t time.Time) *BlocksUpdate
- func (bu *BlocksUpdate) SetNillableBlockReports(i *int) *BlocksUpdate
- func (bu *BlocksUpdate) SetNillableIspID(i *int) *BlocksUpdate
- func (bu *BlocksUpdate) SetNillableLastReportedAt(t *time.Time) *BlocksUpdate
- func (bu *BlocksUpdate) SetNillableSiteID(i *int) *BlocksUpdate
- func (bu *BlocksUpdate) SetNillableUnblockReports(i *int) *BlocksUpdate
- func (bu *BlocksUpdate) SetSite(s *Sites) *BlocksUpdate
- func (bu *BlocksUpdate) SetSiteID(i int) *BlocksUpdate
- func (bu *BlocksUpdate) SetUnblockReports(i int) *BlocksUpdate
- func (bu *BlocksUpdate) SetUpdatedAt(t time.Time) *BlocksUpdate
- func (bu *BlocksUpdate) Where(ps ...predicate.Blocks) *BlocksUpdate
- type BlocksUpdateOne
- func (buo *BlocksUpdateOne) AddBlockReports(i int) *BlocksUpdateOne
- func (buo *BlocksUpdateOne) AddUnblockReports(i int) *BlocksUpdateOne
- func (buo *BlocksUpdateOne) ClearIsp() *BlocksUpdateOne
- func (buo *BlocksUpdateOne) ClearSite() *BlocksUpdateOne
- func (buo *BlocksUpdateOne) Exec(ctx context.Context) error
- func (buo *BlocksUpdateOne) ExecX(ctx context.Context)
- func (buo *BlocksUpdateOne) Mutation() *BlocksMutation
- func (buo *BlocksUpdateOne) Save(ctx context.Context) (*Blocks, error)
- func (buo *BlocksUpdateOne) SaveX(ctx context.Context) *Blocks
- func (buo *BlocksUpdateOne) Select(field string, fields ...string) *BlocksUpdateOne
- func (buo *BlocksUpdateOne) SetBlockReports(i int) *BlocksUpdateOne
- func (buo *BlocksUpdateOne) SetIsp(i *Isps) *BlocksUpdateOne
- func (buo *BlocksUpdateOne) SetIspID(i int) *BlocksUpdateOne
- func (buo *BlocksUpdateOne) SetLastReportedAt(t time.Time) *BlocksUpdateOne
- func (buo *BlocksUpdateOne) SetNillableBlockReports(i *int) *BlocksUpdateOne
- func (buo *BlocksUpdateOne) SetNillableIspID(i *int) *BlocksUpdateOne
- func (buo *BlocksUpdateOne) SetNillableLastReportedAt(t *time.Time) *BlocksUpdateOne
- func (buo *BlocksUpdateOne) SetNillableSiteID(i *int) *BlocksUpdateOne
- func (buo *BlocksUpdateOne) SetNillableUnblockReports(i *int) *BlocksUpdateOne
- func (buo *BlocksUpdateOne) SetSite(s *Sites) *BlocksUpdateOne
- func (buo *BlocksUpdateOne) SetSiteID(i int) *BlocksUpdateOne
- func (buo *BlocksUpdateOne) SetUnblockReports(i int) *BlocksUpdateOne
- func (buo *BlocksUpdateOne) SetUpdatedAt(t time.Time) *BlocksUpdateOne
- func (buo *BlocksUpdateOne) Where(ps ...predicate.Blocks) *BlocksUpdateOne
- type Categories
- func (c *Categories) QuerySites() *SitesQuery
- func (c *Categories) QuerySitesCategories() *SitesCategoriesQuery
- func (c *Categories) String() string
- func (c *Categories) Unwrap() *Categories
- func (c *Categories) Update() *CategoriesUpdateOne
- func (c *Categories) Value(name string) (ent.Value, error)
- type CategoriesClient
- func (c *CategoriesClient) Create() *CategoriesCreate
- func (c *CategoriesClient) CreateBulk(builders ...*CategoriesCreate) *CategoriesCreateBulk
- func (c *CategoriesClient) Delete() *CategoriesDelete
- func (c *CategoriesClient) DeleteOne(ca *Categories) *CategoriesDeleteOne
- func (c *CategoriesClient) DeleteOneID(id int) *CategoriesDeleteOne
- func (c *CategoriesClient) Get(ctx context.Context, id int) (*Categories, error)
- func (c *CategoriesClient) GetX(ctx context.Context, id int) *Categories
- func (c *CategoriesClient) Hooks() []Hook
- func (c *CategoriesClient) Intercept(interceptors ...Interceptor)
- func (c *CategoriesClient) Interceptors() []Interceptor
- func (c *CategoriesClient) MapCreateBulk(slice any, setFunc func(*CategoriesCreate, int)) *CategoriesCreateBulk
- func (c *CategoriesClient) Query() *CategoriesQuery
- func (c *CategoriesClient) QuerySites(ca *Categories) *SitesQuery
- func (c *CategoriesClient) QuerySitesCategories(ca *Categories) *SitesCategoriesQuery
- func (c *CategoriesClient) Update() *CategoriesUpdate
- func (c *CategoriesClient) UpdateOne(ca *Categories) *CategoriesUpdateOne
- func (c *CategoriesClient) UpdateOneID(id int) *CategoriesUpdateOne
- func (c *CategoriesClient) Use(hooks ...Hook)
- type CategoriesCreate
- func (cc *CategoriesCreate) AddSiteIDs(ids ...int) *CategoriesCreate
- func (cc *CategoriesCreate) AddSites(s ...*Sites) *CategoriesCreate
- func (cc *CategoriesCreate) AddSitesCategories(s ...*SitesCategories) *CategoriesCreate
- func (cc *CategoriesCreate) AddSitesCategoryIDs(ids ...int) *CategoriesCreate
- func (cc *CategoriesCreate) Exec(ctx context.Context) error
- func (cc *CategoriesCreate) ExecX(ctx context.Context)
- func (cc *CategoriesCreate) Mutation() *CategoriesMutation
- func (cc *CategoriesCreate) Save(ctx context.Context) (*Categories, error)
- func (cc *CategoriesCreate) SaveX(ctx context.Context) *Categories
- func (cc *CategoriesCreate) SetCreatedAt(t time.Time) *CategoriesCreate
- func (cc *CategoriesCreate) SetName(s string) *CategoriesCreate
- func (cc *CategoriesCreate) SetNillableCreatedAt(t *time.Time) *CategoriesCreate
- func (cc *CategoriesCreate) SetNillableUpdatedAt(t *time.Time) *CategoriesCreate
- func (cc *CategoriesCreate) SetUpdatedAt(t time.Time) *CategoriesCreate
- type CategoriesCreateBulk
- type CategoriesDelete
- type CategoriesDeleteOne
- type CategoriesEdges
- type CategoriesGroupBy
- func (cgb *CategoriesGroupBy) Aggregate(fns ...AggregateFunc) *CategoriesGroupBy
- func (s *CategoriesGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *CategoriesGroupBy) BoolX(ctx context.Context) bool
- func (s *CategoriesGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *CategoriesGroupBy) BoolsX(ctx context.Context) []bool
- func (s *CategoriesGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *CategoriesGroupBy) Float64X(ctx context.Context) float64
- func (s *CategoriesGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *CategoriesGroupBy) Float64sX(ctx context.Context) []float64
- func (s *CategoriesGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *CategoriesGroupBy) IntX(ctx context.Context) int
- func (s *CategoriesGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *CategoriesGroupBy) IntsX(ctx context.Context) []int
- func (cgb *CategoriesGroupBy) Scan(ctx context.Context, v any) error
- func (s *CategoriesGroupBy) ScanX(ctx context.Context, v any)
- func (s *CategoriesGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *CategoriesGroupBy) StringX(ctx context.Context) string
- func (s *CategoriesGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *CategoriesGroupBy) StringsX(ctx context.Context) []string
- type CategoriesMutation
- func (m *CategoriesMutation) AddField(name string, value ent.Value) error
- func (m *CategoriesMutation) AddSiteIDs(ids ...int)
- func (m *CategoriesMutation) AddSitesCategoryIDs(ids ...int)
- func (m *CategoriesMutation) AddedEdges() []string
- func (m *CategoriesMutation) AddedField(name string) (ent.Value, bool)
- func (m *CategoriesMutation) AddedFields() []string
- func (m *CategoriesMutation) AddedIDs(name string) []ent.Value
- func (m *CategoriesMutation) ClearEdge(name string) error
- func (m *CategoriesMutation) ClearField(name string) error
- func (m *CategoriesMutation) ClearSites()
- func (m *CategoriesMutation) ClearSitesCategories()
- func (m *CategoriesMutation) ClearedEdges() []string
- func (m *CategoriesMutation) ClearedFields() []string
- func (m CategoriesMutation) Client() *Client
- func (m *CategoriesMutation) CreatedAt() (r time.Time, exists bool)
- func (m *CategoriesMutation) EdgeCleared(name string) bool
- func (m *CategoriesMutation) Field(name string) (ent.Value, bool)
- func (m *CategoriesMutation) FieldCleared(name string) bool
- func (m *CategoriesMutation) Fields() []string
- func (m *CategoriesMutation) ID() (id int, exists bool)
- func (m *CategoriesMutation) IDs(ctx context.Context) ([]int, error)
- func (m *CategoriesMutation) Name() (r string, exists bool)
- func (m *CategoriesMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *CategoriesMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *CategoriesMutation) OldName(ctx context.Context) (v string, err error)
- func (m *CategoriesMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *CategoriesMutation) Op() Op
- func (m *CategoriesMutation) RemoveSiteIDs(ids ...int)
- func (m *CategoriesMutation) RemoveSitesCategoryIDs(ids ...int)
- func (m *CategoriesMutation) RemovedEdges() []string
- func (m *CategoriesMutation) RemovedIDs(name string) []ent.Value
- func (m *CategoriesMutation) RemovedSitesCategoriesIDs() (ids []int)
- func (m *CategoriesMutation) RemovedSitesIDs() (ids []int)
- func (m *CategoriesMutation) ResetCreatedAt()
- func (m *CategoriesMutation) ResetEdge(name string) error
- func (m *CategoriesMutation) ResetField(name string) error
- func (m *CategoriesMutation) ResetName()
- func (m *CategoriesMutation) ResetSites()
- func (m *CategoriesMutation) ResetSitesCategories()
- func (m *CategoriesMutation) ResetUpdatedAt()
- func (m *CategoriesMutation) SetCreatedAt(t time.Time)
- func (m *CategoriesMutation) SetField(name string, value ent.Value) error
- func (m *CategoriesMutation) SetName(s string)
- func (m *CategoriesMutation) SetOp(op Op)
- func (m *CategoriesMutation) SetUpdatedAt(t time.Time)
- func (m *CategoriesMutation) SitesCategoriesCleared() bool
- func (m *CategoriesMutation) SitesCategoriesIDs() (ids []int)
- func (m *CategoriesMutation) SitesCleared() bool
- func (m *CategoriesMutation) SitesIDs() (ids []int)
- func (m CategoriesMutation) Tx() (*Tx, error)
- func (m *CategoriesMutation) Type() string
- func (m *CategoriesMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *CategoriesMutation) Where(ps ...predicate.Categories)
- func (m *CategoriesMutation) WhereP(ps ...func(*sql.Selector))
- type CategoriesQuery
- func (cq *CategoriesQuery) Aggregate(fns ...AggregateFunc) *CategoriesSelect
- func (cq *CategoriesQuery) All(ctx context.Context) ([]*Categories, error)
- func (cq *CategoriesQuery) AllX(ctx context.Context) []*Categories
- func (cq *CategoriesQuery) Clone() *CategoriesQuery
- func (cq *CategoriesQuery) Count(ctx context.Context) (int, error)
- func (cq *CategoriesQuery) CountX(ctx context.Context) int
- func (cq *CategoriesQuery) Exist(ctx context.Context) (bool, error)
- func (cq *CategoriesQuery) ExistX(ctx context.Context) bool
- func (cq *CategoriesQuery) First(ctx context.Context) (*Categories, error)
- func (cq *CategoriesQuery) FirstID(ctx context.Context) (id int, err error)
- func (cq *CategoriesQuery) FirstIDX(ctx context.Context) int
- func (cq *CategoriesQuery) FirstX(ctx context.Context) *Categories
- func (cq *CategoriesQuery) GroupBy(field string, fields ...string) *CategoriesGroupBy
- func (cq *CategoriesQuery) IDs(ctx context.Context) (ids []int, err error)
- func (cq *CategoriesQuery) IDsX(ctx context.Context) []int
- func (cq *CategoriesQuery) Limit(limit int) *CategoriesQuery
- func (cq *CategoriesQuery) Offset(offset int) *CategoriesQuery
- func (cq *CategoriesQuery) Only(ctx context.Context) (*Categories, error)
- func (cq *CategoriesQuery) OnlyID(ctx context.Context) (id int, err error)
- func (cq *CategoriesQuery) OnlyIDX(ctx context.Context) int
- func (cq *CategoriesQuery) OnlyX(ctx context.Context) *Categories
- func (cq *CategoriesQuery) Order(o ...categories.OrderOption) *CategoriesQuery
- func (cq *CategoriesQuery) QuerySites() *SitesQuery
- func (cq *CategoriesQuery) QuerySitesCategories() *SitesCategoriesQuery
- func (cq *CategoriesQuery) Select(fields ...string) *CategoriesSelect
- func (cq *CategoriesQuery) Unique(unique bool) *CategoriesQuery
- func (cq *CategoriesQuery) Where(ps ...predicate.Categories) *CategoriesQuery
- func (cq *CategoriesQuery) WithSites(opts ...func(*SitesQuery)) *CategoriesQuery
- func (cq *CategoriesQuery) WithSitesCategories(opts ...func(*SitesCategoriesQuery)) *CategoriesQuery
- type CategoriesSelect
- func (cs *CategoriesSelect) Aggregate(fns ...AggregateFunc) *CategoriesSelect
- func (s *CategoriesSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *CategoriesSelect) BoolX(ctx context.Context) bool
- func (s *CategoriesSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *CategoriesSelect) BoolsX(ctx context.Context) []bool
- func (s *CategoriesSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *CategoriesSelect) Float64X(ctx context.Context) float64
- func (s *CategoriesSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *CategoriesSelect) Float64sX(ctx context.Context) []float64
- func (s *CategoriesSelect) Int(ctx context.Context) (_ int, err error)
- func (s *CategoriesSelect) IntX(ctx context.Context) int
- func (s *CategoriesSelect) Ints(ctx context.Context) ([]int, error)
- func (s *CategoriesSelect) IntsX(ctx context.Context) []int
- func (cs *CategoriesSelect) Scan(ctx context.Context, v any) error
- func (s *CategoriesSelect) ScanX(ctx context.Context, v any)
- func (s *CategoriesSelect) String(ctx context.Context) (_ string, err error)
- func (s *CategoriesSelect) StringX(ctx context.Context) string
- func (s *CategoriesSelect) Strings(ctx context.Context) ([]string, error)
- func (s *CategoriesSelect) StringsX(ctx context.Context) []string
- type CategoriesSlice
- type CategoriesUpdate
- func (cu *CategoriesUpdate) AddSiteIDs(ids ...int) *CategoriesUpdate
- func (cu *CategoriesUpdate) AddSites(s ...*Sites) *CategoriesUpdate
- func (cu *CategoriesUpdate) AddSitesCategories(s ...*SitesCategories) *CategoriesUpdate
- func (cu *CategoriesUpdate) AddSitesCategoryIDs(ids ...int) *CategoriesUpdate
- func (cu *CategoriesUpdate) ClearSites() *CategoriesUpdate
- func (cu *CategoriesUpdate) ClearSitesCategories() *CategoriesUpdate
- func (cu *CategoriesUpdate) Exec(ctx context.Context) error
- func (cu *CategoriesUpdate) ExecX(ctx context.Context)
- func (cu *CategoriesUpdate) Mutation() *CategoriesMutation
- func (cu *CategoriesUpdate) RemoveSiteIDs(ids ...int) *CategoriesUpdate
- func (cu *CategoriesUpdate) RemoveSites(s ...*Sites) *CategoriesUpdate
- func (cu *CategoriesUpdate) RemoveSitesCategories(s ...*SitesCategories) *CategoriesUpdate
- func (cu *CategoriesUpdate) RemoveSitesCategoryIDs(ids ...int) *CategoriesUpdate
- func (cu *CategoriesUpdate) Save(ctx context.Context) (int, error)
- func (cu *CategoriesUpdate) SaveX(ctx context.Context) int
- func (cu *CategoriesUpdate) SetName(s string) *CategoriesUpdate
- func (cu *CategoriesUpdate) SetNillableName(s *string) *CategoriesUpdate
- func (cu *CategoriesUpdate) SetUpdatedAt(t time.Time) *CategoriesUpdate
- func (cu *CategoriesUpdate) Where(ps ...predicate.Categories) *CategoriesUpdate
- type CategoriesUpdateOne
- func (cuo *CategoriesUpdateOne) AddSiteIDs(ids ...int) *CategoriesUpdateOne
- func (cuo *CategoriesUpdateOne) AddSites(s ...*Sites) *CategoriesUpdateOne
- func (cuo *CategoriesUpdateOne) AddSitesCategories(s ...*SitesCategories) *CategoriesUpdateOne
- func (cuo *CategoriesUpdateOne) AddSitesCategoryIDs(ids ...int) *CategoriesUpdateOne
- func (cuo *CategoriesUpdateOne) ClearSites() *CategoriesUpdateOne
- func (cuo *CategoriesUpdateOne) ClearSitesCategories() *CategoriesUpdateOne
- func (cuo *CategoriesUpdateOne) Exec(ctx context.Context) error
- func (cuo *CategoriesUpdateOne) ExecX(ctx context.Context)
- func (cuo *CategoriesUpdateOne) Mutation() *CategoriesMutation
- func (cuo *CategoriesUpdateOne) RemoveSiteIDs(ids ...int) *CategoriesUpdateOne
- func (cuo *CategoriesUpdateOne) RemoveSites(s ...*Sites) *CategoriesUpdateOne
- func (cuo *CategoriesUpdateOne) RemoveSitesCategories(s ...*SitesCategories) *CategoriesUpdateOne
- func (cuo *CategoriesUpdateOne) RemoveSitesCategoryIDs(ids ...int) *CategoriesUpdateOne
- func (cuo *CategoriesUpdateOne) Save(ctx context.Context) (*Categories, error)
- func (cuo *CategoriesUpdateOne) SaveX(ctx context.Context) *Categories
- func (cuo *CategoriesUpdateOne) Select(field string, fields ...string) *CategoriesUpdateOne
- func (cuo *CategoriesUpdateOne) SetName(s string) *CategoriesUpdateOne
- func (cuo *CategoriesUpdateOne) SetNillableName(s *string) *CategoriesUpdateOne
- func (cuo *CategoriesUpdateOne) SetUpdatedAt(t time.Time) *CategoriesUpdateOne
- func (cuo *CategoriesUpdateOne) Where(ps ...predicate.Categories) *CategoriesUpdateOne
- 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 Counter
- type CounterClient
- func (c *CounterClient) Create() *CounterCreate
- func (c *CounterClient) CreateBulk(builders ...*CounterCreate) *CounterCreateBulk
- func (c *CounterClient) Delete() *CounterDelete
- func (c *CounterClient) DeleteOne(co *Counter) *CounterDeleteOne
- func (c *CounterClient) DeleteOneID(id int) *CounterDeleteOne
- func (c *CounterClient) Get(ctx context.Context, id int) (*Counter, error)
- func (c *CounterClient) GetX(ctx context.Context, id int) *Counter
- func (c *CounterClient) Hooks() []Hook
- func (c *CounterClient) Intercept(interceptors ...Interceptor)
- func (c *CounterClient) Interceptors() []Interceptor
- func (c *CounterClient) MapCreateBulk(slice any, setFunc func(*CounterCreate, int)) *CounterCreateBulk
- func (c *CounterClient) Query() *CounterQuery
- func (c *CounterClient) Update() *CounterUpdate
- func (c *CounterClient) UpdateOne(co *Counter) *CounterUpdateOne
- func (c *CounterClient) UpdateOneID(id int) *CounterUpdateOne
- func (c *CounterClient) Use(hooks ...Hook)
- type CounterCreate
- func (cc *CounterCreate) Exec(ctx context.Context) error
- func (cc *CounterCreate) ExecX(ctx context.Context)
- func (cc *CounterCreate) Mutation() *CounterMutation
- func (cc *CounterCreate) Save(ctx context.Context) (*Counter, error)
- func (cc *CounterCreate) SaveX(ctx context.Context) *Counter
- func (cc *CounterCreate) SetCount(i int) *CounterCreate
- func (cc *CounterCreate) SetNillableCount(i *int) *CounterCreate
- type CounterCreateBulk
- type CounterDelete
- type CounterDeleteOne
- type CounterGroupBy
- func (cgb *CounterGroupBy) Aggregate(fns ...AggregateFunc) *CounterGroupBy
- func (s *CounterGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *CounterGroupBy) BoolX(ctx context.Context) bool
- func (s *CounterGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *CounterGroupBy) BoolsX(ctx context.Context) []bool
- func (s *CounterGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *CounterGroupBy) Float64X(ctx context.Context) float64
- func (s *CounterGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *CounterGroupBy) Float64sX(ctx context.Context) []float64
- func (s *CounterGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *CounterGroupBy) IntX(ctx context.Context) int
- func (s *CounterGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *CounterGroupBy) IntsX(ctx context.Context) []int
- func (cgb *CounterGroupBy) Scan(ctx context.Context, v any) error
- func (s *CounterGroupBy) ScanX(ctx context.Context, v any)
- func (s *CounterGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *CounterGroupBy) StringX(ctx context.Context) string
- func (s *CounterGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *CounterGroupBy) StringsX(ctx context.Context) []string
- type CounterMutation
- func (m *CounterMutation) AddCount(i int)
- func (m *CounterMutation) AddField(name string, value ent.Value) error
- func (m *CounterMutation) AddedCount() (r int, exists bool)
- func (m *CounterMutation) AddedEdges() []string
- func (m *CounterMutation) AddedField(name string) (ent.Value, bool)
- func (m *CounterMutation) AddedFields() []string
- func (m *CounterMutation) AddedIDs(name string) []ent.Value
- func (m *CounterMutation) ClearEdge(name string) error
- func (m *CounterMutation) ClearField(name string) error
- func (m *CounterMutation) ClearedEdges() []string
- func (m *CounterMutation) ClearedFields() []string
- func (m CounterMutation) Client() *Client
- func (m *CounterMutation) Count() (r int, exists bool)
- func (m *CounterMutation) EdgeCleared(name string) bool
- func (m *CounterMutation) Field(name string) (ent.Value, bool)
- func (m *CounterMutation) FieldCleared(name string) bool
- func (m *CounterMutation) Fields() []string
- func (m *CounterMutation) ID() (id int, exists bool)
- func (m *CounterMutation) IDs(ctx context.Context) ([]int, error)
- func (m *CounterMutation) OldCount(ctx context.Context) (v int, err error)
- func (m *CounterMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *CounterMutation) Op() Op
- func (m *CounterMutation) RemovedEdges() []string
- func (m *CounterMutation) RemovedIDs(name string) []ent.Value
- func (m *CounterMutation) ResetCount()
- func (m *CounterMutation) ResetEdge(name string) error
- func (m *CounterMutation) ResetField(name string) error
- func (m *CounterMutation) SetCount(i int)
- func (m *CounterMutation) SetField(name string, value ent.Value) error
- func (m *CounterMutation) SetOp(op Op)
- func (m CounterMutation) Tx() (*Tx, error)
- func (m *CounterMutation) Type() string
- func (m *CounterMutation) Where(ps ...predicate.Counter)
- func (m *CounterMutation) WhereP(ps ...func(*sql.Selector))
- type CounterQuery
- func (cq *CounterQuery) Aggregate(fns ...AggregateFunc) *CounterSelect
- func (cq *CounterQuery) All(ctx context.Context) ([]*Counter, error)
- func (cq *CounterQuery) AllX(ctx context.Context) []*Counter
- func (cq *CounterQuery) Clone() *CounterQuery
- func (cq *CounterQuery) Count(ctx context.Context) (int, error)
- func (cq *CounterQuery) CountX(ctx context.Context) int
- func (cq *CounterQuery) Exist(ctx context.Context) (bool, error)
- func (cq *CounterQuery) ExistX(ctx context.Context) bool
- func (cq *CounterQuery) First(ctx context.Context) (*Counter, error)
- func (cq *CounterQuery) FirstID(ctx context.Context) (id int, err error)
- func (cq *CounterQuery) FirstIDX(ctx context.Context) int
- func (cq *CounterQuery) FirstX(ctx context.Context) *Counter
- func (cq *CounterQuery) GroupBy(field string, fields ...string) *CounterGroupBy
- func (cq *CounterQuery) IDs(ctx context.Context) (ids []int, err error)
- func (cq *CounterQuery) IDsX(ctx context.Context) []int
- func (cq *CounterQuery) Limit(limit int) *CounterQuery
- func (cq *CounterQuery) Offset(offset int) *CounterQuery
- func (cq *CounterQuery) Only(ctx context.Context) (*Counter, error)
- func (cq *CounterQuery) OnlyID(ctx context.Context) (id int, err error)
- func (cq *CounterQuery) OnlyIDX(ctx context.Context) int
- func (cq *CounterQuery) OnlyX(ctx context.Context) *Counter
- func (cq *CounterQuery) Order(o ...counter.OrderOption) *CounterQuery
- func (cq *CounterQuery) Select(fields ...string) *CounterSelect
- func (cq *CounterQuery) Unique(unique bool) *CounterQuery
- func (cq *CounterQuery) Where(ps ...predicate.Counter) *CounterQuery
- type CounterSelect
- func (cs *CounterSelect) Aggregate(fns ...AggregateFunc) *CounterSelect
- func (s *CounterSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *CounterSelect) BoolX(ctx context.Context) bool
- func (s *CounterSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *CounterSelect) BoolsX(ctx context.Context) []bool
- func (s *CounterSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *CounterSelect) Float64X(ctx context.Context) float64
- func (s *CounterSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *CounterSelect) Float64sX(ctx context.Context) []float64
- func (s *CounterSelect) Int(ctx context.Context) (_ int, err error)
- func (s *CounterSelect) IntX(ctx context.Context) int
- func (s *CounterSelect) Ints(ctx context.Context) ([]int, error)
- func (s *CounterSelect) IntsX(ctx context.Context) []int
- func (cs *CounterSelect) Scan(ctx context.Context, v any) error
- func (s *CounterSelect) ScanX(ctx context.Context, v any)
- func (s *CounterSelect) String(ctx context.Context) (_ string, err error)
- func (s *CounterSelect) StringX(ctx context.Context) string
- func (s *CounterSelect) Strings(ctx context.Context) ([]string, error)
- func (s *CounterSelect) StringsX(ctx context.Context) []string
- type CounterUpdate
- func (cu *CounterUpdate) AddCount(i int) *CounterUpdate
- func (cu *CounterUpdate) Exec(ctx context.Context) error
- func (cu *CounterUpdate) ExecX(ctx context.Context)
- func (cu *CounterUpdate) Mutation() *CounterMutation
- func (cu *CounterUpdate) Save(ctx context.Context) (int, error)
- func (cu *CounterUpdate) SaveX(ctx context.Context) int
- func (cu *CounterUpdate) SetCount(i int) *CounterUpdate
- func (cu *CounterUpdate) SetNillableCount(i *int) *CounterUpdate
- func (cu *CounterUpdate) Where(ps ...predicate.Counter) *CounterUpdate
- type CounterUpdateOne
- func (cuo *CounterUpdateOne) AddCount(i int) *CounterUpdateOne
- func (cuo *CounterUpdateOne) Exec(ctx context.Context) error
- func (cuo *CounterUpdateOne) ExecX(ctx context.Context)
- func (cuo *CounterUpdateOne) Mutation() *CounterMutation
- func (cuo *CounterUpdateOne) Save(ctx context.Context) (*Counter, error)
- func (cuo *CounterUpdateOne) SaveX(ctx context.Context) *Counter
- func (cuo *CounterUpdateOne) Select(field string, fields ...string) *CounterUpdateOne
- func (cuo *CounterUpdateOne) SetCount(i int) *CounterUpdateOne
- func (cuo *CounterUpdateOne) SetNillableCount(i *int) *CounterUpdateOne
- func (cuo *CounterUpdateOne) Where(ps ...predicate.Counter) *CounterUpdateOne
- type Counters
- type Hook
- type InterceptFunc
- type Interceptor
- type Isps
- type IspsClient
- func (c *IspsClient) Create() *IspsCreate
- func (c *IspsClient) CreateBulk(builders ...*IspsCreate) *IspsCreateBulk
- func (c *IspsClient) Delete() *IspsDelete
- func (c *IspsClient) DeleteOne(i *Isps) *IspsDeleteOne
- func (c *IspsClient) DeleteOneID(id int) *IspsDeleteOne
- func (c *IspsClient) Get(ctx context.Context, id int) (*Isps, error)
- func (c *IspsClient) GetX(ctx context.Context, id int) *Isps
- func (c *IspsClient) Hooks() []Hook
- func (c *IspsClient) Intercept(interceptors ...Interceptor)
- func (c *IspsClient) Interceptors() []Interceptor
- func (c *IspsClient) MapCreateBulk(slice any, setFunc func(*IspsCreate, int)) *IspsCreateBulk
- func (c *IspsClient) Query() *IspsQuery
- func (c *IspsClient) QueryIspBlocks(i *Isps) *BlocksQuery
- func (c *IspsClient) Update() *IspsUpdate
- func (c *IspsClient) UpdateOne(i *Isps) *IspsUpdateOne
- func (c *IspsClient) UpdateOneID(id int) *IspsUpdateOne
- func (c *IspsClient) Use(hooks ...Hook)
- type IspsCreate
- func (ic *IspsCreate) AddIspBlockIDs(ids ...int) *IspsCreate
- func (ic *IspsCreate) AddIspBlocks(b ...*Blocks) *IspsCreate
- func (ic *IspsCreate) Exec(ctx context.Context) error
- func (ic *IspsCreate) ExecX(ctx context.Context)
- func (ic *IspsCreate) Mutation() *IspsMutation
- func (ic *IspsCreate) Save(ctx context.Context) (*Isps, error)
- func (ic *IspsCreate) SaveX(ctx context.Context) *Isps
- func (ic *IspsCreate) SetCreatedAt(t time.Time) *IspsCreate
- func (ic *IspsCreate) SetLatitude(f float64) *IspsCreate
- func (ic *IspsCreate) SetLongitude(f float64) *IspsCreate
- func (ic *IspsCreate) SetName(s string) *IspsCreate
- func (ic *IspsCreate) SetNillableCreatedAt(t *time.Time) *IspsCreate
- func (ic *IspsCreate) SetNillableUpdatedAt(t *time.Time) *IspsCreate
- func (ic *IspsCreate) SetUpdatedAt(t time.Time) *IspsCreate
- type IspsCreateBulk
- type IspsDelete
- type IspsDeleteOne
- type IspsEdges
- type IspsGroupBy
- func (igb *IspsGroupBy) Aggregate(fns ...AggregateFunc) *IspsGroupBy
- func (s *IspsGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *IspsGroupBy) BoolX(ctx context.Context) bool
- func (s *IspsGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *IspsGroupBy) BoolsX(ctx context.Context) []bool
- func (s *IspsGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *IspsGroupBy) Float64X(ctx context.Context) float64
- func (s *IspsGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *IspsGroupBy) Float64sX(ctx context.Context) []float64
- func (s *IspsGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *IspsGroupBy) IntX(ctx context.Context) int
- func (s *IspsGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *IspsGroupBy) IntsX(ctx context.Context) []int
- func (igb *IspsGroupBy) Scan(ctx context.Context, v any) error
- func (s *IspsGroupBy) ScanX(ctx context.Context, v any)
- func (s *IspsGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *IspsGroupBy) StringX(ctx context.Context) string
- func (s *IspsGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *IspsGroupBy) StringsX(ctx context.Context) []string
- type IspsMutation
- func (m *IspsMutation) AddField(name string, value ent.Value) error
- func (m *IspsMutation) AddIspBlockIDs(ids ...int)
- func (m *IspsMutation) AddLatitude(f float64)
- func (m *IspsMutation) AddLongitude(f float64)
- func (m *IspsMutation) AddedEdges() []string
- func (m *IspsMutation) AddedField(name string) (ent.Value, bool)
- func (m *IspsMutation) AddedFields() []string
- func (m *IspsMutation) AddedIDs(name string) []ent.Value
- func (m *IspsMutation) AddedLatitude() (r float64, exists bool)
- func (m *IspsMutation) AddedLongitude() (r float64, exists bool)
- func (m *IspsMutation) ClearEdge(name string) error
- func (m *IspsMutation) ClearField(name string) error
- func (m *IspsMutation) ClearIspBlocks()
- func (m *IspsMutation) ClearedEdges() []string
- func (m *IspsMutation) ClearedFields() []string
- func (m IspsMutation) Client() *Client
- func (m *IspsMutation) CreatedAt() (r time.Time, exists bool)
- func (m *IspsMutation) EdgeCleared(name string) bool
- func (m *IspsMutation) Field(name string) (ent.Value, bool)
- func (m *IspsMutation) FieldCleared(name string) bool
- func (m *IspsMutation) Fields() []string
- func (m *IspsMutation) ID() (id int, exists bool)
- func (m *IspsMutation) IDs(ctx context.Context) ([]int, error)
- func (m *IspsMutation) IspBlocksCleared() bool
- func (m *IspsMutation) IspBlocksIDs() (ids []int)
- func (m *IspsMutation) Latitude() (r float64, exists bool)
- func (m *IspsMutation) Longitude() (r float64, exists bool)
- func (m *IspsMutation) Name() (r string, exists bool)
- func (m *IspsMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *IspsMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *IspsMutation) OldLatitude(ctx context.Context) (v float64, err error)
- func (m *IspsMutation) OldLongitude(ctx context.Context) (v float64, err error)
- func (m *IspsMutation) OldName(ctx context.Context) (v string, err error)
- func (m *IspsMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *IspsMutation) Op() Op
- func (m *IspsMutation) RemoveIspBlockIDs(ids ...int)
- func (m *IspsMutation) RemovedEdges() []string
- func (m *IspsMutation) RemovedIDs(name string) []ent.Value
- func (m *IspsMutation) RemovedIspBlocksIDs() (ids []int)
- func (m *IspsMutation) ResetCreatedAt()
- func (m *IspsMutation) ResetEdge(name string) error
- func (m *IspsMutation) ResetField(name string) error
- func (m *IspsMutation) ResetIspBlocks()
- func (m *IspsMutation) ResetLatitude()
- func (m *IspsMutation) ResetLongitude()
- func (m *IspsMutation) ResetName()
- func (m *IspsMutation) ResetUpdatedAt()
- func (m *IspsMutation) SetCreatedAt(t time.Time)
- func (m *IspsMutation) SetField(name string, value ent.Value) error
- func (m *IspsMutation) SetLatitude(f float64)
- func (m *IspsMutation) SetLongitude(f float64)
- func (m *IspsMutation) SetName(s string)
- func (m *IspsMutation) SetOp(op Op)
- func (m *IspsMutation) SetUpdatedAt(t time.Time)
- func (m IspsMutation) Tx() (*Tx, error)
- func (m *IspsMutation) Type() string
- func (m *IspsMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *IspsMutation) Where(ps ...predicate.Isps)
- func (m *IspsMutation) WhereP(ps ...func(*sql.Selector))
- type IspsQuery
- func (iq *IspsQuery) Aggregate(fns ...AggregateFunc) *IspsSelect
- func (iq *IspsQuery) All(ctx context.Context) ([]*Isps, error)
- func (iq *IspsQuery) AllX(ctx context.Context) []*Isps
- func (iq *IspsQuery) Clone() *IspsQuery
- func (iq *IspsQuery) Count(ctx context.Context) (int, error)
- func (iq *IspsQuery) CountX(ctx context.Context) int
- func (iq *IspsQuery) Exist(ctx context.Context) (bool, error)
- func (iq *IspsQuery) ExistX(ctx context.Context) bool
- func (iq *IspsQuery) First(ctx context.Context) (*Isps, error)
- func (iq *IspsQuery) FirstID(ctx context.Context) (id int, err error)
- func (iq *IspsQuery) FirstIDX(ctx context.Context) int
- func (iq *IspsQuery) FirstX(ctx context.Context) *Isps
- func (iq *IspsQuery) GroupBy(field string, fields ...string) *IspsGroupBy
- func (iq *IspsQuery) IDs(ctx context.Context) (ids []int, err error)
- func (iq *IspsQuery) IDsX(ctx context.Context) []int
- func (iq *IspsQuery) Limit(limit int) *IspsQuery
- func (iq *IspsQuery) Offset(offset int) *IspsQuery
- func (iq *IspsQuery) Only(ctx context.Context) (*Isps, error)
- func (iq *IspsQuery) OnlyID(ctx context.Context) (id int, err error)
- func (iq *IspsQuery) OnlyIDX(ctx context.Context) int
- func (iq *IspsQuery) OnlyX(ctx context.Context) *Isps
- func (iq *IspsQuery) Order(o ...isps.OrderOption) *IspsQuery
- func (iq *IspsQuery) QueryIspBlocks() *BlocksQuery
- func (iq *IspsQuery) Select(fields ...string) *IspsSelect
- func (iq *IspsQuery) Unique(unique bool) *IspsQuery
- func (iq *IspsQuery) Where(ps ...predicate.Isps) *IspsQuery
- func (iq *IspsQuery) WithIspBlocks(opts ...func(*BlocksQuery)) *IspsQuery
- type IspsSelect
- func (is *IspsSelect) Aggregate(fns ...AggregateFunc) *IspsSelect
- func (s *IspsSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *IspsSelect) BoolX(ctx context.Context) bool
- func (s *IspsSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *IspsSelect) BoolsX(ctx context.Context) []bool
- func (s *IspsSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *IspsSelect) Float64X(ctx context.Context) float64
- func (s *IspsSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *IspsSelect) Float64sX(ctx context.Context) []float64
- func (s *IspsSelect) Int(ctx context.Context) (_ int, err error)
- func (s *IspsSelect) IntX(ctx context.Context) int
- func (s *IspsSelect) Ints(ctx context.Context) ([]int, error)
- func (s *IspsSelect) IntsX(ctx context.Context) []int
- func (is *IspsSelect) Scan(ctx context.Context, v any) error
- func (s *IspsSelect) ScanX(ctx context.Context, v any)
- func (s *IspsSelect) String(ctx context.Context) (_ string, err error)
- func (s *IspsSelect) StringX(ctx context.Context) string
- func (s *IspsSelect) Strings(ctx context.Context) ([]string, error)
- func (s *IspsSelect) StringsX(ctx context.Context) []string
- type IspsSlice
- type IspsUpdate
- func (iu *IspsUpdate) AddIspBlockIDs(ids ...int) *IspsUpdate
- func (iu *IspsUpdate) AddIspBlocks(b ...*Blocks) *IspsUpdate
- func (iu *IspsUpdate) AddLatitude(f float64) *IspsUpdate
- func (iu *IspsUpdate) AddLongitude(f float64) *IspsUpdate
- func (iu *IspsUpdate) ClearIspBlocks() *IspsUpdate
- func (iu *IspsUpdate) Exec(ctx context.Context) error
- func (iu *IspsUpdate) ExecX(ctx context.Context)
- func (iu *IspsUpdate) Mutation() *IspsMutation
- func (iu *IspsUpdate) RemoveIspBlockIDs(ids ...int) *IspsUpdate
- func (iu *IspsUpdate) RemoveIspBlocks(b ...*Blocks) *IspsUpdate
- func (iu *IspsUpdate) Save(ctx context.Context) (int, error)
- func (iu *IspsUpdate) SaveX(ctx context.Context) int
- func (iu *IspsUpdate) SetLatitude(f float64) *IspsUpdate
- func (iu *IspsUpdate) SetLongitude(f float64) *IspsUpdate
- func (iu *IspsUpdate) SetName(s string) *IspsUpdate
- func (iu *IspsUpdate) SetNillableLatitude(f *float64) *IspsUpdate
- func (iu *IspsUpdate) SetNillableLongitude(f *float64) *IspsUpdate
- func (iu *IspsUpdate) SetNillableName(s *string) *IspsUpdate
- func (iu *IspsUpdate) SetUpdatedAt(t time.Time) *IspsUpdate
- func (iu *IspsUpdate) Where(ps ...predicate.Isps) *IspsUpdate
- type IspsUpdateOne
- func (iuo *IspsUpdateOne) AddIspBlockIDs(ids ...int) *IspsUpdateOne
- func (iuo *IspsUpdateOne) AddIspBlocks(b ...*Blocks) *IspsUpdateOne
- func (iuo *IspsUpdateOne) AddLatitude(f float64) *IspsUpdateOne
- func (iuo *IspsUpdateOne) AddLongitude(f float64) *IspsUpdateOne
- func (iuo *IspsUpdateOne) ClearIspBlocks() *IspsUpdateOne
- func (iuo *IspsUpdateOne) Exec(ctx context.Context) error
- func (iuo *IspsUpdateOne) ExecX(ctx context.Context)
- func (iuo *IspsUpdateOne) Mutation() *IspsMutation
- func (iuo *IspsUpdateOne) RemoveIspBlockIDs(ids ...int) *IspsUpdateOne
- func (iuo *IspsUpdateOne) RemoveIspBlocks(b ...*Blocks) *IspsUpdateOne
- func (iuo *IspsUpdateOne) Save(ctx context.Context) (*Isps, error)
- func (iuo *IspsUpdateOne) SaveX(ctx context.Context) *Isps
- func (iuo *IspsUpdateOne) Select(field string, fields ...string) *IspsUpdateOne
- func (iuo *IspsUpdateOne) SetLatitude(f float64) *IspsUpdateOne
- func (iuo *IspsUpdateOne) SetLongitude(f float64) *IspsUpdateOne
- func (iuo *IspsUpdateOne) SetName(s string) *IspsUpdateOne
- func (iuo *IspsUpdateOne) SetNillableLatitude(f *float64) *IspsUpdateOne
- func (iuo *IspsUpdateOne) SetNillableLongitude(f *float64) *IspsUpdateOne
- func (iuo *IspsUpdateOne) SetNillableName(s *string) *IspsUpdateOne
- func (iuo *IspsUpdateOne) SetUpdatedAt(t time.Time) *IspsUpdateOne
- func (iuo *IspsUpdateOne) Where(ps ...predicate.Isps) *IspsUpdateOne
- 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 Sites
- func (s *Sites) QueryBlocks() *BlocksQuery
- func (s *Sites) QueryCategories() *CategoriesQuery
- func (s *Sites) QuerySitesCategories() *SitesCategoriesQuery
- func (s *Sites) String() string
- func (s *Sites) Unwrap() *Sites
- func (s *Sites) Update() *SitesUpdateOne
- func (s *Sites) Value(name string) (ent.Value, error)
- type SitesCategories
- func (sc *SitesCategories) QueryCategories() *CategoriesQuery
- func (sc *SitesCategories) QuerySites() *SitesQuery
- func (sc *SitesCategories) String() string
- func (sc *SitesCategories) Unwrap() *SitesCategories
- func (sc *SitesCategories) Update() *SitesCategoriesUpdateOne
- func (sc *SitesCategories) Value(name string) (ent.Value, error)
- type SitesCategoriesClient
- func (c *SitesCategoriesClient) Create() *SitesCategoriesCreate
- func (c *SitesCategoriesClient) CreateBulk(builders ...*SitesCategoriesCreate) *SitesCategoriesCreateBulk
- func (c *SitesCategoriesClient) Delete() *SitesCategoriesDelete
- func (c *SitesCategoriesClient) DeleteOne(sc *SitesCategories) *SitesCategoriesDeleteOne
- func (c *SitesCategoriesClient) DeleteOneID(id int) *SitesCategoriesDeleteOne
- func (c *SitesCategoriesClient) Get(ctx context.Context, id int) (*SitesCategories, error)
- func (c *SitesCategoriesClient) GetX(ctx context.Context, id int) *SitesCategories
- func (c *SitesCategoriesClient) Hooks() []Hook
- func (c *SitesCategoriesClient) Intercept(interceptors ...Interceptor)
- func (c *SitesCategoriesClient) Interceptors() []Interceptor
- func (c *SitesCategoriesClient) MapCreateBulk(slice any, setFunc func(*SitesCategoriesCreate, int)) *SitesCategoriesCreateBulk
- func (c *SitesCategoriesClient) Query() *SitesCategoriesQuery
- func (c *SitesCategoriesClient) QueryCategories(sc *SitesCategories) *CategoriesQuery
- func (c *SitesCategoriesClient) QuerySites(sc *SitesCategories) *SitesQuery
- func (c *SitesCategoriesClient) Update() *SitesCategoriesUpdate
- func (c *SitesCategoriesClient) UpdateOne(sc *SitesCategories) *SitesCategoriesUpdateOne
- func (c *SitesCategoriesClient) UpdateOneID(id int) *SitesCategoriesUpdateOne
- func (c *SitesCategoriesClient) Use(hooks ...Hook)
- type SitesCategoriesCreate
- func (scc *SitesCategoriesCreate) Exec(ctx context.Context) error
- func (scc *SitesCategoriesCreate) ExecX(ctx context.Context)
- func (scc *SitesCategoriesCreate) Mutation() *SitesCategoriesMutation
- func (scc *SitesCategoriesCreate) Save(ctx context.Context) (*SitesCategories, error)
- func (scc *SitesCategoriesCreate) SaveX(ctx context.Context) *SitesCategories
- func (scc *SitesCategoriesCreate) SetCategories(c *Categories) *SitesCategoriesCreate
- func (scc *SitesCategoriesCreate) SetCategoriesID(i int) *SitesCategoriesCreate
- func (scc *SitesCategoriesCreate) SetSites(s *Sites) *SitesCategoriesCreate
- func (scc *SitesCategoriesCreate) SetSitesID(i int) *SitesCategoriesCreate
- type SitesCategoriesCreateBulk
- func (sccb *SitesCategoriesCreateBulk) Exec(ctx context.Context) error
- func (sccb *SitesCategoriesCreateBulk) ExecX(ctx context.Context)
- func (sccb *SitesCategoriesCreateBulk) Save(ctx context.Context) ([]*SitesCategories, error)
- func (sccb *SitesCategoriesCreateBulk) SaveX(ctx context.Context) []*SitesCategories
- type SitesCategoriesDelete
- type SitesCategoriesDeleteOne
- type SitesCategoriesEdges
- type SitesCategoriesGroupBy
- func (scgb *SitesCategoriesGroupBy) Aggregate(fns ...AggregateFunc) *SitesCategoriesGroupBy
- func (s *SitesCategoriesGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *SitesCategoriesGroupBy) BoolX(ctx context.Context) bool
- func (s *SitesCategoriesGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *SitesCategoriesGroupBy) BoolsX(ctx context.Context) []bool
- func (s *SitesCategoriesGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *SitesCategoriesGroupBy) Float64X(ctx context.Context) float64
- func (s *SitesCategoriesGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *SitesCategoriesGroupBy) Float64sX(ctx context.Context) []float64
- func (s *SitesCategoriesGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *SitesCategoriesGroupBy) IntX(ctx context.Context) int
- func (s *SitesCategoriesGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *SitesCategoriesGroupBy) IntsX(ctx context.Context) []int
- func (scgb *SitesCategoriesGroupBy) Scan(ctx context.Context, v any) error
- func (s *SitesCategoriesGroupBy) ScanX(ctx context.Context, v any)
- func (s *SitesCategoriesGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *SitesCategoriesGroupBy) StringX(ctx context.Context) string
- func (s *SitesCategoriesGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *SitesCategoriesGroupBy) StringsX(ctx context.Context) []string
- type SitesCategoriesMutation
- func (m *SitesCategoriesMutation) AddField(name string, value ent.Value) error
- func (m *SitesCategoriesMutation) AddedEdges() []string
- func (m *SitesCategoriesMutation) AddedField(name string) (ent.Value, bool)
- func (m *SitesCategoriesMutation) AddedFields() []string
- func (m *SitesCategoriesMutation) AddedIDs(name string) []ent.Value
- func (m *SitesCategoriesMutation) CategoriesCleared() bool
- func (m *SitesCategoriesMutation) CategoriesID() (r int, exists bool)
- func (m *SitesCategoriesMutation) CategoriesIDs() (ids []int)
- func (m *SitesCategoriesMutation) ClearCategories()
- func (m *SitesCategoriesMutation) ClearEdge(name string) error
- func (m *SitesCategoriesMutation) ClearField(name string) error
- func (m *SitesCategoriesMutation) ClearSites()
- func (m *SitesCategoriesMutation) ClearedEdges() []string
- func (m *SitesCategoriesMutation) ClearedFields() []string
- func (m SitesCategoriesMutation) Client() *Client
- func (m *SitesCategoriesMutation) EdgeCleared(name string) bool
- func (m *SitesCategoriesMutation) Field(name string) (ent.Value, bool)
- func (m *SitesCategoriesMutation) FieldCleared(name string) bool
- func (m *SitesCategoriesMutation) Fields() []string
- func (m *SitesCategoriesMutation) ID() (id int, exists bool)
- func (m *SitesCategoriesMutation) IDs(ctx context.Context) ([]int, error)
- func (m *SitesCategoriesMutation) OldCategoriesID(ctx context.Context) (v int, err error)
- func (m *SitesCategoriesMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *SitesCategoriesMutation) OldSitesID(ctx context.Context) (v int, err error)
- func (m *SitesCategoriesMutation) Op() Op
- func (m *SitesCategoriesMutation) RemovedEdges() []string
- func (m *SitesCategoriesMutation) RemovedIDs(name string) []ent.Value
- func (m *SitesCategoriesMutation) ResetCategories()
- func (m *SitesCategoriesMutation) ResetCategoriesID()
- func (m *SitesCategoriesMutation) ResetEdge(name string) error
- func (m *SitesCategoriesMutation) ResetField(name string) error
- func (m *SitesCategoriesMutation) ResetSites()
- func (m *SitesCategoriesMutation) ResetSitesID()
- func (m *SitesCategoriesMutation) SetCategoriesID(i int)
- func (m *SitesCategoriesMutation) SetField(name string, value ent.Value) error
- func (m *SitesCategoriesMutation) SetOp(op Op)
- func (m *SitesCategoriesMutation) SetSitesID(i int)
- func (m *SitesCategoriesMutation) SitesCleared() bool
- func (m *SitesCategoriesMutation) SitesID() (r int, exists bool)
- func (m *SitesCategoriesMutation) SitesIDs() (ids []int)
- func (m SitesCategoriesMutation) Tx() (*Tx, error)
- func (m *SitesCategoriesMutation) Type() string
- func (m *SitesCategoriesMutation) Where(ps ...predicate.SitesCategories)
- func (m *SitesCategoriesMutation) WhereP(ps ...func(*sql.Selector))
- type SitesCategoriesQuery
- func (scq *SitesCategoriesQuery) Aggregate(fns ...AggregateFunc) *SitesCategoriesSelect
- func (scq *SitesCategoriesQuery) All(ctx context.Context) ([]*SitesCategories, error)
- func (scq *SitesCategoriesQuery) AllX(ctx context.Context) []*SitesCategories
- func (scq *SitesCategoriesQuery) Clone() *SitesCategoriesQuery
- func (scq *SitesCategoriesQuery) Count(ctx context.Context) (int, error)
- func (scq *SitesCategoriesQuery) CountX(ctx context.Context) int
- func (scq *SitesCategoriesQuery) Exist(ctx context.Context) (bool, error)
- func (scq *SitesCategoriesQuery) ExistX(ctx context.Context) bool
- func (scq *SitesCategoriesQuery) First(ctx context.Context) (*SitesCategories, error)
- func (scq *SitesCategoriesQuery) FirstID(ctx context.Context) (id int, err error)
- func (scq *SitesCategoriesQuery) FirstIDX(ctx context.Context) int
- func (scq *SitesCategoriesQuery) FirstX(ctx context.Context) *SitesCategories
- func (scq *SitesCategoriesQuery) GroupBy(field string, fields ...string) *SitesCategoriesGroupBy
- func (scq *SitesCategoriesQuery) IDs(ctx context.Context) (ids []int, err error)
- func (scq *SitesCategoriesQuery) IDsX(ctx context.Context) []int
- func (scq *SitesCategoriesQuery) Limit(limit int) *SitesCategoriesQuery
- func (scq *SitesCategoriesQuery) Offset(offset int) *SitesCategoriesQuery
- func (scq *SitesCategoriesQuery) Only(ctx context.Context) (*SitesCategories, error)
- func (scq *SitesCategoriesQuery) OnlyID(ctx context.Context) (id int, err error)
- func (scq *SitesCategoriesQuery) OnlyIDX(ctx context.Context) int
- func (scq *SitesCategoriesQuery) OnlyX(ctx context.Context) *SitesCategories
- func (scq *SitesCategoriesQuery) Order(o ...sitescategories.OrderOption) *SitesCategoriesQuery
- func (scq *SitesCategoriesQuery) QueryCategories() *CategoriesQuery
- func (scq *SitesCategoriesQuery) QuerySites() *SitesQuery
- func (scq *SitesCategoriesQuery) Select(fields ...string) *SitesCategoriesSelect
- func (scq *SitesCategoriesQuery) Unique(unique bool) *SitesCategoriesQuery
- func (scq *SitesCategoriesQuery) Where(ps ...predicate.SitesCategories) *SitesCategoriesQuery
- func (scq *SitesCategoriesQuery) WithCategories(opts ...func(*CategoriesQuery)) *SitesCategoriesQuery
- func (scq *SitesCategoriesQuery) WithSites(opts ...func(*SitesQuery)) *SitesCategoriesQuery
- type SitesCategoriesSelect
- func (scs *SitesCategoriesSelect) Aggregate(fns ...AggregateFunc) *SitesCategoriesSelect
- func (s *SitesCategoriesSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *SitesCategoriesSelect) BoolX(ctx context.Context) bool
- func (s *SitesCategoriesSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *SitesCategoriesSelect) BoolsX(ctx context.Context) []bool
- func (s *SitesCategoriesSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *SitesCategoriesSelect) Float64X(ctx context.Context) float64
- func (s *SitesCategoriesSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *SitesCategoriesSelect) Float64sX(ctx context.Context) []float64
- func (s *SitesCategoriesSelect) Int(ctx context.Context) (_ int, err error)
- func (s *SitesCategoriesSelect) IntX(ctx context.Context) int
- func (s *SitesCategoriesSelect) Ints(ctx context.Context) ([]int, error)
- func (s *SitesCategoriesSelect) IntsX(ctx context.Context) []int
- func (scs *SitesCategoriesSelect) Scan(ctx context.Context, v any) error
- func (s *SitesCategoriesSelect) ScanX(ctx context.Context, v any)
- func (s *SitesCategoriesSelect) String(ctx context.Context) (_ string, err error)
- func (s *SitesCategoriesSelect) StringX(ctx context.Context) string
- func (s *SitesCategoriesSelect) Strings(ctx context.Context) ([]string, error)
- func (s *SitesCategoriesSelect) StringsX(ctx context.Context) []string
- type SitesCategoriesSlice
- type SitesCategoriesUpdate
- func (scu *SitesCategoriesUpdate) ClearCategories() *SitesCategoriesUpdate
- func (scu *SitesCategoriesUpdate) ClearSites() *SitesCategoriesUpdate
- func (scu *SitesCategoriesUpdate) Exec(ctx context.Context) error
- func (scu *SitesCategoriesUpdate) ExecX(ctx context.Context)
- func (scu *SitesCategoriesUpdate) Mutation() *SitesCategoriesMutation
- func (scu *SitesCategoriesUpdate) Save(ctx context.Context) (int, error)
- func (scu *SitesCategoriesUpdate) SaveX(ctx context.Context) int
- func (scu *SitesCategoriesUpdate) SetCategories(c *Categories) *SitesCategoriesUpdate
- func (scu *SitesCategoriesUpdate) SetCategoriesID(i int) *SitesCategoriesUpdate
- func (scu *SitesCategoriesUpdate) SetNillableCategoriesID(i *int) *SitesCategoriesUpdate
- func (scu *SitesCategoriesUpdate) SetNillableSitesID(i *int) *SitesCategoriesUpdate
- func (scu *SitesCategoriesUpdate) SetSites(s *Sites) *SitesCategoriesUpdate
- func (scu *SitesCategoriesUpdate) SetSitesID(i int) *SitesCategoriesUpdate
- func (scu *SitesCategoriesUpdate) Where(ps ...predicate.SitesCategories) *SitesCategoriesUpdate
- type SitesCategoriesUpdateOne
- func (scuo *SitesCategoriesUpdateOne) ClearCategories() *SitesCategoriesUpdateOne
- func (scuo *SitesCategoriesUpdateOne) ClearSites() *SitesCategoriesUpdateOne
- func (scuo *SitesCategoriesUpdateOne) Exec(ctx context.Context) error
- func (scuo *SitesCategoriesUpdateOne) ExecX(ctx context.Context)
- func (scuo *SitesCategoriesUpdateOne) Mutation() *SitesCategoriesMutation
- func (scuo *SitesCategoriesUpdateOne) Save(ctx context.Context) (*SitesCategories, error)
- func (scuo *SitesCategoriesUpdateOne) SaveX(ctx context.Context) *SitesCategories
- func (scuo *SitesCategoriesUpdateOne) Select(field string, fields ...string) *SitesCategoriesUpdateOne
- func (scuo *SitesCategoriesUpdateOne) SetCategories(c *Categories) *SitesCategoriesUpdateOne
- func (scuo *SitesCategoriesUpdateOne) SetCategoriesID(i int) *SitesCategoriesUpdateOne
- func (scuo *SitesCategoriesUpdateOne) SetNillableCategoriesID(i *int) *SitesCategoriesUpdateOne
- func (scuo *SitesCategoriesUpdateOne) SetNillableSitesID(i *int) *SitesCategoriesUpdateOne
- func (scuo *SitesCategoriesUpdateOne) SetSites(s *Sites) *SitesCategoriesUpdateOne
- func (scuo *SitesCategoriesUpdateOne) SetSitesID(i int) *SitesCategoriesUpdateOne
- func (scuo *SitesCategoriesUpdateOne) Where(ps ...predicate.SitesCategories) *SitesCategoriesUpdateOne
- type SitesClient
- func (c *SitesClient) Create() *SitesCreate
- func (c *SitesClient) CreateBulk(builders ...*SitesCreate) *SitesCreateBulk
- func (c *SitesClient) Delete() *SitesDelete
- func (c *SitesClient) DeleteOne(s *Sites) *SitesDeleteOne
- func (c *SitesClient) DeleteOneID(id int) *SitesDeleteOne
- func (c *SitesClient) Get(ctx context.Context, id int) (*Sites, error)
- func (c *SitesClient) GetX(ctx context.Context, id int) *Sites
- func (c *SitesClient) Hooks() []Hook
- func (c *SitesClient) Intercept(interceptors ...Interceptor)
- func (c *SitesClient) Interceptors() []Interceptor
- func (c *SitesClient) MapCreateBulk(slice any, setFunc func(*SitesCreate, int)) *SitesCreateBulk
- func (c *SitesClient) Query() *SitesQuery
- func (c *SitesClient) QueryBlocks(s *Sites) *BlocksQuery
- func (c *SitesClient) QueryCategories(s *Sites) *CategoriesQuery
- func (c *SitesClient) QuerySitesCategories(s *Sites) *SitesCategoriesQuery
- func (c *SitesClient) Update() *SitesUpdate
- func (c *SitesClient) UpdateOne(s *Sites) *SitesUpdateOne
- func (c *SitesClient) UpdateOneID(id int) *SitesUpdateOne
- func (c *SitesClient) Use(hooks ...Hook)
- type SitesCreate
- func (sc *SitesCreate) AddBlockIDs(ids ...int) *SitesCreate
- func (sc *SitesCreate) AddBlocks(b ...*Blocks) *SitesCreate
- func (sc *SitesCreate) AddCategories(c ...*Categories) *SitesCreate
- func (sc *SitesCreate) AddCategoryIDs(ids ...int) *SitesCreate
- func (sc *SitesCreate) AddSitesCategories(s ...*SitesCategories) *SitesCreate
- func (sc *SitesCreate) AddSitesCategoryIDs(ids ...int) *SitesCreate
- func (sc *SitesCreate) Exec(ctx context.Context) error
- func (sc *SitesCreate) ExecX(ctx context.Context)
- func (sc *SitesCreate) Mutation() *SitesMutation
- func (sc *SitesCreate) Save(ctx context.Context) (*Sites, error)
- func (sc *SitesCreate) SaveX(ctx context.Context) *Sites
- func (sc *SitesCreate) SetCreatedAt(t time.Time) *SitesCreate
- func (sc *SitesCreate) SetDomain(s string) *SitesCreate
- func (sc *SitesCreate) SetNillableCreatedAt(t *time.Time) *SitesCreate
- func (sc *SitesCreate) SetNillableUpdatedAt(t *time.Time) *SitesCreate
- func (sc *SitesCreate) SetUpdatedAt(t time.Time) *SitesCreate
- type SitesCreateBulk
- type SitesDelete
- type SitesDeleteOne
- type SitesEdges
- type SitesGroupBy
- func (sgb *SitesGroupBy) Aggregate(fns ...AggregateFunc) *SitesGroupBy
- func (s *SitesGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *SitesGroupBy) BoolX(ctx context.Context) bool
- func (s *SitesGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *SitesGroupBy) BoolsX(ctx context.Context) []bool
- func (s *SitesGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *SitesGroupBy) Float64X(ctx context.Context) float64
- func (s *SitesGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *SitesGroupBy) Float64sX(ctx context.Context) []float64
- func (s *SitesGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *SitesGroupBy) IntX(ctx context.Context) int
- func (s *SitesGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *SitesGroupBy) IntsX(ctx context.Context) []int
- func (sgb *SitesGroupBy) Scan(ctx context.Context, v any) error
- func (s *SitesGroupBy) ScanX(ctx context.Context, v any)
- func (s *SitesGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *SitesGroupBy) StringX(ctx context.Context) string
- func (s *SitesGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *SitesGroupBy) StringsX(ctx context.Context) []string
- type SitesMutation
- func (m *SitesMutation) AddBlockIDs(ids ...int)
- func (m *SitesMutation) AddCategoryIDs(ids ...int)
- func (m *SitesMutation) AddField(name string, value ent.Value) error
- func (m *SitesMutation) AddSitesCategoryIDs(ids ...int)
- func (m *SitesMutation) AddedEdges() []string
- func (m *SitesMutation) AddedField(name string) (ent.Value, bool)
- func (m *SitesMutation) AddedFields() []string
- func (m *SitesMutation) AddedIDs(name string) []ent.Value
- func (m *SitesMutation) BlocksCleared() bool
- func (m *SitesMutation) BlocksIDs() (ids []int)
- func (m *SitesMutation) CategoriesCleared() bool
- func (m *SitesMutation) CategoriesIDs() (ids []int)
- func (m *SitesMutation) ClearBlocks()
- func (m *SitesMutation) ClearCategories()
- func (m *SitesMutation) ClearEdge(name string) error
- func (m *SitesMutation) ClearField(name string) error
- func (m *SitesMutation) ClearSitesCategories()
- func (m *SitesMutation) ClearedEdges() []string
- func (m *SitesMutation) ClearedFields() []string
- func (m SitesMutation) Client() *Client
- func (m *SitesMutation) CreatedAt() (r time.Time, exists bool)
- func (m *SitesMutation) Domain() (r string, exists bool)
- func (m *SitesMutation) EdgeCleared(name string) bool
- func (m *SitesMutation) Field(name string) (ent.Value, bool)
- func (m *SitesMutation) FieldCleared(name string) bool
- func (m *SitesMutation) Fields() []string
- func (m *SitesMutation) ID() (id int, exists bool)
- func (m *SitesMutation) IDs(ctx context.Context) ([]int, error)
- func (m *SitesMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *SitesMutation) OldDomain(ctx context.Context) (v string, err error)
- func (m *SitesMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *SitesMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *SitesMutation) Op() Op
- func (m *SitesMutation) RemoveBlockIDs(ids ...int)
- func (m *SitesMutation) RemoveCategoryIDs(ids ...int)
- func (m *SitesMutation) RemoveSitesCategoryIDs(ids ...int)
- func (m *SitesMutation) RemovedBlocksIDs() (ids []int)
- func (m *SitesMutation) RemovedCategoriesIDs() (ids []int)
- func (m *SitesMutation) RemovedEdges() []string
- func (m *SitesMutation) RemovedIDs(name string) []ent.Value
- func (m *SitesMutation) RemovedSitesCategoriesIDs() (ids []int)
- func (m *SitesMutation) ResetBlocks()
- func (m *SitesMutation) ResetCategories()
- func (m *SitesMutation) ResetCreatedAt()
- func (m *SitesMutation) ResetDomain()
- func (m *SitesMutation) ResetEdge(name string) error
- func (m *SitesMutation) ResetField(name string) error
- func (m *SitesMutation) ResetSitesCategories()
- func (m *SitesMutation) ResetUpdatedAt()
- func (m *SitesMutation) SetCreatedAt(t time.Time)
- func (m *SitesMutation) SetDomain(s string)
- func (m *SitesMutation) SetField(name string, value ent.Value) error
- func (m *SitesMutation) SetOp(op Op)
- func (m *SitesMutation) SetUpdatedAt(t time.Time)
- func (m *SitesMutation) SitesCategoriesCleared() bool
- func (m *SitesMutation) SitesCategoriesIDs() (ids []int)
- func (m SitesMutation) Tx() (*Tx, error)
- func (m *SitesMutation) Type() string
- func (m *SitesMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *SitesMutation) Where(ps ...predicate.Sites)
- func (m *SitesMutation) WhereP(ps ...func(*sql.Selector))
- type SitesQuery
- func (sq *SitesQuery) Aggregate(fns ...AggregateFunc) *SitesSelect
- func (sq *SitesQuery) All(ctx context.Context) ([]*Sites, error)
- func (sq *SitesQuery) AllX(ctx context.Context) []*Sites
- func (sq *SitesQuery) Clone() *SitesQuery
- func (sq *SitesQuery) Count(ctx context.Context) (int, error)
- func (sq *SitesQuery) CountX(ctx context.Context) int
- func (sq *SitesQuery) Exist(ctx context.Context) (bool, error)
- func (sq *SitesQuery) ExistX(ctx context.Context) bool
- func (sq *SitesQuery) First(ctx context.Context) (*Sites, error)
- func (sq *SitesQuery) FirstID(ctx context.Context) (id int, err error)
- func (sq *SitesQuery) FirstIDX(ctx context.Context) int
- func (sq *SitesQuery) FirstX(ctx context.Context) *Sites
- func (sq *SitesQuery) GroupBy(field string, fields ...string) *SitesGroupBy
- func (sq *SitesQuery) IDs(ctx context.Context) (ids []int, err error)
- func (sq *SitesQuery) IDsX(ctx context.Context) []int
- func (sq *SitesQuery) Limit(limit int) *SitesQuery
- func (sq *SitesQuery) Offset(offset int) *SitesQuery
- func (sq *SitesQuery) Only(ctx context.Context) (*Sites, error)
- func (sq *SitesQuery) OnlyID(ctx context.Context) (id int, err error)
- func (sq *SitesQuery) OnlyIDX(ctx context.Context) int
- func (sq *SitesQuery) OnlyX(ctx context.Context) *Sites
- func (sq *SitesQuery) Order(o ...sites.OrderOption) *SitesQuery
- func (sq *SitesQuery) QueryBlocks() *BlocksQuery
- func (sq *SitesQuery) QueryCategories() *CategoriesQuery
- func (sq *SitesQuery) QuerySitesCategories() *SitesCategoriesQuery
- func (sq *SitesQuery) Select(fields ...string) *SitesSelect
- func (sq *SitesQuery) Unique(unique bool) *SitesQuery
- func (sq *SitesQuery) Where(ps ...predicate.Sites) *SitesQuery
- func (sq *SitesQuery) WithBlocks(opts ...func(*BlocksQuery)) *SitesQuery
- func (sq *SitesQuery) WithCategories(opts ...func(*CategoriesQuery)) *SitesQuery
- func (sq *SitesQuery) WithSitesCategories(opts ...func(*SitesCategoriesQuery)) *SitesQuery
- type SitesSelect
- func (ss *SitesSelect) Aggregate(fns ...AggregateFunc) *SitesSelect
- func (s *SitesSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *SitesSelect) BoolX(ctx context.Context) bool
- func (s *SitesSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *SitesSelect) BoolsX(ctx context.Context) []bool
- func (s *SitesSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *SitesSelect) Float64X(ctx context.Context) float64
- func (s *SitesSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *SitesSelect) Float64sX(ctx context.Context) []float64
- func (s *SitesSelect) Int(ctx context.Context) (_ int, err error)
- func (s *SitesSelect) IntX(ctx context.Context) int
- func (s *SitesSelect) Ints(ctx context.Context) ([]int, error)
- func (s *SitesSelect) IntsX(ctx context.Context) []int
- func (ss *SitesSelect) Scan(ctx context.Context, v any) error
- func (s *SitesSelect) ScanX(ctx context.Context, v any)
- func (s *SitesSelect) String(ctx context.Context) (_ string, err error)
- func (s *SitesSelect) StringX(ctx context.Context) string
- func (s *SitesSelect) Strings(ctx context.Context) ([]string, error)
- func (s *SitesSelect) StringsX(ctx context.Context) []string
- type SitesSlice
- type SitesUpdate
- func (su *SitesUpdate) AddBlockIDs(ids ...int) *SitesUpdate
- func (su *SitesUpdate) AddBlocks(b ...*Blocks) *SitesUpdate
- func (su *SitesUpdate) AddCategories(c ...*Categories) *SitesUpdate
- func (su *SitesUpdate) AddCategoryIDs(ids ...int) *SitesUpdate
- func (su *SitesUpdate) AddSitesCategories(s ...*SitesCategories) *SitesUpdate
- func (su *SitesUpdate) AddSitesCategoryIDs(ids ...int) *SitesUpdate
- func (su *SitesUpdate) ClearBlocks() *SitesUpdate
- func (su *SitesUpdate) ClearCategories() *SitesUpdate
- func (su *SitesUpdate) ClearSitesCategories() *SitesUpdate
- func (su *SitesUpdate) Exec(ctx context.Context) error
- func (su *SitesUpdate) ExecX(ctx context.Context)
- func (su *SitesUpdate) Mutation() *SitesMutation
- func (su *SitesUpdate) RemoveBlockIDs(ids ...int) *SitesUpdate
- func (su *SitesUpdate) RemoveBlocks(b ...*Blocks) *SitesUpdate
- func (su *SitesUpdate) RemoveCategories(c ...*Categories) *SitesUpdate
- func (su *SitesUpdate) RemoveCategoryIDs(ids ...int) *SitesUpdate
- func (su *SitesUpdate) RemoveSitesCategories(s ...*SitesCategories) *SitesUpdate
- func (su *SitesUpdate) RemoveSitesCategoryIDs(ids ...int) *SitesUpdate
- func (su *SitesUpdate) Save(ctx context.Context) (int, error)
- func (su *SitesUpdate) SaveX(ctx context.Context) int
- func (su *SitesUpdate) SetDomain(s string) *SitesUpdate
- func (su *SitesUpdate) SetNillableDomain(s *string) *SitesUpdate
- func (su *SitesUpdate) SetUpdatedAt(t time.Time) *SitesUpdate
- func (su *SitesUpdate) Where(ps ...predicate.Sites) *SitesUpdate
- type SitesUpdateOne
- func (suo *SitesUpdateOne) AddBlockIDs(ids ...int) *SitesUpdateOne
- func (suo *SitesUpdateOne) AddBlocks(b ...*Blocks) *SitesUpdateOne
- func (suo *SitesUpdateOne) AddCategories(c ...*Categories) *SitesUpdateOne
- func (suo *SitesUpdateOne) AddCategoryIDs(ids ...int) *SitesUpdateOne
- func (suo *SitesUpdateOne) AddSitesCategories(s ...*SitesCategories) *SitesUpdateOne
- func (suo *SitesUpdateOne) AddSitesCategoryIDs(ids ...int) *SitesUpdateOne
- func (suo *SitesUpdateOne) ClearBlocks() *SitesUpdateOne
- func (suo *SitesUpdateOne) ClearCategories() *SitesUpdateOne
- func (suo *SitesUpdateOne) ClearSitesCategories() *SitesUpdateOne
- func (suo *SitesUpdateOne) Exec(ctx context.Context) error
- func (suo *SitesUpdateOne) ExecX(ctx context.Context)
- func (suo *SitesUpdateOne) Mutation() *SitesMutation
- func (suo *SitesUpdateOne) RemoveBlockIDs(ids ...int) *SitesUpdateOne
- func (suo *SitesUpdateOne) RemoveBlocks(b ...*Blocks) *SitesUpdateOne
- func (suo *SitesUpdateOne) RemoveCategories(c ...*Categories) *SitesUpdateOne
- func (suo *SitesUpdateOne) RemoveCategoryIDs(ids ...int) *SitesUpdateOne
- func (suo *SitesUpdateOne) RemoveSitesCategories(s ...*SitesCategories) *SitesUpdateOne
- func (suo *SitesUpdateOne) RemoveSitesCategoryIDs(ids ...int) *SitesUpdateOne
- func (suo *SitesUpdateOne) Save(ctx context.Context) (*Sites, error)
- func (suo *SitesUpdateOne) SaveX(ctx context.Context) *Sites
- func (suo *SitesUpdateOne) Select(field string, fields ...string) *SitesUpdateOne
- func (suo *SitesUpdateOne) SetDomain(s string) *SitesUpdateOne
- func (suo *SitesUpdateOne) SetNillableDomain(s *string) *SitesUpdateOne
- func (suo *SitesUpdateOne) SetUpdatedAt(t time.Time) *SitesUpdateOne
- func (suo *SitesUpdateOne) Where(ps ...predicate.Sites) *SitesUpdateOne
- 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. TypeBlocks = "Blocks" TypeCategories = "Categories" TypeCounter = "Counter" TypeIsps = "Isps" TypeSites = "Sites" TypeSitesCategories = "SitesCategories" )
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 Blocks ¶
type Blocks struct { // ID of the ent. ID int `json:"id,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` // SiteID holds the value of the "site_id" field. SiteID int `json:"site_id,omitempty"` // IspID holds the value of the "isp_id" field. IspID int `json:"isp_id,omitempty"` // BlockReports holds the value of the "block_reports" field. BlockReports int `json:"block_reports,omitempty"` // UnblockReports holds the value of the "unblock_reports" field. UnblockReports int `json:"unblock_reports,omitempty"` // LastReportedAt holds the value of the "last_reported_at" field. LastReportedAt time.Time `json:"last_reported_at,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the BlocksQuery when eager-loading is set. Edges BlocksEdges `json:"edges"` // contains filtered or unexported fields }
Blocks is the model entity for the Blocks schema.
func (*Blocks) QuerySite ¶
func (b *Blocks) QuerySite() *SitesQuery
QuerySite queries the "site" edge of the Blocks entity.
func (*Blocks) Unwrap ¶
Unwrap unwraps the Blocks 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 (*Blocks) Update ¶
func (b *Blocks) Update() *BlocksUpdateOne
Update returns a builder for updating this Blocks. Note that you need to call Blocks.Unwrap() before calling this method if this Blocks was returned from a transaction, and the transaction was committed or rolled back.
type BlocksClient ¶
type BlocksClient struct {
// contains filtered or unexported fields
}
BlocksClient is a client for the Blocks schema.
func NewBlocksClient ¶
func NewBlocksClient(c config) *BlocksClient
NewBlocksClient returns a client for the Blocks from the given config.
func (*BlocksClient) Create ¶
func (c *BlocksClient) Create() *BlocksCreate
Create returns a builder for creating a Blocks entity.
func (*BlocksClient) CreateBulk ¶
func (c *BlocksClient) CreateBulk(builders ...*BlocksCreate) *BlocksCreateBulk
CreateBulk returns a builder for creating a bulk of Blocks entities.
func (*BlocksClient) Delete ¶
func (c *BlocksClient) Delete() *BlocksDelete
Delete returns a delete builder for Blocks.
func (*BlocksClient) DeleteOne ¶
func (c *BlocksClient) DeleteOne(b *Blocks) *BlocksDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*BlocksClient) DeleteOneID ¶
func (c *BlocksClient) DeleteOneID(id int) *BlocksDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*BlocksClient) GetX ¶
func (c *BlocksClient) GetX(ctx context.Context, id int) *Blocks
GetX is like Get, but panics if an error occurs.
func (*BlocksClient) Intercept ¶
func (c *BlocksClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `blocks.Intercept(f(g(h())))`.
func (*BlocksClient) Interceptors ¶
func (c *BlocksClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*BlocksClient) MapCreateBulk ¶
func (c *BlocksClient) MapCreateBulk(slice any, setFunc func(*BlocksCreate, int)) *BlocksCreateBulk
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 (*BlocksClient) Query ¶
func (c *BlocksClient) Query() *BlocksQuery
Query returns a query builder for Blocks.
func (*BlocksClient) QueryIsp ¶
func (c *BlocksClient) QueryIsp(b *Blocks) *IspsQuery
QueryIsp queries the isp edge of a Blocks.
func (*BlocksClient) QuerySite ¶
func (c *BlocksClient) QuerySite(b *Blocks) *SitesQuery
QuerySite queries the site edge of a Blocks.
func (*BlocksClient) Update ¶
func (c *BlocksClient) Update() *BlocksUpdate
Update returns an update builder for Blocks.
func (*BlocksClient) UpdateOne ¶
func (c *BlocksClient) UpdateOne(b *Blocks) *BlocksUpdateOne
UpdateOne returns an update builder for the given entity.
func (*BlocksClient) UpdateOneID ¶
func (c *BlocksClient) UpdateOneID(id int) *BlocksUpdateOne
UpdateOneID returns an update builder for the given id.
func (*BlocksClient) Use ¶
func (c *BlocksClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `blocks.Hooks(f(g(h())))`.
type BlocksCreate ¶
type BlocksCreate struct {
// contains filtered or unexported fields
}
BlocksCreate is the builder for creating a Blocks entity.
func (*BlocksCreate) Exec ¶
func (bc *BlocksCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*BlocksCreate) ExecX ¶
func (bc *BlocksCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BlocksCreate) Mutation ¶
func (bc *BlocksCreate) Mutation() *BlocksMutation
Mutation returns the BlocksMutation object of the builder.
func (*BlocksCreate) Save ¶
func (bc *BlocksCreate) Save(ctx context.Context) (*Blocks, error)
Save creates the Blocks in the database.
func (*BlocksCreate) SaveX ¶
func (bc *BlocksCreate) SaveX(ctx context.Context) *Blocks
SaveX calls Save and panics if Save returns an error.
func (*BlocksCreate) SetBlockReports ¶
func (bc *BlocksCreate) SetBlockReports(i int) *BlocksCreate
SetBlockReports sets the "block_reports" field.
func (*BlocksCreate) SetCreatedAt ¶
func (bc *BlocksCreate) SetCreatedAt(t time.Time) *BlocksCreate
SetCreatedAt sets the "created_at" field.
func (*BlocksCreate) SetIsp ¶
func (bc *BlocksCreate) SetIsp(i *Isps) *BlocksCreate
SetIsp sets the "isp" edge to the Isps entity.
func (*BlocksCreate) SetIspID ¶
func (bc *BlocksCreate) SetIspID(i int) *BlocksCreate
SetIspID sets the "isp_id" field.
func (*BlocksCreate) SetLastReportedAt ¶
func (bc *BlocksCreate) SetLastReportedAt(t time.Time) *BlocksCreate
SetLastReportedAt sets the "last_reported_at" field.
func (*BlocksCreate) SetNillableBlockReports ¶
func (bc *BlocksCreate) SetNillableBlockReports(i *int) *BlocksCreate
SetNillableBlockReports sets the "block_reports" field if the given value is not nil.
func (*BlocksCreate) SetNillableCreatedAt ¶
func (bc *BlocksCreate) SetNillableCreatedAt(t *time.Time) *BlocksCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*BlocksCreate) SetNillableUnblockReports ¶
func (bc *BlocksCreate) SetNillableUnblockReports(i *int) *BlocksCreate
SetNillableUnblockReports sets the "unblock_reports" field if the given value is not nil.
func (*BlocksCreate) SetNillableUpdatedAt ¶
func (bc *BlocksCreate) SetNillableUpdatedAt(t *time.Time) *BlocksCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*BlocksCreate) SetSite ¶
func (bc *BlocksCreate) SetSite(s *Sites) *BlocksCreate
SetSite sets the "site" edge to the Sites entity.
func (*BlocksCreate) SetSiteID ¶
func (bc *BlocksCreate) SetSiteID(i int) *BlocksCreate
SetSiteID sets the "site_id" field.
func (*BlocksCreate) SetUnblockReports ¶
func (bc *BlocksCreate) SetUnblockReports(i int) *BlocksCreate
SetUnblockReports sets the "unblock_reports" field.
func (*BlocksCreate) SetUpdatedAt ¶
func (bc *BlocksCreate) SetUpdatedAt(t time.Time) *BlocksCreate
SetUpdatedAt sets the "updated_at" field.
type BlocksCreateBulk ¶
type BlocksCreateBulk struct {
// contains filtered or unexported fields
}
BlocksCreateBulk is the builder for creating many Blocks entities in bulk.
func (*BlocksCreateBulk) Exec ¶
func (bcb *BlocksCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*BlocksCreateBulk) ExecX ¶
func (bcb *BlocksCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type BlocksDelete ¶
type BlocksDelete struct {
// contains filtered or unexported fields
}
BlocksDelete is the builder for deleting a Blocks entity.
func (*BlocksDelete) Exec ¶
func (bd *BlocksDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*BlocksDelete) ExecX ¶
func (bd *BlocksDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*BlocksDelete) Where ¶
func (bd *BlocksDelete) Where(ps ...predicate.Blocks) *BlocksDelete
Where appends a list predicates to the BlocksDelete builder.
type BlocksDeleteOne ¶
type BlocksDeleteOne struct {
// contains filtered or unexported fields
}
BlocksDeleteOne is the builder for deleting a single Blocks entity.
func (*BlocksDeleteOne) Exec ¶
func (bdo *BlocksDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*BlocksDeleteOne) ExecX ¶
func (bdo *BlocksDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BlocksDeleteOne) Where ¶
func (bdo *BlocksDeleteOne) Where(ps ...predicate.Blocks) *BlocksDeleteOne
Where appends a list predicates to the BlocksDelete builder.
type BlocksEdges ¶
type BlocksEdges struct { // Site holds the value of the site edge. Site *Sites `json:"site,omitempty"` // Isp holds the value of the isp edge. Isp *Isps `json:"isp,omitempty"` // contains filtered or unexported fields }
BlocksEdges holds the relations/edges for other nodes in the graph.
func (BlocksEdges) IspOrErr ¶
func (e BlocksEdges) IspOrErr() (*Isps, error)
IspOrErr returns the Isp value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (BlocksEdges) SiteOrErr ¶
func (e BlocksEdges) SiteOrErr() (*Sites, error)
SiteOrErr returns the Site value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type BlocksGroupBy ¶
type BlocksGroupBy struct {
// contains filtered or unexported fields
}
BlocksGroupBy is the group-by builder for Blocks entities.
func (*BlocksGroupBy) Aggregate ¶
func (bgb *BlocksGroupBy) Aggregate(fns ...AggregateFunc) *BlocksGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*BlocksGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*BlocksGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*BlocksGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*BlocksGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*BlocksGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*BlocksGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*BlocksGroupBy) Scan ¶
func (bgb *BlocksGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*BlocksGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type BlocksMutation ¶
type BlocksMutation struct {
// contains filtered or unexported fields
}
BlocksMutation represents an operation that mutates the Blocks nodes in the graph.
func (*BlocksMutation) AddBlockReports ¶
func (m *BlocksMutation) AddBlockReports(i int)
AddBlockReports adds i to the "block_reports" field.
func (*BlocksMutation) AddField ¶
func (m *BlocksMutation) 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 (*BlocksMutation) AddUnblockReports ¶
func (m *BlocksMutation) AddUnblockReports(i int)
AddUnblockReports adds i to the "unblock_reports" field.
func (*BlocksMutation) AddedBlockReports ¶
func (m *BlocksMutation) AddedBlockReports() (r int, exists bool)
AddedBlockReports returns the value that was added to the "block_reports" field in this mutation.
func (*BlocksMutation) AddedEdges ¶
func (m *BlocksMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*BlocksMutation) AddedField ¶
func (m *BlocksMutation) 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 (*BlocksMutation) AddedFields ¶
func (m *BlocksMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*BlocksMutation) AddedIDs ¶
func (m *BlocksMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*BlocksMutation) AddedUnblockReports ¶
func (m *BlocksMutation) AddedUnblockReports() (r int, exists bool)
AddedUnblockReports returns the value that was added to the "unblock_reports" field in this mutation.
func (*BlocksMutation) BlockReports ¶
func (m *BlocksMutation) BlockReports() (r int, exists bool)
BlockReports returns the value of the "block_reports" field in the mutation.
func (*BlocksMutation) ClearEdge ¶
func (m *BlocksMutation) 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 (*BlocksMutation) ClearField ¶
func (m *BlocksMutation) 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 (*BlocksMutation) ClearIsp ¶
func (m *BlocksMutation) ClearIsp()
ClearIsp clears the "isp" edge to the Isps entity.
func (*BlocksMutation) ClearSite ¶
func (m *BlocksMutation) ClearSite()
ClearSite clears the "site" edge to the Sites entity.
func (*BlocksMutation) ClearedEdges ¶
func (m *BlocksMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*BlocksMutation) ClearedFields ¶
func (m *BlocksMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (BlocksMutation) Client ¶
func (m BlocksMutation) 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 (*BlocksMutation) CreatedAt ¶
func (m *BlocksMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*BlocksMutation) EdgeCleared ¶
func (m *BlocksMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*BlocksMutation) Field ¶
func (m *BlocksMutation) 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 (*BlocksMutation) FieldCleared ¶
func (m *BlocksMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*BlocksMutation) Fields ¶
func (m *BlocksMutation) 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 (*BlocksMutation) ID ¶
func (m *BlocksMutation) 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 (*BlocksMutation) IDs ¶
func (m *BlocksMutation) 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 (*BlocksMutation) IspCleared ¶
func (m *BlocksMutation) IspCleared() bool
IspCleared reports if the "isp" edge to the Isps entity was cleared.
func (*BlocksMutation) IspID ¶
func (m *BlocksMutation) IspID() (r int, exists bool)
IspID returns the value of the "isp_id" field in the mutation.
func (*BlocksMutation) IspIDs ¶
func (m *BlocksMutation) IspIDs() (ids []int)
IspIDs returns the "isp" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use IspID instead. It exists only for internal usage by the builders.
func (*BlocksMutation) LastReportedAt ¶
func (m *BlocksMutation) LastReportedAt() (r time.Time, exists bool)
LastReportedAt returns the value of the "last_reported_at" field in the mutation.
func (*BlocksMutation) OldBlockReports ¶
func (m *BlocksMutation) OldBlockReports(ctx context.Context) (v int, err error)
OldBlockReports returns the old "block_reports" field's value of the Blocks entity. If the Blocks 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 (*BlocksMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Blocks entity. If the Blocks 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 (*BlocksMutation) 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 (*BlocksMutation) OldIspID ¶
func (m *BlocksMutation) OldIspID(ctx context.Context) (v int, err error)
OldIspID returns the old "isp_id" field's value of the Blocks entity. If the Blocks 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 (*BlocksMutation) OldLastReportedAt ¶
OldLastReportedAt returns the old "last_reported_at" field's value of the Blocks entity. If the Blocks 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 (*BlocksMutation) OldSiteID ¶
func (m *BlocksMutation) OldSiteID(ctx context.Context) (v int, err error)
OldSiteID returns the old "site_id" field's value of the Blocks entity. If the Blocks 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 (*BlocksMutation) OldUnblockReports ¶
func (m *BlocksMutation) OldUnblockReports(ctx context.Context) (v int, err error)
OldUnblockReports returns the old "unblock_reports" field's value of the Blocks entity. If the Blocks 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 (*BlocksMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Blocks entity. If the Blocks 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 (*BlocksMutation) RemovedEdges ¶
func (m *BlocksMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*BlocksMutation) RemovedIDs ¶
func (m *BlocksMutation) 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 (*BlocksMutation) ResetBlockReports ¶
func (m *BlocksMutation) ResetBlockReports()
ResetBlockReports resets all changes to the "block_reports" field.
func (*BlocksMutation) ResetCreatedAt ¶
func (m *BlocksMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*BlocksMutation) ResetEdge ¶
func (m *BlocksMutation) 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 (*BlocksMutation) ResetField ¶
func (m *BlocksMutation) 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 (*BlocksMutation) ResetIsp ¶
func (m *BlocksMutation) ResetIsp()
ResetIsp resets all changes to the "isp" edge.
func (*BlocksMutation) ResetIspID ¶
func (m *BlocksMutation) ResetIspID()
ResetIspID resets all changes to the "isp_id" field.
func (*BlocksMutation) ResetLastReportedAt ¶
func (m *BlocksMutation) ResetLastReportedAt()
ResetLastReportedAt resets all changes to the "last_reported_at" field.
func (*BlocksMutation) ResetSite ¶
func (m *BlocksMutation) ResetSite()
ResetSite resets all changes to the "site" edge.
func (*BlocksMutation) ResetSiteID ¶
func (m *BlocksMutation) ResetSiteID()
ResetSiteID resets all changes to the "site_id" field.
func (*BlocksMutation) ResetUnblockReports ¶
func (m *BlocksMutation) ResetUnblockReports()
ResetUnblockReports resets all changes to the "unblock_reports" field.
func (*BlocksMutation) ResetUpdatedAt ¶
func (m *BlocksMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*BlocksMutation) SetBlockReports ¶
func (m *BlocksMutation) SetBlockReports(i int)
SetBlockReports sets the "block_reports" field.
func (*BlocksMutation) SetCreatedAt ¶
func (m *BlocksMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*BlocksMutation) SetField ¶
func (m *BlocksMutation) 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 (*BlocksMutation) SetIspID ¶
func (m *BlocksMutation) SetIspID(i int)
SetIspID sets the "isp_id" field.
func (*BlocksMutation) SetLastReportedAt ¶
func (m *BlocksMutation) SetLastReportedAt(t time.Time)
SetLastReportedAt sets the "last_reported_at" field.
func (*BlocksMutation) SetOp ¶
func (m *BlocksMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*BlocksMutation) SetSiteID ¶
func (m *BlocksMutation) SetSiteID(i int)
SetSiteID sets the "site_id" field.
func (*BlocksMutation) SetUnblockReports ¶
func (m *BlocksMutation) SetUnblockReports(i int)
SetUnblockReports sets the "unblock_reports" field.
func (*BlocksMutation) SetUpdatedAt ¶
func (m *BlocksMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*BlocksMutation) SiteCleared ¶
func (m *BlocksMutation) SiteCleared() bool
SiteCleared reports if the "site" edge to the Sites entity was cleared.
func (*BlocksMutation) SiteID ¶
func (m *BlocksMutation) SiteID() (r int, exists bool)
SiteID returns the value of the "site_id" field in the mutation.
func (*BlocksMutation) SiteIDs ¶
func (m *BlocksMutation) SiteIDs() (ids []int)
SiteIDs returns the "site" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use SiteID instead. It exists only for internal usage by the builders.
func (BlocksMutation) Tx ¶
func (m BlocksMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*BlocksMutation) Type ¶
func (m *BlocksMutation) Type() string
Type returns the node type of this mutation (Blocks).
func (*BlocksMutation) UnblockReports ¶
func (m *BlocksMutation) UnblockReports() (r int, exists bool)
UnblockReports returns the value of the "unblock_reports" field in the mutation.
func (*BlocksMutation) UpdatedAt ¶
func (m *BlocksMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*BlocksMutation) Where ¶
func (m *BlocksMutation) Where(ps ...predicate.Blocks)
Where appends a list predicates to the BlocksMutation builder.
func (*BlocksMutation) WhereP ¶
func (m *BlocksMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the BlocksMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type BlocksQuery ¶
type BlocksQuery struct {
// contains filtered or unexported fields
}
BlocksQuery is the builder for querying Blocks entities.
func (*BlocksQuery) Aggregate ¶
func (bq *BlocksQuery) Aggregate(fns ...AggregateFunc) *BlocksSelect
Aggregate returns a BlocksSelect configured with the given aggregations.
func (*BlocksQuery) All ¶
func (bq *BlocksQuery) All(ctx context.Context) ([]*Blocks, error)
All executes the query and returns a list of BlocksSlice.
func (*BlocksQuery) AllX ¶
func (bq *BlocksQuery) AllX(ctx context.Context) []*Blocks
AllX is like All, but panics if an error occurs.
func (*BlocksQuery) Clone ¶
func (bq *BlocksQuery) Clone() *BlocksQuery
Clone returns a duplicate of the BlocksQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*BlocksQuery) Count ¶
func (bq *BlocksQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*BlocksQuery) CountX ¶
func (bq *BlocksQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*BlocksQuery) Exist ¶
func (bq *BlocksQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*BlocksQuery) ExistX ¶
func (bq *BlocksQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*BlocksQuery) First ¶
func (bq *BlocksQuery) First(ctx context.Context) (*Blocks, error)
First returns the first Blocks entity from the query. Returns a *NotFoundError when no Blocks was found.
func (*BlocksQuery) FirstID ¶
func (bq *BlocksQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Blocks ID from the query. Returns a *NotFoundError when no Blocks ID was found.
func (*BlocksQuery) FirstIDX ¶
func (bq *BlocksQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*BlocksQuery) FirstX ¶
func (bq *BlocksQuery) FirstX(ctx context.Context) *Blocks
FirstX is like First, but panics if an error occurs.
func (*BlocksQuery) GroupBy ¶
func (bq *BlocksQuery) GroupBy(field string, fields ...string) *BlocksGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { CreatedAt time.Time `json:"created_at,omitempty"` Count int `json:"count,omitempty"` } client.Blocks.Query(). GroupBy(blocks.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*BlocksQuery) IDs ¶
func (bq *BlocksQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Blocks IDs.
func (*BlocksQuery) IDsX ¶
func (bq *BlocksQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*BlocksQuery) Limit ¶
func (bq *BlocksQuery) Limit(limit int) *BlocksQuery
Limit the number of records to be returned by this query.
func (*BlocksQuery) Offset ¶
func (bq *BlocksQuery) Offset(offset int) *BlocksQuery
Offset to start from.
func (*BlocksQuery) Only ¶
func (bq *BlocksQuery) Only(ctx context.Context) (*Blocks, error)
Only returns a single Blocks entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Blocks entity is found. Returns a *NotFoundError when no Blocks entities are found.
func (*BlocksQuery) OnlyID ¶
func (bq *BlocksQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Blocks ID in the query. Returns a *NotSingularError when more than one Blocks ID is found. Returns a *NotFoundError when no entities are found.
func (*BlocksQuery) OnlyIDX ¶
func (bq *BlocksQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*BlocksQuery) OnlyX ¶
func (bq *BlocksQuery) OnlyX(ctx context.Context) *Blocks
OnlyX is like Only, but panics if an error occurs.
func (*BlocksQuery) Order ¶
func (bq *BlocksQuery) Order(o ...blocks.OrderOption) *BlocksQuery
Order specifies how the records should be ordered.
func (*BlocksQuery) QueryIsp ¶
func (bq *BlocksQuery) QueryIsp() *IspsQuery
QueryIsp chains the current query on the "isp" edge.
func (*BlocksQuery) QuerySite ¶
func (bq *BlocksQuery) QuerySite() *SitesQuery
QuerySite chains the current query on the "site" edge.
func (*BlocksQuery) Select ¶
func (bq *BlocksQuery) Select(fields ...string) *BlocksSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { CreatedAt time.Time `json:"created_at,omitempty"` } client.Blocks.Query(). Select(blocks.FieldCreatedAt). Scan(ctx, &v)
func (*BlocksQuery) Unique ¶
func (bq *BlocksQuery) Unique(unique bool) *BlocksQuery
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 (*BlocksQuery) Where ¶
func (bq *BlocksQuery) Where(ps ...predicate.Blocks) *BlocksQuery
Where adds a new predicate for the BlocksQuery builder.
func (*BlocksQuery) WithIsp ¶
func (bq *BlocksQuery) WithIsp(opts ...func(*IspsQuery)) *BlocksQuery
WithIsp tells the query-builder to eager-load the nodes that are connected to the "isp" edge. The optional arguments are used to configure the query builder of the edge.
func (*BlocksQuery) WithSite ¶
func (bq *BlocksQuery) WithSite(opts ...func(*SitesQuery)) *BlocksQuery
WithSite tells the query-builder to eager-load the nodes that are connected to the "site" edge. The optional arguments are used to configure the query builder of the edge.
type BlocksSelect ¶
type BlocksSelect struct { *BlocksQuery // contains filtered or unexported fields }
BlocksSelect is the builder for selecting fields of Blocks entities.
func (*BlocksSelect) Aggregate ¶
func (bs *BlocksSelect) Aggregate(fns ...AggregateFunc) *BlocksSelect
Aggregate adds the given aggregation functions to the selector query.
func (*BlocksSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*BlocksSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*BlocksSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*BlocksSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*BlocksSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*BlocksSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*BlocksSelect) Scan ¶
func (bs *BlocksSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*BlocksSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type BlocksUpdate ¶
type BlocksUpdate struct {
// contains filtered or unexported fields
}
BlocksUpdate is the builder for updating Blocks entities.
func (*BlocksUpdate) AddBlockReports ¶
func (bu *BlocksUpdate) AddBlockReports(i int) *BlocksUpdate
AddBlockReports adds i to the "block_reports" field.
func (*BlocksUpdate) AddUnblockReports ¶
func (bu *BlocksUpdate) AddUnblockReports(i int) *BlocksUpdate
AddUnblockReports adds i to the "unblock_reports" field.
func (*BlocksUpdate) ClearIsp ¶
func (bu *BlocksUpdate) ClearIsp() *BlocksUpdate
ClearIsp clears the "isp" edge to the Isps entity.
func (*BlocksUpdate) ClearSite ¶
func (bu *BlocksUpdate) ClearSite() *BlocksUpdate
ClearSite clears the "site" edge to the Sites entity.
func (*BlocksUpdate) Exec ¶
func (bu *BlocksUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*BlocksUpdate) ExecX ¶
func (bu *BlocksUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BlocksUpdate) Mutation ¶
func (bu *BlocksUpdate) Mutation() *BlocksMutation
Mutation returns the BlocksMutation object of the builder.
func (*BlocksUpdate) Save ¶
func (bu *BlocksUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*BlocksUpdate) SaveX ¶
func (bu *BlocksUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*BlocksUpdate) SetBlockReports ¶
func (bu *BlocksUpdate) SetBlockReports(i int) *BlocksUpdate
SetBlockReports sets the "block_reports" field.
func (*BlocksUpdate) SetIsp ¶
func (bu *BlocksUpdate) SetIsp(i *Isps) *BlocksUpdate
SetIsp sets the "isp" edge to the Isps entity.
func (*BlocksUpdate) SetIspID ¶
func (bu *BlocksUpdate) SetIspID(i int) *BlocksUpdate
SetIspID sets the "isp_id" field.
func (*BlocksUpdate) SetLastReportedAt ¶
func (bu *BlocksUpdate) SetLastReportedAt(t time.Time) *BlocksUpdate
SetLastReportedAt sets the "last_reported_at" field.
func (*BlocksUpdate) SetNillableBlockReports ¶
func (bu *BlocksUpdate) SetNillableBlockReports(i *int) *BlocksUpdate
SetNillableBlockReports sets the "block_reports" field if the given value is not nil.
func (*BlocksUpdate) SetNillableIspID ¶
func (bu *BlocksUpdate) SetNillableIspID(i *int) *BlocksUpdate
SetNillableIspID sets the "isp_id" field if the given value is not nil.
func (*BlocksUpdate) SetNillableLastReportedAt ¶
func (bu *BlocksUpdate) SetNillableLastReportedAt(t *time.Time) *BlocksUpdate
SetNillableLastReportedAt sets the "last_reported_at" field if the given value is not nil.
func (*BlocksUpdate) SetNillableSiteID ¶
func (bu *BlocksUpdate) SetNillableSiteID(i *int) *BlocksUpdate
SetNillableSiteID sets the "site_id" field if the given value is not nil.
func (*BlocksUpdate) SetNillableUnblockReports ¶
func (bu *BlocksUpdate) SetNillableUnblockReports(i *int) *BlocksUpdate
SetNillableUnblockReports sets the "unblock_reports" field if the given value is not nil.
func (*BlocksUpdate) SetSite ¶
func (bu *BlocksUpdate) SetSite(s *Sites) *BlocksUpdate
SetSite sets the "site" edge to the Sites entity.
func (*BlocksUpdate) SetSiteID ¶
func (bu *BlocksUpdate) SetSiteID(i int) *BlocksUpdate
SetSiteID sets the "site_id" field.
func (*BlocksUpdate) SetUnblockReports ¶
func (bu *BlocksUpdate) SetUnblockReports(i int) *BlocksUpdate
SetUnblockReports sets the "unblock_reports" field.
func (*BlocksUpdate) SetUpdatedAt ¶
func (bu *BlocksUpdate) SetUpdatedAt(t time.Time) *BlocksUpdate
SetUpdatedAt sets the "updated_at" field.
func (*BlocksUpdate) Where ¶
func (bu *BlocksUpdate) Where(ps ...predicate.Blocks) *BlocksUpdate
Where appends a list predicates to the BlocksUpdate builder.
type BlocksUpdateOne ¶
type BlocksUpdateOne struct {
// contains filtered or unexported fields
}
BlocksUpdateOne is the builder for updating a single Blocks entity.
func (*BlocksUpdateOne) AddBlockReports ¶
func (buo *BlocksUpdateOne) AddBlockReports(i int) *BlocksUpdateOne
AddBlockReports adds i to the "block_reports" field.
func (*BlocksUpdateOne) AddUnblockReports ¶
func (buo *BlocksUpdateOne) AddUnblockReports(i int) *BlocksUpdateOne
AddUnblockReports adds i to the "unblock_reports" field.
func (*BlocksUpdateOne) ClearIsp ¶
func (buo *BlocksUpdateOne) ClearIsp() *BlocksUpdateOne
ClearIsp clears the "isp" edge to the Isps entity.
func (*BlocksUpdateOne) ClearSite ¶
func (buo *BlocksUpdateOne) ClearSite() *BlocksUpdateOne
ClearSite clears the "site" edge to the Sites entity.
func (*BlocksUpdateOne) Exec ¶
func (buo *BlocksUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*BlocksUpdateOne) ExecX ¶
func (buo *BlocksUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*BlocksUpdateOne) Mutation ¶
func (buo *BlocksUpdateOne) Mutation() *BlocksMutation
Mutation returns the BlocksMutation object of the builder.
func (*BlocksUpdateOne) Save ¶
func (buo *BlocksUpdateOne) Save(ctx context.Context) (*Blocks, error)
Save executes the query and returns the updated Blocks entity.
func (*BlocksUpdateOne) SaveX ¶
func (buo *BlocksUpdateOne) SaveX(ctx context.Context) *Blocks
SaveX is like Save, but panics if an error occurs.
func (*BlocksUpdateOne) Select ¶
func (buo *BlocksUpdateOne) Select(field string, fields ...string) *BlocksUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*BlocksUpdateOne) SetBlockReports ¶
func (buo *BlocksUpdateOne) SetBlockReports(i int) *BlocksUpdateOne
SetBlockReports sets the "block_reports" field.
func (*BlocksUpdateOne) SetIsp ¶
func (buo *BlocksUpdateOne) SetIsp(i *Isps) *BlocksUpdateOne
SetIsp sets the "isp" edge to the Isps entity.
func (*BlocksUpdateOne) SetIspID ¶
func (buo *BlocksUpdateOne) SetIspID(i int) *BlocksUpdateOne
SetIspID sets the "isp_id" field.
func (*BlocksUpdateOne) SetLastReportedAt ¶
func (buo *BlocksUpdateOne) SetLastReportedAt(t time.Time) *BlocksUpdateOne
SetLastReportedAt sets the "last_reported_at" field.
func (*BlocksUpdateOne) SetNillableBlockReports ¶
func (buo *BlocksUpdateOne) SetNillableBlockReports(i *int) *BlocksUpdateOne
SetNillableBlockReports sets the "block_reports" field if the given value is not nil.
func (*BlocksUpdateOne) SetNillableIspID ¶
func (buo *BlocksUpdateOne) SetNillableIspID(i *int) *BlocksUpdateOne
SetNillableIspID sets the "isp_id" field if the given value is not nil.
func (*BlocksUpdateOne) SetNillableLastReportedAt ¶
func (buo *BlocksUpdateOne) SetNillableLastReportedAt(t *time.Time) *BlocksUpdateOne
SetNillableLastReportedAt sets the "last_reported_at" field if the given value is not nil.
func (*BlocksUpdateOne) SetNillableSiteID ¶
func (buo *BlocksUpdateOne) SetNillableSiteID(i *int) *BlocksUpdateOne
SetNillableSiteID sets the "site_id" field if the given value is not nil.
func (*BlocksUpdateOne) SetNillableUnblockReports ¶
func (buo *BlocksUpdateOne) SetNillableUnblockReports(i *int) *BlocksUpdateOne
SetNillableUnblockReports sets the "unblock_reports" field if the given value is not nil.
func (*BlocksUpdateOne) SetSite ¶
func (buo *BlocksUpdateOne) SetSite(s *Sites) *BlocksUpdateOne
SetSite sets the "site" edge to the Sites entity.
func (*BlocksUpdateOne) SetSiteID ¶
func (buo *BlocksUpdateOne) SetSiteID(i int) *BlocksUpdateOne
SetSiteID sets the "site_id" field.
func (*BlocksUpdateOne) SetUnblockReports ¶
func (buo *BlocksUpdateOne) SetUnblockReports(i int) *BlocksUpdateOne
SetUnblockReports sets the "unblock_reports" field.
func (*BlocksUpdateOne) SetUpdatedAt ¶
func (buo *BlocksUpdateOne) SetUpdatedAt(t time.Time) *BlocksUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*BlocksUpdateOne) Where ¶
func (buo *BlocksUpdateOne) Where(ps ...predicate.Blocks) *BlocksUpdateOne
Where appends a list predicates to the BlocksUpdate builder.
type Categories ¶
type Categories struct { // ID of the ent. ID int `json:"id,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the CategoriesQuery when eager-loading is set. Edges CategoriesEdges `json:"edges"` // contains filtered or unexported fields }
Categories is the model entity for the Categories schema.
func (*Categories) QuerySites ¶
func (c *Categories) QuerySites() *SitesQuery
QuerySites queries the "sites" edge of the Categories entity.
func (*Categories) QuerySitesCategories ¶
func (c *Categories) QuerySitesCategories() *SitesCategoriesQuery
QuerySitesCategories queries the "sites_categories" edge of the Categories entity.
func (*Categories) String ¶
func (c *Categories) String() string
String implements the fmt.Stringer.
func (*Categories) Unwrap ¶
func (c *Categories) Unwrap() *Categories
Unwrap unwraps the Categories 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 (*Categories) Update ¶
func (c *Categories) Update() *CategoriesUpdateOne
Update returns a builder for updating this Categories. Note that you need to call Categories.Unwrap() before calling this method if this Categories was returned from a transaction, and the transaction was committed or rolled back.
type CategoriesClient ¶
type CategoriesClient struct {
// contains filtered or unexported fields
}
CategoriesClient is a client for the Categories schema.
func NewCategoriesClient ¶
func NewCategoriesClient(c config) *CategoriesClient
NewCategoriesClient returns a client for the Categories from the given config.
func (*CategoriesClient) Create ¶
func (c *CategoriesClient) Create() *CategoriesCreate
Create returns a builder for creating a Categories entity.
func (*CategoriesClient) CreateBulk ¶
func (c *CategoriesClient) CreateBulk(builders ...*CategoriesCreate) *CategoriesCreateBulk
CreateBulk returns a builder for creating a bulk of Categories entities.
func (*CategoriesClient) Delete ¶
func (c *CategoriesClient) Delete() *CategoriesDelete
Delete returns a delete builder for Categories.
func (*CategoriesClient) DeleteOne ¶
func (c *CategoriesClient) DeleteOne(ca *Categories) *CategoriesDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*CategoriesClient) DeleteOneID ¶
func (c *CategoriesClient) DeleteOneID(id int) *CategoriesDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*CategoriesClient) Get ¶
func (c *CategoriesClient) Get(ctx context.Context, id int) (*Categories, error)
Get returns a Categories entity by its id.
func (*CategoriesClient) GetX ¶
func (c *CategoriesClient) GetX(ctx context.Context, id int) *Categories
GetX is like Get, but panics if an error occurs.
func (*CategoriesClient) Hooks ¶
func (c *CategoriesClient) Hooks() []Hook
Hooks returns the client hooks.
func (*CategoriesClient) Intercept ¶
func (c *CategoriesClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `categories.Intercept(f(g(h())))`.
func (*CategoriesClient) Interceptors ¶
func (c *CategoriesClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*CategoriesClient) MapCreateBulk ¶
func (c *CategoriesClient) MapCreateBulk(slice any, setFunc func(*CategoriesCreate, int)) *CategoriesCreateBulk
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 (*CategoriesClient) Query ¶
func (c *CategoriesClient) Query() *CategoriesQuery
Query returns a query builder for Categories.
func (*CategoriesClient) QuerySites ¶
func (c *CategoriesClient) QuerySites(ca *Categories) *SitesQuery
QuerySites queries the sites edge of a Categories.
func (*CategoriesClient) QuerySitesCategories ¶
func (c *CategoriesClient) QuerySitesCategories(ca *Categories) *SitesCategoriesQuery
QuerySitesCategories queries the sites_categories edge of a Categories.
func (*CategoriesClient) Update ¶
func (c *CategoriesClient) Update() *CategoriesUpdate
Update returns an update builder for Categories.
func (*CategoriesClient) UpdateOne ¶
func (c *CategoriesClient) UpdateOne(ca *Categories) *CategoriesUpdateOne
UpdateOne returns an update builder for the given entity.
func (*CategoriesClient) UpdateOneID ¶
func (c *CategoriesClient) UpdateOneID(id int) *CategoriesUpdateOne
UpdateOneID returns an update builder for the given id.
func (*CategoriesClient) Use ¶
func (c *CategoriesClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `categories.Hooks(f(g(h())))`.
type CategoriesCreate ¶
type CategoriesCreate struct {
// contains filtered or unexported fields
}
CategoriesCreate is the builder for creating a Categories entity.
func (*CategoriesCreate) AddSiteIDs ¶
func (cc *CategoriesCreate) AddSiteIDs(ids ...int) *CategoriesCreate
AddSiteIDs adds the "sites" edge to the Sites entity by IDs.
func (*CategoriesCreate) AddSites ¶
func (cc *CategoriesCreate) AddSites(s ...*Sites) *CategoriesCreate
AddSites adds the "sites" edges to the Sites entity.
func (*CategoriesCreate) AddSitesCategories ¶
func (cc *CategoriesCreate) AddSitesCategories(s ...*SitesCategories) *CategoriesCreate
AddSitesCategories adds the "sites_categories" edges to the SitesCategories entity.
func (*CategoriesCreate) AddSitesCategoryIDs ¶
func (cc *CategoriesCreate) AddSitesCategoryIDs(ids ...int) *CategoriesCreate
AddSitesCategoryIDs adds the "sites_categories" edge to the SitesCategories entity by IDs.
func (*CategoriesCreate) Exec ¶
func (cc *CategoriesCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*CategoriesCreate) ExecX ¶
func (cc *CategoriesCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CategoriesCreate) Mutation ¶
func (cc *CategoriesCreate) Mutation() *CategoriesMutation
Mutation returns the CategoriesMutation object of the builder.
func (*CategoriesCreate) Save ¶
func (cc *CategoriesCreate) Save(ctx context.Context) (*Categories, error)
Save creates the Categories in the database.
func (*CategoriesCreate) SaveX ¶
func (cc *CategoriesCreate) SaveX(ctx context.Context) *Categories
SaveX calls Save and panics if Save returns an error.
func (*CategoriesCreate) SetCreatedAt ¶
func (cc *CategoriesCreate) SetCreatedAt(t time.Time) *CategoriesCreate
SetCreatedAt sets the "created_at" field.
func (*CategoriesCreate) SetName ¶
func (cc *CategoriesCreate) SetName(s string) *CategoriesCreate
SetName sets the "name" field.
func (*CategoriesCreate) SetNillableCreatedAt ¶
func (cc *CategoriesCreate) SetNillableCreatedAt(t *time.Time) *CategoriesCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*CategoriesCreate) SetNillableUpdatedAt ¶
func (cc *CategoriesCreate) SetNillableUpdatedAt(t *time.Time) *CategoriesCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*CategoriesCreate) SetUpdatedAt ¶
func (cc *CategoriesCreate) SetUpdatedAt(t time.Time) *CategoriesCreate
SetUpdatedAt sets the "updated_at" field.
type CategoriesCreateBulk ¶
type CategoriesCreateBulk struct {
// contains filtered or unexported fields
}
CategoriesCreateBulk is the builder for creating many Categories entities in bulk.
func (*CategoriesCreateBulk) Exec ¶
func (ccb *CategoriesCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*CategoriesCreateBulk) ExecX ¶
func (ccb *CategoriesCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CategoriesCreateBulk) Save ¶
func (ccb *CategoriesCreateBulk) Save(ctx context.Context) ([]*Categories, error)
Save creates the Categories entities in the database.
func (*CategoriesCreateBulk) SaveX ¶
func (ccb *CategoriesCreateBulk) SaveX(ctx context.Context) []*Categories
SaveX is like Save, but panics if an error occurs.
type CategoriesDelete ¶
type CategoriesDelete struct {
// contains filtered or unexported fields
}
CategoriesDelete is the builder for deleting a Categories entity.
func (*CategoriesDelete) Exec ¶
func (cd *CategoriesDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*CategoriesDelete) ExecX ¶
func (cd *CategoriesDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*CategoriesDelete) Where ¶
func (cd *CategoriesDelete) Where(ps ...predicate.Categories) *CategoriesDelete
Where appends a list predicates to the CategoriesDelete builder.
type CategoriesDeleteOne ¶
type CategoriesDeleteOne struct {
// contains filtered or unexported fields
}
CategoriesDeleteOne is the builder for deleting a single Categories entity.
func (*CategoriesDeleteOne) Exec ¶
func (cdo *CategoriesDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*CategoriesDeleteOne) ExecX ¶
func (cdo *CategoriesDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CategoriesDeleteOne) Where ¶
func (cdo *CategoriesDeleteOne) Where(ps ...predicate.Categories) *CategoriesDeleteOne
Where appends a list predicates to the CategoriesDelete builder.
type CategoriesEdges ¶
type CategoriesEdges struct { // Sites holds the value of the sites edge. Sites []*Sites `json:"sites,omitempty"` // SitesCategories holds the value of the sites_categories edge. SitesCategories []*SitesCategories `json:"sites_categories,omitempty"` // contains filtered or unexported fields }
CategoriesEdges holds the relations/edges for other nodes in the graph.
func (CategoriesEdges) SitesCategoriesOrErr ¶
func (e CategoriesEdges) SitesCategoriesOrErr() ([]*SitesCategories, error)
SitesCategoriesOrErr returns the SitesCategories value or an error if the edge was not loaded in eager-loading.
func (CategoriesEdges) SitesOrErr ¶
func (e CategoriesEdges) SitesOrErr() ([]*Sites, error)
SitesOrErr returns the Sites value or an error if the edge was not loaded in eager-loading.
type CategoriesGroupBy ¶
type CategoriesGroupBy struct {
// contains filtered or unexported fields
}
CategoriesGroupBy is the group-by builder for Categories entities.
func (*CategoriesGroupBy) Aggregate ¶
func (cgb *CategoriesGroupBy) Aggregate(fns ...AggregateFunc) *CategoriesGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*CategoriesGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CategoriesGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CategoriesGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CategoriesGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CategoriesGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CategoriesGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CategoriesGroupBy) Scan ¶
func (cgb *CategoriesGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*CategoriesGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CategoriesMutation ¶
type CategoriesMutation struct {
// contains filtered or unexported fields
}
CategoriesMutation represents an operation that mutates the Categories nodes in the graph.
func (*CategoriesMutation) AddField ¶
func (m *CategoriesMutation) 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 (*CategoriesMutation) AddSiteIDs ¶
func (m *CategoriesMutation) AddSiteIDs(ids ...int)
AddSiteIDs adds the "sites" edge to the Sites entity by ids.
func (*CategoriesMutation) AddSitesCategoryIDs ¶
func (m *CategoriesMutation) AddSitesCategoryIDs(ids ...int)
AddSitesCategoryIDs adds the "sites_categories" edge to the SitesCategories entity by ids.
func (*CategoriesMutation) AddedEdges ¶
func (m *CategoriesMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*CategoriesMutation) AddedField ¶
func (m *CategoriesMutation) 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 (*CategoriesMutation) AddedFields ¶
func (m *CategoriesMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*CategoriesMutation) AddedIDs ¶
func (m *CategoriesMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*CategoriesMutation) ClearEdge ¶
func (m *CategoriesMutation) 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 (*CategoriesMutation) ClearField ¶
func (m *CategoriesMutation) 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 (*CategoriesMutation) ClearSites ¶
func (m *CategoriesMutation) ClearSites()
ClearSites clears the "sites" edge to the Sites entity.
func (*CategoriesMutation) ClearSitesCategories ¶
func (m *CategoriesMutation) ClearSitesCategories()
ClearSitesCategories clears the "sites_categories" edge to the SitesCategories entity.
func (*CategoriesMutation) ClearedEdges ¶
func (m *CategoriesMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*CategoriesMutation) ClearedFields ¶
func (m *CategoriesMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (CategoriesMutation) Client ¶
func (m CategoriesMutation) 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 (*CategoriesMutation) CreatedAt ¶
func (m *CategoriesMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*CategoriesMutation) EdgeCleared ¶
func (m *CategoriesMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*CategoriesMutation) Field ¶
func (m *CategoriesMutation) 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 (*CategoriesMutation) FieldCleared ¶
func (m *CategoriesMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*CategoriesMutation) Fields ¶
func (m *CategoriesMutation) 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 (*CategoriesMutation) ID ¶
func (m *CategoriesMutation) 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 (*CategoriesMutation) IDs ¶
func (m *CategoriesMutation) 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 (*CategoriesMutation) Name ¶
func (m *CategoriesMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*CategoriesMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Categories entity. If the Categories 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 (*CategoriesMutation) 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 (*CategoriesMutation) OldName ¶
func (m *CategoriesMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Categories entity. If the Categories 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 (*CategoriesMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Categories entity. If the Categories 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 (*CategoriesMutation) RemoveSiteIDs ¶
func (m *CategoriesMutation) RemoveSiteIDs(ids ...int)
RemoveSiteIDs removes the "sites" edge to the Sites entity by IDs.
func (*CategoriesMutation) RemoveSitesCategoryIDs ¶
func (m *CategoriesMutation) RemoveSitesCategoryIDs(ids ...int)
RemoveSitesCategoryIDs removes the "sites_categories" edge to the SitesCategories entity by IDs.
func (*CategoriesMutation) RemovedEdges ¶
func (m *CategoriesMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*CategoriesMutation) RemovedIDs ¶
func (m *CategoriesMutation) 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 (*CategoriesMutation) RemovedSitesCategoriesIDs ¶
func (m *CategoriesMutation) RemovedSitesCategoriesIDs() (ids []int)
RemovedSitesCategories returns the removed IDs of the "sites_categories" edge to the SitesCategories entity.
func (*CategoriesMutation) RemovedSitesIDs ¶
func (m *CategoriesMutation) RemovedSitesIDs() (ids []int)
RemovedSites returns the removed IDs of the "sites" edge to the Sites entity.
func (*CategoriesMutation) ResetCreatedAt ¶
func (m *CategoriesMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*CategoriesMutation) ResetEdge ¶
func (m *CategoriesMutation) 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 (*CategoriesMutation) ResetField ¶
func (m *CategoriesMutation) 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 (*CategoriesMutation) ResetName ¶
func (m *CategoriesMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*CategoriesMutation) ResetSites ¶
func (m *CategoriesMutation) ResetSites()
ResetSites resets all changes to the "sites" edge.
func (*CategoriesMutation) ResetSitesCategories ¶
func (m *CategoriesMutation) ResetSitesCategories()
ResetSitesCategories resets all changes to the "sites_categories" edge.
func (*CategoriesMutation) ResetUpdatedAt ¶
func (m *CategoriesMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*CategoriesMutation) SetCreatedAt ¶
func (m *CategoriesMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*CategoriesMutation) SetField ¶
func (m *CategoriesMutation) 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 (*CategoriesMutation) SetName ¶
func (m *CategoriesMutation) SetName(s string)
SetName sets the "name" field.
func (*CategoriesMutation) SetOp ¶
func (m *CategoriesMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*CategoriesMutation) SetUpdatedAt ¶
func (m *CategoriesMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*CategoriesMutation) SitesCategoriesCleared ¶
func (m *CategoriesMutation) SitesCategoriesCleared() bool
SitesCategoriesCleared reports if the "sites_categories" edge to the SitesCategories entity was cleared.
func (*CategoriesMutation) SitesCategoriesIDs ¶
func (m *CategoriesMutation) SitesCategoriesIDs() (ids []int)
SitesCategoriesIDs returns the "sites_categories" edge IDs in the mutation.
func (*CategoriesMutation) SitesCleared ¶
func (m *CategoriesMutation) SitesCleared() bool
SitesCleared reports if the "sites" edge to the Sites entity was cleared.
func (*CategoriesMutation) SitesIDs ¶
func (m *CategoriesMutation) SitesIDs() (ids []int)
SitesIDs returns the "sites" edge IDs in the mutation.
func (CategoriesMutation) Tx ¶
func (m CategoriesMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*CategoriesMutation) Type ¶
func (m *CategoriesMutation) Type() string
Type returns the node type of this mutation (Categories).
func (*CategoriesMutation) UpdatedAt ¶
func (m *CategoriesMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*CategoriesMutation) Where ¶
func (m *CategoriesMutation) Where(ps ...predicate.Categories)
Where appends a list predicates to the CategoriesMutation builder.
func (*CategoriesMutation) WhereP ¶
func (m *CategoriesMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the CategoriesMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type CategoriesQuery ¶
type CategoriesQuery struct {
// contains filtered or unexported fields
}
CategoriesQuery is the builder for querying Categories entities.
func (*CategoriesQuery) Aggregate ¶
func (cq *CategoriesQuery) Aggregate(fns ...AggregateFunc) *CategoriesSelect
Aggregate returns a CategoriesSelect configured with the given aggregations.
func (*CategoriesQuery) All ¶
func (cq *CategoriesQuery) All(ctx context.Context) ([]*Categories, error)
All executes the query and returns a list of CategoriesSlice.
func (*CategoriesQuery) AllX ¶
func (cq *CategoriesQuery) AllX(ctx context.Context) []*Categories
AllX is like All, but panics if an error occurs.
func (*CategoriesQuery) Clone ¶
func (cq *CategoriesQuery) Clone() *CategoriesQuery
Clone returns a duplicate of the CategoriesQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*CategoriesQuery) Count ¶
func (cq *CategoriesQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*CategoriesQuery) CountX ¶
func (cq *CategoriesQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*CategoriesQuery) Exist ¶
func (cq *CategoriesQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*CategoriesQuery) ExistX ¶
func (cq *CategoriesQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*CategoriesQuery) First ¶
func (cq *CategoriesQuery) First(ctx context.Context) (*Categories, error)
First returns the first Categories entity from the query. Returns a *NotFoundError when no Categories was found.
func (*CategoriesQuery) FirstID ¶
func (cq *CategoriesQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Categories ID from the query. Returns a *NotFoundError when no Categories ID was found.
func (*CategoriesQuery) FirstIDX ¶
func (cq *CategoriesQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*CategoriesQuery) FirstX ¶
func (cq *CategoriesQuery) FirstX(ctx context.Context) *Categories
FirstX is like First, but panics if an error occurs.
func (*CategoriesQuery) GroupBy ¶
func (cq *CategoriesQuery) GroupBy(field string, fields ...string) *CategoriesGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { CreatedAt time.Time `json:"created_at,omitempty"` Count int `json:"count,omitempty"` } client.Categories.Query(). GroupBy(categories.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*CategoriesQuery) IDs ¶
func (cq *CategoriesQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Categories IDs.
func (*CategoriesQuery) IDsX ¶
func (cq *CategoriesQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*CategoriesQuery) Limit ¶
func (cq *CategoriesQuery) Limit(limit int) *CategoriesQuery
Limit the number of records to be returned by this query.
func (*CategoriesQuery) Offset ¶
func (cq *CategoriesQuery) Offset(offset int) *CategoriesQuery
Offset to start from.
func (*CategoriesQuery) Only ¶
func (cq *CategoriesQuery) Only(ctx context.Context) (*Categories, error)
Only returns a single Categories entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Categories entity is found. Returns a *NotFoundError when no Categories entities are found.
func (*CategoriesQuery) OnlyID ¶
func (cq *CategoriesQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Categories ID in the query. Returns a *NotSingularError when more than one Categories ID is found. Returns a *NotFoundError when no entities are found.
func (*CategoriesQuery) OnlyIDX ¶
func (cq *CategoriesQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*CategoriesQuery) OnlyX ¶
func (cq *CategoriesQuery) OnlyX(ctx context.Context) *Categories
OnlyX is like Only, but panics if an error occurs.
func (*CategoriesQuery) Order ¶
func (cq *CategoriesQuery) Order(o ...categories.OrderOption) *CategoriesQuery
Order specifies how the records should be ordered.
func (*CategoriesQuery) QuerySites ¶
func (cq *CategoriesQuery) QuerySites() *SitesQuery
QuerySites chains the current query on the "sites" edge.
func (*CategoriesQuery) QuerySitesCategories ¶
func (cq *CategoriesQuery) QuerySitesCategories() *SitesCategoriesQuery
QuerySitesCategories chains the current query on the "sites_categories" edge.
func (*CategoriesQuery) Select ¶
func (cq *CategoriesQuery) Select(fields ...string) *CategoriesSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { CreatedAt time.Time `json:"created_at,omitempty"` } client.Categories.Query(). Select(categories.FieldCreatedAt). Scan(ctx, &v)
func (*CategoriesQuery) Unique ¶
func (cq *CategoriesQuery) Unique(unique bool) *CategoriesQuery
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 (*CategoriesQuery) Where ¶
func (cq *CategoriesQuery) Where(ps ...predicate.Categories) *CategoriesQuery
Where adds a new predicate for the CategoriesQuery builder.
func (*CategoriesQuery) WithSites ¶
func (cq *CategoriesQuery) WithSites(opts ...func(*SitesQuery)) *CategoriesQuery
WithSites tells the query-builder to eager-load the nodes that are connected to the "sites" edge. The optional arguments are used to configure the query builder of the edge.
func (*CategoriesQuery) WithSitesCategories ¶
func (cq *CategoriesQuery) WithSitesCategories(opts ...func(*SitesCategoriesQuery)) *CategoriesQuery
WithSitesCategories tells the query-builder to eager-load the nodes that are connected to the "sites_categories" edge. The optional arguments are used to configure the query builder of the edge.
type CategoriesSelect ¶
type CategoriesSelect struct { *CategoriesQuery // contains filtered or unexported fields }
CategoriesSelect is the builder for selecting fields of Categories entities.
func (*CategoriesSelect) Aggregate ¶
func (cs *CategoriesSelect) Aggregate(fns ...AggregateFunc) *CategoriesSelect
Aggregate adds the given aggregation functions to the selector query.
func (*CategoriesSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CategoriesSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CategoriesSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CategoriesSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CategoriesSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CategoriesSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CategoriesSelect) Scan ¶
func (cs *CategoriesSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*CategoriesSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CategoriesSlice ¶
type CategoriesSlice []*Categories
CategoriesSlice is a parsable slice of Categories.
type CategoriesUpdate ¶
type CategoriesUpdate struct {
// contains filtered or unexported fields
}
CategoriesUpdate is the builder for updating Categories entities.
func (*CategoriesUpdate) AddSiteIDs ¶
func (cu *CategoriesUpdate) AddSiteIDs(ids ...int) *CategoriesUpdate
AddSiteIDs adds the "sites" edge to the Sites entity by IDs.
func (*CategoriesUpdate) AddSites ¶
func (cu *CategoriesUpdate) AddSites(s ...*Sites) *CategoriesUpdate
AddSites adds the "sites" edges to the Sites entity.
func (*CategoriesUpdate) AddSitesCategories ¶
func (cu *CategoriesUpdate) AddSitesCategories(s ...*SitesCategories) *CategoriesUpdate
AddSitesCategories adds the "sites_categories" edges to the SitesCategories entity.
func (*CategoriesUpdate) AddSitesCategoryIDs ¶
func (cu *CategoriesUpdate) AddSitesCategoryIDs(ids ...int) *CategoriesUpdate
AddSitesCategoryIDs adds the "sites_categories" edge to the SitesCategories entity by IDs.
func (*CategoriesUpdate) ClearSites ¶
func (cu *CategoriesUpdate) ClearSites() *CategoriesUpdate
ClearSites clears all "sites" edges to the Sites entity.
func (*CategoriesUpdate) ClearSitesCategories ¶
func (cu *CategoriesUpdate) ClearSitesCategories() *CategoriesUpdate
ClearSitesCategories clears all "sites_categories" edges to the SitesCategories entity.
func (*CategoriesUpdate) Exec ¶
func (cu *CategoriesUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*CategoriesUpdate) ExecX ¶
func (cu *CategoriesUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CategoriesUpdate) Mutation ¶
func (cu *CategoriesUpdate) Mutation() *CategoriesMutation
Mutation returns the CategoriesMutation object of the builder.
func (*CategoriesUpdate) RemoveSiteIDs ¶
func (cu *CategoriesUpdate) RemoveSiteIDs(ids ...int) *CategoriesUpdate
RemoveSiteIDs removes the "sites" edge to Sites entities by IDs.
func (*CategoriesUpdate) RemoveSites ¶
func (cu *CategoriesUpdate) RemoveSites(s ...*Sites) *CategoriesUpdate
RemoveSites removes "sites" edges to Sites entities.
func (*CategoriesUpdate) RemoveSitesCategories ¶
func (cu *CategoriesUpdate) RemoveSitesCategories(s ...*SitesCategories) *CategoriesUpdate
RemoveSitesCategories removes "sites_categories" edges to SitesCategories entities.
func (*CategoriesUpdate) RemoveSitesCategoryIDs ¶
func (cu *CategoriesUpdate) RemoveSitesCategoryIDs(ids ...int) *CategoriesUpdate
RemoveSitesCategoryIDs removes the "sites_categories" edge to SitesCategories entities by IDs.
func (*CategoriesUpdate) Save ¶
func (cu *CategoriesUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*CategoriesUpdate) SaveX ¶
func (cu *CategoriesUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*CategoriesUpdate) SetName ¶
func (cu *CategoriesUpdate) SetName(s string) *CategoriesUpdate
SetName sets the "name" field.
func (*CategoriesUpdate) SetNillableName ¶
func (cu *CategoriesUpdate) SetNillableName(s *string) *CategoriesUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*CategoriesUpdate) SetUpdatedAt ¶
func (cu *CategoriesUpdate) SetUpdatedAt(t time.Time) *CategoriesUpdate
SetUpdatedAt sets the "updated_at" field.
func (*CategoriesUpdate) Where ¶
func (cu *CategoriesUpdate) Where(ps ...predicate.Categories) *CategoriesUpdate
Where appends a list predicates to the CategoriesUpdate builder.
type CategoriesUpdateOne ¶
type CategoriesUpdateOne struct {
// contains filtered or unexported fields
}
CategoriesUpdateOne is the builder for updating a single Categories entity.
func (*CategoriesUpdateOne) AddSiteIDs ¶
func (cuo *CategoriesUpdateOne) AddSiteIDs(ids ...int) *CategoriesUpdateOne
AddSiteIDs adds the "sites" edge to the Sites entity by IDs.
func (*CategoriesUpdateOne) AddSites ¶
func (cuo *CategoriesUpdateOne) AddSites(s ...*Sites) *CategoriesUpdateOne
AddSites adds the "sites" edges to the Sites entity.
func (*CategoriesUpdateOne) AddSitesCategories ¶
func (cuo *CategoriesUpdateOne) AddSitesCategories(s ...*SitesCategories) *CategoriesUpdateOne
AddSitesCategories adds the "sites_categories" edges to the SitesCategories entity.
func (*CategoriesUpdateOne) AddSitesCategoryIDs ¶
func (cuo *CategoriesUpdateOne) AddSitesCategoryIDs(ids ...int) *CategoriesUpdateOne
AddSitesCategoryIDs adds the "sites_categories" edge to the SitesCategories entity by IDs.
func (*CategoriesUpdateOne) ClearSites ¶
func (cuo *CategoriesUpdateOne) ClearSites() *CategoriesUpdateOne
ClearSites clears all "sites" edges to the Sites entity.
func (*CategoriesUpdateOne) ClearSitesCategories ¶
func (cuo *CategoriesUpdateOne) ClearSitesCategories() *CategoriesUpdateOne
ClearSitesCategories clears all "sites_categories" edges to the SitesCategories entity.
func (*CategoriesUpdateOne) Exec ¶
func (cuo *CategoriesUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*CategoriesUpdateOne) ExecX ¶
func (cuo *CategoriesUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CategoriesUpdateOne) Mutation ¶
func (cuo *CategoriesUpdateOne) Mutation() *CategoriesMutation
Mutation returns the CategoriesMutation object of the builder.
func (*CategoriesUpdateOne) RemoveSiteIDs ¶
func (cuo *CategoriesUpdateOne) RemoveSiteIDs(ids ...int) *CategoriesUpdateOne
RemoveSiteIDs removes the "sites" edge to Sites entities by IDs.
func (*CategoriesUpdateOne) RemoveSites ¶
func (cuo *CategoriesUpdateOne) RemoveSites(s ...*Sites) *CategoriesUpdateOne
RemoveSites removes "sites" edges to Sites entities.
func (*CategoriesUpdateOne) RemoveSitesCategories ¶
func (cuo *CategoriesUpdateOne) RemoveSitesCategories(s ...*SitesCategories) *CategoriesUpdateOne
RemoveSitesCategories removes "sites_categories" edges to SitesCategories entities.
func (*CategoriesUpdateOne) RemoveSitesCategoryIDs ¶
func (cuo *CategoriesUpdateOne) RemoveSitesCategoryIDs(ids ...int) *CategoriesUpdateOne
RemoveSitesCategoryIDs removes the "sites_categories" edge to SitesCategories entities by IDs.
func (*CategoriesUpdateOne) Save ¶
func (cuo *CategoriesUpdateOne) Save(ctx context.Context) (*Categories, error)
Save executes the query and returns the updated Categories entity.
func (*CategoriesUpdateOne) SaveX ¶
func (cuo *CategoriesUpdateOne) SaveX(ctx context.Context) *Categories
SaveX is like Save, but panics if an error occurs.
func (*CategoriesUpdateOne) Select ¶
func (cuo *CategoriesUpdateOne) Select(field string, fields ...string) *CategoriesUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*CategoriesUpdateOne) SetName ¶
func (cuo *CategoriesUpdateOne) SetName(s string) *CategoriesUpdateOne
SetName sets the "name" field.
func (*CategoriesUpdateOne) SetNillableName ¶
func (cuo *CategoriesUpdateOne) SetNillableName(s *string) *CategoriesUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*CategoriesUpdateOne) SetUpdatedAt ¶
func (cuo *CategoriesUpdateOne) SetUpdatedAt(t time.Time) *CategoriesUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*CategoriesUpdateOne) Where ¶
func (cuo *CategoriesUpdateOne) Where(ps ...predicate.Categories) *CategoriesUpdateOne
Where appends a list predicates to the CategoriesUpdate builder.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Blocks is the client for interacting with the Blocks builders. Blocks *BlocksClient // Categories is the client for interacting with the Categories builders. Categories *CategoriesClient // Counter is the client for interacting with the Counter builders. Counter *CounterClient // Isps is the client for interacting with the Isps builders. Isps *IspsClient // Sites is the client for interacting with the Sites builders. Sites *SitesClient // SitesCategories is the client for interacting with the SitesCategories builders. SitesCategories *SitesCategoriesClient // 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(). Blocks. 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 Counter ¶
type Counter struct { // ID of the ent. ID int `json:"id,omitempty"` // Count holds the value of the "count" field. Count int `json:"count,omitempty"` // contains filtered or unexported fields }
Counter is the model entity for the Counter schema.
func (*Counter) Unwrap ¶
Unwrap unwraps the Counter 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 (*Counter) Update ¶
func (c *Counter) Update() *CounterUpdateOne
Update returns a builder for updating this Counter. Note that you need to call Counter.Unwrap() before calling this method if this Counter was returned from a transaction, and the transaction was committed or rolled back.
type CounterClient ¶
type CounterClient struct {
// contains filtered or unexported fields
}
CounterClient is a client for the Counter schema.
func NewCounterClient ¶
func NewCounterClient(c config) *CounterClient
NewCounterClient returns a client for the Counter from the given config.
func (*CounterClient) Create ¶
func (c *CounterClient) Create() *CounterCreate
Create returns a builder for creating a Counter entity.
func (*CounterClient) CreateBulk ¶
func (c *CounterClient) CreateBulk(builders ...*CounterCreate) *CounterCreateBulk
CreateBulk returns a builder for creating a bulk of Counter entities.
func (*CounterClient) Delete ¶
func (c *CounterClient) Delete() *CounterDelete
Delete returns a delete builder for Counter.
func (*CounterClient) DeleteOne ¶
func (c *CounterClient) DeleteOne(co *Counter) *CounterDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*CounterClient) DeleteOneID ¶
func (c *CounterClient) DeleteOneID(id int) *CounterDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*CounterClient) GetX ¶
func (c *CounterClient) GetX(ctx context.Context, id int) *Counter
GetX is like Get, but panics if an error occurs.
func (*CounterClient) Hooks ¶
func (c *CounterClient) Hooks() []Hook
Hooks returns the client hooks.
func (*CounterClient) Intercept ¶
func (c *CounterClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `counter.Intercept(f(g(h())))`.
func (*CounterClient) Interceptors ¶
func (c *CounterClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*CounterClient) MapCreateBulk ¶
func (c *CounterClient) MapCreateBulk(slice any, setFunc func(*CounterCreate, int)) *CounterCreateBulk
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 (*CounterClient) Query ¶
func (c *CounterClient) Query() *CounterQuery
Query returns a query builder for Counter.
func (*CounterClient) Update ¶
func (c *CounterClient) Update() *CounterUpdate
Update returns an update builder for Counter.
func (*CounterClient) UpdateOne ¶
func (c *CounterClient) UpdateOne(co *Counter) *CounterUpdateOne
UpdateOne returns an update builder for the given entity.
func (*CounterClient) UpdateOneID ¶
func (c *CounterClient) UpdateOneID(id int) *CounterUpdateOne
UpdateOneID returns an update builder for the given id.
func (*CounterClient) Use ¶
func (c *CounterClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `counter.Hooks(f(g(h())))`.
type CounterCreate ¶
type CounterCreate struct {
// contains filtered or unexported fields
}
CounterCreate is the builder for creating a Counter entity.
func (*CounterCreate) Exec ¶
func (cc *CounterCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*CounterCreate) ExecX ¶
func (cc *CounterCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CounterCreate) Mutation ¶
func (cc *CounterCreate) Mutation() *CounterMutation
Mutation returns the CounterMutation object of the builder.
func (*CounterCreate) Save ¶
func (cc *CounterCreate) Save(ctx context.Context) (*Counter, error)
Save creates the Counter in the database.
func (*CounterCreate) SaveX ¶
func (cc *CounterCreate) SaveX(ctx context.Context) *Counter
SaveX calls Save and panics if Save returns an error.
func (*CounterCreate) SetCount ¶
func (cc *CounterCreate) SetCount(i int) *CounterCreate
SetCount sets the "count" field.
func (*CounterCreate) SetNillableCount ¶
func (cc *CounterCreate) SetNillableCount(i *int) *CounterCreate
SetNillableCount sets the "count" field if the given value is not nil.
type CounterCreateBulk ¶
type CounterCreateBulk struct {
// contains filtered or unexported fields
}
CounterCreateBulk is the builder for creating many Counter entities in bulk.
func (*CounterCreateBulk) Exec ¶
func (ccb *CounterCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*CounterCreateBulk) ExecX ¶
func (ccb *CounterCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type CounterDelete ¶
type CounterDelete struct {
// contains filtered or unexported fields
}
CounterDelete is the builder for deleting a Counter entity.
func (*CounterDelete) Exec ¶
func (cd *CounterDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*CounterDelete) ExecX ¶
func (cd *CounterDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*CounterDelete) Where ¶
func (cd *CounterDelete) Where(ps ...predicate.Counter) *CounterDelete
Where appends a list predicates to the CounterDelete builder.
type CounterDeleteOne ¶
type CounterDeleteOne struct {
// contains filtered or unexported fields
}
CounterDeleteOne is the builder for deleting a single Counter entity.
func (*CounterDeleteOne) Exec ¶
func (cdo *CounterDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*CounterDeleteOne) ExecX ¶
func (cdo *CounterDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CounterDeleteOne) Where ¶
func (cdo *CounterDeleteOne) Where(ps ...predicate.Counter) *CounterDeleteOne
Where appends a list predicates to the CounterDelete builder.
type CounterGroupBy ¶
type CounterGroupBy struct {
// contains filtered or unexported fields
}
CounterGroupBy is the group-by builder for Counter entities.
func (*CounterGroupBy) Aggregate ¶
func (cgb *CounterGroupBy) Aggregate(fns ...AggregateFunc) *CounterGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*CounterGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CounterGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CounterGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CounterGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CounterGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CounterGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CounterGroupBy) Scan ¶
func (cgb *CounterGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*CounterGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CounterMutation ¶
type CounterMutation struct {
// contains filtered or unexported fields
}
CounterMutation represents an operation that mutates the Counter nodes in the graph.
func (*CounterMutation) AddCount ¶
func (m *CounterMutation) AddCount(i int)
AddCount adds i to the "count" field.
func (*CounterMutation) AddField ¶
func (m *CounterMutation) 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 (*CounterMutation) AddedCount ¶
func (m *CounterMutation) AddedCount() (r int, exists bool)
AddedCount returns the value that was added to the "count" field in this mutation.
func (*CounterMutation) AddedEdges ¶
func (m *CounterMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*CounterMutation) AddedField ¶
func (m *CounterMutation) 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 (*CounterMutation) AddedFields ¶
func (m *CounterMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*CounterMutation) AddedIDs ¶
func (m *CounterMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*CounterMutation) ClearEdge ¶
func (m *CounterMutation) 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 (*CounterMutation) ClearField ¶
func (m *CounterMutation) 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 (*CounterMutation) ClearedEdges ¶
func (m *CounterMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*CounterMutation) ClearedFields ¶
func (m *CounterMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (CounterMutation) Client ¶
func (m CounterMutation) 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 (*CounterMutation) Count ¶
func (m *CounterMutation) Count() (r int, exists bool)
Count returns the value of the "count" field in the mutation.
func (*CounterMutation) EdgeCleared ¶
func (m *CounterMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*CounterMutation) Field ¶
func (m *CounterMutation) 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 (*CounterMutation) FieldCleared ¶
func (m *CounterMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*CounterMutation) Fields ¶
func (m *CounterMutation) 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 (*CounterMutation) ID ¶
func (m *CounterMutation) 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 (*CounterMutation) IDs ¶
func (m *CounterMutation) 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 (*CounterMutation) OldCount ¶
func (m *CounterMutation) OldCount(ctx context.Context) (v int, err error)
OldCount returns the old "count" field's value of the Counter entity. If the Counter 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 (*CounterMutation) 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 (*CounterMutation) RemovedEdges ¶
func (m *CounterMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*CounterMutation) RemovedIDs ¶
func (m *CounterMutation) 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 (*CounterMutation) ResetCount ¶
func (m *CounterMutation) ResetCount()
ResetCount resets all changes to the "count" field.
func (*CounterMutation) ResetEdge ¶
func (m *CounterMutation) 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 (*CounterMutation) ResetField ¶
func (m *CounterMutation) 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 (*CounterMutation) SetCount ¶
func (m *CounterMutation) SetCount(i int)
SetCount sets the "count" field.
func (*CounterMutation) SetField ¶
func (m *CounterMutation) 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 (*CounterMutation) SetOp ¶
func (m *CounterMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (CounterMutation) Tx ¶
func (m CounterMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*CounterMutation) Type ¶
func (m *CounterMutation) Type() string
Type returns the node type of this mutation (Counter).
func (*CounterMutation) Where ¶
func (m *CounterMutation) Where(ps ...predicate.Counter)
Where appends a list predicates to the CounterMutation builder.
func (*CounterMutation) WhereP ¶
func (m *CounterMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the CounterMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type CounterQuery ¶
type CounterQuery struct {
// contains filtered or unexported fields
}
CounterQuery is the builder for querying Counter entities.
func (*CounterQuery) Aggregate ¶
func (cq *CounterQuery) Aggregate(fns ...AggregateFunc) *CounterSelect
Aggregate returns a CounterSelect configured with the given aggregations.
func (*CounterQuery) All ¶
func (cq *CounterQuery) All(ctx context.Context) ([]*Counter, error)
All executes the query and returns a list of Counters.
func (*CounterQuery) AllX ¶
func (cq *CounterQuery) AllX(ctx context.Context) []*Counter
AllX is like All, but panics if an error occurs.
func (*CounterQuery) Clone ¶
func (cq *CounterQuery) Clone() *CounterQuery
Clone returns a duplicate of the CounterQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*CounterQuery) Count ¶
func (cq *CounterQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*CounterQuery) CountX ¶
func (cq *CounterQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*CounterQuery) Exist ¶
func (cq *CounterQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*CounterQuery) ExistX ¶
func (cq *CounterQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*CounterQuery) First ¶
func (cq *CounterQuery) First(ctx context.Context) (*Counter, error)
First returns the first Counter entity from the query. Returns a *NotFoundError when no Counter was found.
func (*CounterQuery) FirstID ¶
func (cq *CounterQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Counter ID from the query. Returns a *NotFoundError when no Counter ID was found.
func (*CounterQuery) FirstIDX ¶
func (cq *CounterQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*CounterQuery) FirstX ¶
func (cq *CounterQuery) FirstX(ctx context.Context) *Counter
FirstX is like First, but panics if an error occurs.
func (*CounterQuery) GroupBy ¶
func (cq *CounterQuery) GroupBy(field string, fields ...string) *CounterGroupBy
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 { Count int `json:"count,omitempty"` Count int `json:"count,omitempty"` } client.Counter.Query(). GroupBy(counter.FieldCount). Aggregate(ent.Count()). Scan(ctx, &v)
func (*CounterQuery) IDs ¶
func (cq *CounterQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Counter IDs.
func (*CounterQuery) IDsX ¶
func (cq *CounterQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*CounterQuery) Limit ¶
func (cq *CounterQuery) Limit(limit int) *CounterQuery
Limit the number of records to be returned by this query.
func (*CounterQuery) Offset ¶
func (cq *CounterQuery) Offset(offset int) *CounterQuery
Offset to start from.
func (*CounterQuery) Only ¶
func (cq *CounterQuery) Only(ctx context.Context) (*Counter, error)
Only returns a single Counter entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Counter entity is found. Returns a *NotFoundError when no Counter entities are found.
func (*CounterQuery) OnlyID ¶
func (cq *CounterQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Counter ID in the query. Returns a *NotSingularError when more than one Counter ID is found. Returns a *NotFoundError when no entities are found.
func (*CounterQuery) OnlyIDX ¶
func (cq *CounterQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*CounterQuery) OnlyX ¶
func (cq *CounterQuery) OnlyX(ctx context.Context) *Counter
OnlyX is like Only, but panics if an error occurs.
func (*CounterQuery) Order ¶
func (cq *CounterQuery) Order(o ...counter.OrderOption) *CounterQuery
Order specifies how the records should be ordered.
func (*CounterQuery) Select ¶
func (cq *CounterQuery) Select(fields ...string) *CounterSelect
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 { Count int `json:"count,omitempty"` } client.Counter.Query(). Select(counter.FieldCount). Scan(ctx, &v)
func (*CounterQuery) Unique ¶
func (cq *CounterQuery) Unique(unique bool) *CounterQuery
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 (*CounterQuery) Where ¶
func (cq *CounterQuery) Where(ps ...predicate.Counter) *CounterQuery
Where adds a new predicate for the CounterQuery builder.
type CounterSelect ¶
type CounterSelect struct { *CounterQuery // contains filtered or unexported fields }
CounterSelect is the builder for selecting fields of Counter entities.
func (*CounterSelect) Aggregate ¶
func (cs *CounterSelect) Aggregate(fns ...AggregateFunc) *CounterSelect
Aggregate adds the given aggregation functions to the selector query.
func (*CounterSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*CounterSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*CounterSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*CounterSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*CounterSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*CounterSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*CounterSelect) Scan ¶
func (cs *CounterSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*CounterSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type CounterUpdate ¶
type CounterUpdate struct {
// contains filtered or unexported fields
}
CounterUpdate is the builder for updating Counter entities.
func (*CounterUpdate) AddCount ¶
func (cu *CounterUpdate) AddCount(i int) *CounterUpdate
AddCount adds i to the "count" field.
func (*CounterUpdate) Exec ¶
func (cu *CounterUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*CounterUpdate) ExecX ¶
func (cu *CounterUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CounterUpdate) Mutation ¶
func (cu *CounterUpdate) Mutation() *CounterMutation
Mutation returns the CounterMutation object of the builder.
func (*CounterUpdate) Save ¶
func (cu *CounterUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*CounterUpdate) SaveX ¶
func (cu *CounterUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*CounterUpdate) SetCount ¶
func (cu *CounterUpdate) SetCount(i int) *CounterUpdate
SetCount sets the "count" field.
func (*CounterUpdate) SetNillableCount ¶
func (cu *CounterUpdate) SetNillableCount(i *int) *CounterUpdate
SetNillableCount sets the "count" field if the given value is not nil.
func (*CounterUpdate) Where ¶
func (cu *CounterUpdate) Where(ps ...predicate.Counter) *CounterUpdate
Where appends a list predicates to the CounterUpdate builder.
type CounterUpdateOne ¶
type CounterUpdateOne struct {
// contains filtered or unexported fields
}
CounterUpdateOne is the builder for updating a single Counter entity.
func (*CounterUpdateOne) AddCount ¶
func (cuo *CounterUpdateOne) AddCount(i int) *CounterUpdateOne
AddCount adds i to the "count" field.
func (*CounterUpdateOne) Exec ¶
func (cuo *CounterUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*CounterUpdateOne) ExecX ¶
func (cuo *CounterUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*CounterUpdateOne) Mutation ¶
func (cuo *CounterUpdateOne) Mutation() *CounterMutation
Mutation returns the CounterMutation object of the builder.
func (*CounterUpdateOne) Save ¶
func (cuo *CounterUpdateOne) Save(ctx context.Context) (*Counter, error)
Save executes the query and returns the updated Counter entity.
func (*CounterUpdateOne) SaveX ¶
func (cuo *CounterUpdateOne) SaveX(ctx context.Context) *Counter
SaveX is like Save, but panics if an error occurs.
func (*CounterUpdateOne) Select ¶
func (cuo *CounterUpdateOne) Select(field string, fields ...string) *CounterUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*CounterUpdateOne) SetCount ¶
func (cuo *CounterUpdateOne) SetCount(i int) *CounterUpdateOne
SetCount sets the "count" field.
func (*CounterUpdateOne) SetNillableCount ¶
func (cuo *CounterUpdateOne) SetNillableCount(i *int) *CounterUpdateOne
SetNillableCount sets the "count" field if the given value is not nil.
func (*CounterUpdateOne) Where ¶
func (cuo *CounterUpdateOne) Where(ps ...predicate.Counter) *CounterUpdateOne
Where appends a list predicates to the CounterUpdate builder.
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 Isps ¶
type Isps struct { // ID of the ent. ID int `json:"id,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` // Latitude holds the value of the "latitude" field. Latitude float64 `json:"latitude,omitempty"` // Longitude holds the value of the "longitude" field. Longitude float64 `json:"longitude,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the IspsQuery when eager-loading is set. Edges IspsEdges `json:"edges"` // contains filtered or unexported fields }
Isps is the model entity for the Isps schema.
func (*Isps) QueryIspBlocks ¶
func (i *Isps) QueryIspBlocks() *BlocksQuery
QueryIspBlocks queries the "isp_blocks" edge of the Isps entity.
func (*Isps) Unwrap ¶
Unwrap unwraps the Isps 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 (*Isps) Update ¶
func (i *Isps) Update() *IspsUpdateOne
Update returns a builder for updating this Isps. Note that you need to call Isps.Unwrap() before calling this method if this Isps was returned from a transaction, and the transaction was committed or rolled back.
type IspsClient ¶
type IspsClient struct {
// contains filtered or unexported fields
}
IspsClient is a client for the Isps schema.
func NewIspsClient ¶
func NewIspsClient(c config) *IspsClient
NewIspsClient returns a client for the Isps from the given config.
func (*IspsClient) Create ¶
func (c *IspsClient) Create() *IspsCreate
Create returns a builder for creating a Isps entity.
func (*IspsClient) CreateBulk ¶
func (c *IspsClient) CreateBulk(builders ...*IspsCreate) *IspsCreateBulk
CreateBulk returns a builder for creating a bulk of Isps entities.
func (*IspsClient) Delete ¶
func (c *IspsClient) Delete() *IspsDelete
Delete returns a delete builder for Isps.
func (*IspsClient) DeleteOne ¶
func (c *IspsClient) DeleteOne(i *Isps) *IspsDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*IspsClient) DeleteOneID ¶
func (c *IspsClient) DeleteOneID(id int) *IspsDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*IspsClient) GetX ¶
func (c *IspsClient) GetX(ctx context.Context, id int) *Isps
GetX is like Get, but panics if an error occurs.
func (*IspsClient) Intercept ¶
func (c *IspsClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `isps.Intercept(f(g(h())))`.
func (*IspsClient) Interceptors ¶
func (c *IspsClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*IspsClient) MapCreateBulk ¶
func (c *IspsClient) MapCreateBulk(slice any, setFunc func(*IspsCreate, int)) *IspsCreateBulk
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 (*IspsClient) Query ¶
func (c *IspsClient) Query() *IspsQuery
Query returns a query builder for Isps.
func (*IspsClient) QueryIspBlocks ¶
func (c *IspsClient) QueryIspBlocks(i *Isps) *BlocksQuery
QueryIspBlocks queries the isp_blocks edge of a Isps.
func (*IspsClient) Update ¶
func (c *IspsClient) Update() *IspsUpdate
Update returns an update builder for Isps.
func (*IspsClient) UpdateOne ¶
func (c *IspsClient) UpdateOne(i *Isps) *IspsUpdateOne
UpdateOne returns an update builder for the given entity.
func (*IspsClient) UpdateOneID ¶
func (c *IspsClient) UpdateOneID(id int) *IspsUpdateOne
UpdateOneID returns an update builder for the given id.
func (*IspsClient) Use ¶
func (c *IspsClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `isps.Hooks(f(g(h())))`.
type IspsCreate ¶
type IspsCreate struct {
// contains filtered or unexported fields
}
IspsCreate is the builder for creating a Isps entity.
func (*IspsCreate) AddIspBlockIDs ¶
func (ic *IspsCreate) AddIspBlockIDs(ids ...int) *IspsCreate
AddIspBlockIDs adds the "isp_blocks" edge to the Blocks entity by IDs.
func (*IspsCreate) AddIspBlocks ¶
func (ic *IspsCreate) AddIspBlocks(b ...*Blocks) *IspsCreate
AddIspBlocks adds the "isp_blocks" edges to the Blocks entity.
func (*IspsCreate) Exec ¶
func (ic *IspsCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*IspsCreate) ExecX ¶
func (ic *IspsCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*IspsCreate) Mutation ¶
func (ic *IspsCreate) Mutation() *IspsMutation
Mutation returns the IspsMutation object of the builder.
func (*IspsCreate) Save ¶
func (ic *IspsCreate) Save(ctx context.Context) (*Isps, error)
Save creates the Isps in the database.
func (*IspsCreate) SaveX ¶
func (ic *IspsCreate) SaveX(ctx context.Context) *Isps
SaveX calls Save and panics if Save returns an error.
func (*IspsCreate) SetCreatedAt ¶
func (ic *IspsCreate) SetCreatedAt(t time.Time) *IspsCreate
SetCreatedAt sets the "created_at" field.
func (*IspsCreate) SetLatitude ¶
func (ic *IspsCreate) SetLatitude(f float64) *IspsCreate
SetLatitude sets the "latitude" field.
func (*IspsCreate) SetLongitude ¶
func (ic *IspsCreate) SetLongitude(f float64) *IspsCreate
SetLongitude sets the "longitude" field.
func (*IspsCreate) SetName ¶
func (ic *IspsCreate) SetName(s string) *IspsCreate
SetName sets the "name" field.
func (*IspsCreate) SetNillableCreatedAt ¶
func (ic *IspsCreate) SetNillableCreatedAt(t *time.Time) *IspsCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*IspsCreate) SetNillableUpdatedAt ¶
func (ic *IspsCreate) SetNillableUpdatedAt(t *time.Time) *IspsCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*IspsCreate) SetUpdatedAt ¶
func (ic *IspsCreate) SetUpdatedAt(t time.Time) *IspsCreate
SetUpdatedAt sets the "updated_at" field.
type IspsCreateBulk ¶
type IspsCreateBulk struct {
// contains filtered or unexported fields
}
IspsCreateBulk is the builder for creating many Isps entities in bulk.
func (*IspsCreateBulk) Exec ¶
func (icb *IspsCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*IspsCreateBulk) ExecX ¶
func (icb *IspsCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type IspsDelete ¶
type IspsDelete struct {
// contains filtered or unexported fields
}
IspsDelete is the builder for deleting a Isps entity.
func (*IspsDelete) Exec ¶
func (id *IspsDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*IspsDelete) ExecX ¶
func (id *IspsDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*IspsDelete) Where ¶
func (id *IspsDelete) Where(ps ...predicate.Isps) *IspsDelete
Where appends a list predicates to the IspsDelete builder.
type IspsDeleteOne ¶
type IspsDeleteOne struct {
// contains filtered or unexported fields
}
IspsDeleteOne is the builder for deleting a single Isps entity.
func (*IspsDeleteOne) Exec ¶
func (ido *IspsDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*IspsDeleteOne) ExecX ¶
func (ido *IspsDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*IspsDeleteOne) Where ¶
func (ido *IspsDeleteOne) Where(ps ...predicate.Isps) *IspsDeleteOne
Where appends a list predicates to the IspsDelete builder.
type IspsEdges ¶
type IspsEdges struct { // IspBlocks holds the value of the isp_blocks edge. IspBlocks []*Blocks `json:"isp_blocks,omitempty"` // contains filtered or unexported fields }
IspsEdges holds the relations/edges for other nodes in the graph.
func (IspsEdges) IspBlocksOrErr ¶
IspBlocksOrErr returns the IspBlocks value or an error if the edge was not loaded in eager-loading.
type IspsGroupBy ¶
type IspsGroupBy struct {
// contains filtered or unexported fields
}
IspsGroupBy is the group-by builder for Isps entities.
func (*IspsGroupBy) Aggregate ¶
func (igb *IspsGroupBy) Aggregate(fns ...AggregateFunc) *IspsGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*IspsGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*IspsGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*IspsGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*IspsGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*IspsGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*IspsGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*IspsGroupBy) Scan ¶
func (igb *IspsGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*IspsGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type IspsMutation ¶
type IspsMutation struct {
// contains filtered or unexported fields
}
IspsMutation represents an operation that mutates the Isps nodes in the graph.
func (*IspsMutation) AddField ¶
func (m *IspsMutation) 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 (*IspsMutation) AddIspBlockIDs ¶
func (m *IspsMutation) AddIspBlockIDs(ids ...int)
AddIspBlockIDs adds the "isp_blocks" edge to the Blocks entity by ids.
func (*IspsMutation) AddLatitude ¶
func (m *IspsMutation) AddLatitude(f float64)
AddLatitude adds f to the "latitude" field.
func (*IspsMutation) AddLongitude ¶
func (m *IspsMutation) AddLongitude(f float64)
AddLongitude adds f to the "longitude" field.
func (*IspsMutation) AddedEdges ¶
func (m *IspsMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*IspsMutation) AddedField ¶
func (m *IspsMutation) 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 (*IspsMutation) AddedFields ¶
func (m *IspsMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*IspsMutation) AddedIDs ¶
func (m *IspsMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*IspsMutation) AddedLatitude ¶
func (m *IspsMutation) AddedLatitude() (r float64, exists bool)
AddedLatitude returns the value that was added to the "latitude" field in this mutation.
func (*IspsMutation) AddedLongitude ¶
func (m *IspsMutation) AddedLongitude() (r float64, exists bool)
AddedLongitude returns the value that was added to the "longitude" field in this mutation.
func (*IspsMutation) ClearEdge ¶
func (m *IspsMutation) 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 (*IspsMutation) ClearField ¶
func (m *IspsMutation) 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 (*IspsMutation) ClearIspBlocks ¶
func (m *IspsMutation) ClearIspBlocks()
ClearIspBlocks clears the "isp_blocks" edge to the Blocks entity.
func (*IspsMutation) ClearedEdges ¶
func (m *IspsMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*IspsMutation) ClearedFields ¶
func (m *IspsMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (IspsMutation) Client ¶
func (m IspsMutation) 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 (*IspsMutation) CreatedAt ¶
func (m *IspsMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*IspsMutation) EdgeCleared ¶
func (m *IspsMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*IspsMutation) Field ¶
func (m *IspsMutation) 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 (*IspsMutation) FieldCleared ¶
func (m *IspsMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*IspsMutation) Fields ¶
func (m *IspsMutation) 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 (*IspsMutation) ID ¶
func (m *IspsMutation) 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 (*IspsMutation) IDs ¶
func (m *IspsMutation) 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 (*IspsMutation) IspBlocksCleared ¶
func (m *IspsMutation) IspBlocksCleared() bool
IspBlocksCleared reports if the "isp_blocks" edge to the Blocks entity was cleared.
func (*IspsMutation) IspBlocksIDs ¶
func (m *IspsMutation) IspBlocksIDs() (ids []int)
IspBlocksIDs returns the "isp_blocks" edge IDs in the mutation.
func (*IspsMutation) Latitude ¶
func (m *IspsMutation) Latitude() (r float64, exists bool)
Latitude returns the value of the "latitude" field in the mutation.
func (*IspsMutation) Longitude ¶
func (m *IspsMutation) Longitude() (r float64, exists bool)
Longitude returns the value of the "longitude" field in the mutation.
func (*IspsMutation) Name ¶
func (m *IspsMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*IspsMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Isps entity. If the Isps 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 (*IspsMutation) 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 (*IspsMutation) OldLatitude ¶
func (m *IspsMutation) OldLatitude(ctx context.Context) (v float64, err error)
OldLatitude returns the old "latitude" field's value of the Isps entity. If the Isps 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 (*IspsMutation) OldLongitude ¶
func (m *IspsMutation) OldLongitude(ctx context.Context) (v float64, err error)
OldLongitude returns the old "longitude" field's value of the Isps entity. If the Isps 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 (*IspsMutation) OldName ¶
func (m *IspsMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Isps entity. If the Isps 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 (*IspsMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Isps entity. If the Isps 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 (*IspsMutation) RemoveIspBlockIDs ¶
func (m *IspsMutation) RemoveIspBlockIDs(ids ...int)
RemoveIspBlockIDs removes the "isp_blocks" edge to the Blocks entity by IDs.
func (*IspsMutation) RemovedEdges ¶
func (m *IspsMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*IspsMutation) RemovedIDs ¶
func (m *IspsMutation) 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 (*IspsMutation) RemovedIspBlocksIDs ¶
func (m *IspsMutation) RemovedIspBlocksIDs() (ids []int)
RemovedIspBlocks returns the removed IDs of the "isp_blocks" edge to the Blocks entity.
func (*IspsMutation) ResetCreatedAt ¶
func (m *IspsMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*IspsMutation) ResetEdge ¶
func (m *IspsMutation) 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 (*IspsMutation) ResetField ¶
func (m *IspsMutation) 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 (*IspsMutation) ResetIspBlocks ¶
func (m *IspsMutation) ResetIspBlocks()
ResetIspBlocks resets all changes to the "isp_blocks" edge.
func (*IspsMutation) ResetLatitude ¶
func (m *IspsMutation) ResetLatitude()
ResetLatitude resets all changes to the "latitude" field.
func (*IspsMutation) ResetLongitude ¶
func (m *IspsMutation) ResetLongitude()
ResetLongitude resets all changes to the "longitude" field.
func (*IspsMutation) ResetName ¶
func (m *IspsMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*IspsMutation) ResetUpdatedAt ¶
func (m *IspsMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*IspsMutation) SetCreatedAt ¶
func (m *IspsMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*IspsMutation) SetField ¶
func (m *IspsMutation) 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 (*IspsMutation) SetLatitude ¶
func (m *IspsMutation) SetLatitude(f float64)
SetLatitude sets the "latitude" field.
func (*IspsMutation) SetLongitude ¶
func (m *IspsMutation) SetLongitude(f float64)
SetLongitude sets the "longitude" field.
func (*IspsMutation) SetName ¶
func (m *IspsMutation) SetName(s string)
SetName sets the "name" field.
func (*IspsMutation) SetOp ¶
func (m *IspsMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*IspsMutation) SetUpdatedAt ¶
func (m *IspsMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (IspsMutation) Tx ¶
func (m IspsMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*IspsMutation) Type ¶
func (m *IspsMutation) Type() string
Type returns the node type of this mutation (Isps).
func (*IspsMutation) UpdatedAt ¶
func (m *IspsMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*IspsMutation) Where ¶
func (m *IspsMutation) Where(ps ...predicate.Isps)
Where appends a list predicates to the IspsMutation builder.
func (*IspsMutation) WhereP ¶
func (m *IspsMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the IspsMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type IspsQuery ¶
type IspsQuery struct {
// contains filtered or unexported fields
}
IspsQuery is the builder for querying Isps entities.
func (*IspsQuery) Aggregate ¶
func (iq *IspsQuery) Aggregate(fns ...AggregateFunc) *IspsSelect
Aggregate returns a IspsSelect configured with the given aggregations.
func (*IspsQuery) Clone ¶
Clone returns a duplicate of the IspsQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*IspsQuery) First ¶
First returns the first Isps entity from the query. Returns a *NotFoundError when no Isps was found.
func (*IspsQuery) FirstID ¶
FirstID returns the first Isps ID from the query. Returns a *NotFoundError when no Isps ID was found.
func (*IspsQuery) GroupBy ¶
func (iq *IspsQuery) GroupBy(field string, fields ...string) *IspsGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { CreatedAt time.Time `json:"created_at,omitempty"` Count int `json:"count,omitempty"` } client.Isps.Query(). GroupBy(isps.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*IspsQuery) Only ¶
Only returns a single Isps entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Isps entity is found. Returns a *NotFoundError when no Isps entities are found.
func (*IspsQuery) OnlyID ¶
OnlyID is like Only, but returns the only Isps ID in the query. Returns a *NotSingularError when more than one Isps ID is found. Returns a *NotFoundError when no entities are found.
func (*IspsQuery) Order ¶
func (iq *IspsQuery) Order(o ...isps.OrderOption) *IspsQuery
Order specifies how the records should be ordered.
func (*IspsQuery) QueryIspBlocks ¶
func (iq *IspsQuery) QueryIspBlocks() *BlocksQuery
QueryIspBlocks chains the current query on the "isp_blocks" edge.
func (*IspsQuery) Select ¶
func (iq *IspsQuery) Select(fields ...string) *IspsSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { CreatedAt time.Time `json:"created_at,omitempty"` } client.Isps.Query(). Select(isps.FieldCreatedAt). Scan(ctx, &v)
func (*IspsQuery) Unique ¶
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*IspsQuery) WithIspBlocks ¶
func (iq *IspsQuery) WithIspBlocks(opts ...func(*BlocksQuery)) *IspsQuery
WithIspBlocks tells the query-builder to eager-load the nodes that are connected to the "isp_blocks" edge. The optional arguments are used to configure the query builder of the edge.
type IspsSelect ¶
type IspsSelect struct { *IspsQuery // contains filtered or unexported fields }
IspsSelect is the builder for selecting fields of Isps entities.
func (*IspsSelect) Aggregate ¶
func (is *IspsSelect) Aggregate(fns ...AggregateFunc) *IspsSelect
Aggregate adds the given aggregation functions to the selector query.
func (*IspsSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*IspsSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*IspsSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*IspsSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*IspsSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*IspsSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*IspsSelect) Scan ¶
func (is *IspsSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*IspsSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type IspsUpdate ¶
type IspsUpdate struct {
// contains filtered or unexported fields
}
IspsUpdate is the builder for updating Isps entities.
func (*IspsUpdate) AddIspBlockIDs ¶
func (iu *IspsUpdate) AddIspBlockIDs(ids ...int) *IspsUpdate
AddIspBlockIDs adds the "isp_blocks" edge to the Blocks entity by IDs.
func (*IspsUpdate) AddIspBlocks ¶
func (iu *IspsUpdate) AddIspBlocks(b ...*Blocks) *IspsUpdate
AddIspBlocks adds the "isp_blocks" edges to the Blocks entity.
func (*IspsUpdate) AddLatitude ¶
func (iu *IspsUpdate) AddLatitude(f float64) *IspsUpdate
AddLatitude adds f to the "latitude" field.
func (*IspsUpdate) AddLongitude ¶
func (iu *IspsUpdate) AddLongitude(f float64) *IspsUpdate
AddLongitude adds f to the "longitude" field.
func (*IspsUpdate) ClearIspBlocks ¶
func (iu *IspsUpdate) ClearIspBlocks() *IspsUpdate
ClearIspBlocks clears all "isp_blocks" edges to the Blocks entity.
func (*IspsUpdate) Exec ¶
func (iu *IspsUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*IspsUpdate) ExecX ¶
func (iu *IspsUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*IspsUpdate) Mutation ¶
func (iu *IspsUpdate) Mutation() *IspsMutation
Mutation returns the IspsMutation object of the builder.
func (*IspsUpdate) RemoveIspBlockIDs ¶
func (iu *IspsUpdate) RemoveIspBlockIDs(ids ...int) *IspsUpdate
RemoveIspBlockIDs removes the "isp_blocks" edge to Blocks entities by IDs.
func (*IspsUpdate) RemoveIspBlocks ¶
func (iu *IspsUpdate) RemoveIspBlocks(b ...*Blocks) *IspsUpdate
RemoveIspBlocks removes "isp_blocks" edges to Blocks entities.
func (*IspsUpdate) Save ¶
func (iu *IspsUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*IspsUpdate) SaveX ¶
func (iu *IspsUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*IspsUpdate) SetLatitude ¶
func (iu *IspsUpdate) SetLatitude(f float64) *IspsUpdate
SetLatitude sets the "latitude" field.
func (*IspsUpdate) SetLongitude ¶
func (iu *IspsUpdate) SetLongitude(f float64) *IspsUpdate
SetLongitude sets the "longitude" field.
func (*IspsUpdate) SetName ¶
func (iu *IspsUpdate) SetName(s string) *IspsUpdate
SetName sets the "name" field.
func (*IspsUpdate) SetNillableLatitude ¶
func (iu *IspsUpdate) SetNillableLatitude(f *float64) *IspsUpdate
SetNillableLatitude sets the "latitude" field if the given value is not nil.
func (*IspsUpdate) SetNillableLongitude ¶
func (iu *IspsUpdate) SetNillableLongitude(f *float64) *IspsUpdate
SetNillableLongitude sets the "longitude" field if the given value is not nil.
func (*IspsUpdate) SetNillableName ¶
func (iu *IspsUpdate) SetNillableName(s *string) *IspsUpdate
SetNillableName sets the "name" field if the given value is not nil.
func (*IspsUpdate) SetUpdatedAt ¶
func (iu *IspsUpdate) SetUpdatedAt(t time.Time) *IspsUpdate
SetUpdatedAt sets the "updated_at" field.
func (*IspsUpdate) Where ¶
func (iu *IspsUpdate) Where(ps ...predicate.Isps) *IspsUpdate
Where appends a list predicates to the IspsUpdate builder.
type IspsUpdateOne ¶
type IspsUpdateOne struct {
// contains filtered or unexported fields
}
IspsUpdateOne is the builder for updating a single Isps entity.
func (*IspsUpdateOne) AddIspBlockIDs ¶
func (iuo *IspsUpdateOne) AddIspBlockIDs(ids ...int) *IspsUpdateOne
AddIspBlockIDs adds the "isp_blocks" edge to the Blocks entity by IDs.
func (*IspsUpdateOne) AddIspBlocks ¶
func (iuo *IspsUpdateOne) AddIspBlocks(b ...*Blocks) *IspsUpdateOne
AddIspBlocks adds the "isp_blocks" edges to the Blocks entity.
func (*IspsUpdateOne) AddLatitude ¶
func (iuo *IspsUpdateOne) AddLatitude(f float64) *IspsUpdateOne
AddLatitude adds f to the "latitude" field.
func (*IspsUpdateOne) AddLongitude ¶
func (iuo *IspsUpdateOne) AddLongitude(f float64) *IspsUpdateOne
AddLongitude adds f to the "longitude" field.
func (*IspsUpdateOne) ClearIspBlocks ¶
func (iuo *IspsUpdateOne) ClearIspBlocks() *IspsUpdateOne
ClearIspBlocks clears all "isp_blocks" edges to the Blocks entity.
func (*IspsUpdateOne) Exec ¶
func (iuo *IspsUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*IspsUpdateOne) ExecX ¶
func (iuo *IspsUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*IspsUpdateOne) Mutation ¶
func (iuo *IspsUpdateOne) Mutation() *IspsMutation
Mutation returns the IspsMutation object of the builder.
func (*IspsUpdateOne) RemoveIspBlockIDs ¶
func (iuo *IspsUpdateOne) RemoveIspBlockIDs(ids ...int) *IspsUpdateOne
RemoveIspBlockIDs removes the "isp_blocks" edge to Blocks entities by IDs.
func (*IspsUpdateOne) RemoveIspBlocks ¶
func (iuo *IspsUpdateOne) RemoveIspBlocks(b ...*Blocks) *IspsUpdateOne
RemoveIspBlocks removes "isp_blocks" edges to Blocks entities.
func (*IspsUpdateOne) Save ¶
func (iuo *IspsUpdateOne) Save(ctx context.Context) (*Isps, error)
Save executes the query and returns the updated Isps entity.
func (*IspsUpdateOne) SaveX ¶
func (iuo *IspsUpdateOne) SaveX(ctx context.Context) *Isps
SaveX is like Save, but panics if an error occurs.
func (*IspsUpdateOne) Select ¶
func (iuo *IspsUpdateOne) Select(field string, fields ...string) *IspsUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*IspsUpdateOne) SetLatitude ¶
func (iuo *IspsUpdateOne) SetLatitude(f float64) *IspsUpdateOne
SetLatitude sets the "latitude" field.
func (*IspsUpdateOne) SetLongitude ¶
func (iuo *IspsUpdateOne) SetLongitude(f float64) *IspsUpdateOne
SetLongitude sets the "longitude" field.
func (*IspsUpdateOne) SetName ¶
func (iuo *IspsUpdateOne) SetName(s string) *IspsUpdateOne
SetName sets the "name" field.
func (*IspsUpdateOne) SetNillableLatitude ¶
func (iuo *IspsUpdateOne) SetNillableLatitude(f *float64) *IspsUpdateOne
SetNillableLatitude sets the "latitude" field if the given value is not nil.
func (*IspsUpdateOne) SetNillableLongitude ¶
func (iuo *IspsUpdateOne) SetNillableLongitude(f *float64) *IspsUpdateOne
SetNillableLongitude sets the "longitude" field if the given value is not nil.
func (*IspsUpdateOne) SetNillableName ¶
func (iuo *IspsUpdateOne) SetNillableName(s *string) *IspsUpdateOne
SetNillableName sets the "name" field if the given value is not nil.
func (*IspsUpdateOne) SetUpdatedAt ¶
func (iuo *IspsUpdateOne) SetUpdatedAt(t time.Time) *IspsUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*IspsUpdateOne) Where ¶
func (iuo *IspsUpdateOne) Where(ps ...predicate.Isps) *IspsUpdateOne
Where appends a list predicates to the IspsUpdate 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 Sites ¶
type Sites struct { // ID of the ent. ID int `json:"id,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` // Domain holds the value of the "domain" field. Domain string `json:"domain,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the SitesQuery when eager-loading is set. Edges SitesEdges `json:"edges"` // contains filtered or unexported fields }
Sites is the model entity for the Sites schema.
func (*Sites) QueryBlocks ¶
func (s *Sites) QueryBlocks() *BlocksQuery
QueryBlocks queries the "blocks" edge of the Sites entity.
func (*Sites) QueryCategories ¶
func (s *Sites) QueryCategories() *CategoriesQuery
QueryCategories queries the "categories" edge of the Sites entity.
func (*Sites) QuerySitesCategories ¶
func (s *Sites) QuerySitesCategories() *SitesCategoriesQuery
QuerySitesCategories queries the "sites_categories" edge of the Sites entity.
func (*Sites) Unwrap ¶
Unwrap unwraps the Sites 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 (*Sites) Update ¶
func (s *Sites) Update() *SitesUpdateOne
Update returns a builder for updating this Sites. Note that you need to call Sites.Unwrap() before calling this method if this Sites was returned from a transaction, and the transaction was committed or rolled back.
type SitesCategories ¶
type SitesCategories struct { // ID of the ent. ID int `json:"id,omitempty"` // SitesID holds the value of the "sites_id" field. SitesID int `json:"sites_id,omitempty"` // CategoriesID holds the value of the "categories_id" field. CategoriesID int `json:"categories_id,omitempty"` // Edges holds the relations/edges for other nodes in the graph. // The values are being populated by the SitesCategoriesQuery when eager-loading is set. Edges SitesCategoriesEdges `json:"edges"` // contains filtered or unexported fields }
SitesCategories is the model entity for the SitesCategories schema.
func (*SitesCategories) QueryCategories ¶
func (sc *SitesCategories) QueryCategories() *CategoriesQuery
QueryCategories queries the "categories" edge of the SitesCategories entity.
func (*SitesCategories) QuerySites ¶
func (sc *SitesCategories) QuerySites() *SitesQuery
QuerySites queries the "sites" edge of the SitesCategories entity.
func (*SitesCategories) String ¶
func (sc *SitesCategories) String() string
String implements the fmt.Stringer.
func (*SitesCategories) Unwrap ¶
func (sc *SitesCategories) Unwrap() *SitesCategories
Unwrap unwraps the SitesCategories 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 (*SitesCategories) Update ¶
func (sc *SitesCategories) Update() *SitesCategoriesUpdateOne
Update returns a builder for updating this SitesCategories. Note that you need to call SitesCategories.Unwrap() before calling this method if this SitesCategories was returned from a transaction, and the transaction was committed or rolled back.
type SitesCategoriesClient ¶
type SitesCategoriesClient struct {
// contains filtered or unexported fields
}
SitesCategoriesClient is a client for the SitesCategories schema.
func NewSitesCategoriesClient ¶
func NewSitesCategoriesClient(c config) *SitesCategoriesClient
NewSitesCategoriesClient returns a client for the SitesCategories from the given config.
func (*SitesCategoriesClient) Create ¶
func (c *SitesCategoriesClient) Create() *SitesCategoriesCreate
Create returns a builder for creating a SitesCategories entity.
func (*SitesCategoriesClient) CreateBulk ¶
func (c *SitesCategoriesClient) CreateBulk(builders ...*SitesCategoriesCreate) *SitesCategoriesCreateBulk
CreateBulk returns a builder for creating a bulk of SitesCategories entities.
func (*SitesCategoriesClient) Delete ¶
func (c *SitesCategoriesClient) Delete() *SitesCategoriesDelete
Delete returns a delete builder for SitesCategories.
func (*SitesCategoriesClient) DeleteOne ¶
func (c *SitesCategoriesClient) DeleteOne(sc *SitesCategories) *SitesCategoriesDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*SitesCategoriesClient) DeleteOneID ¶
func (c *SitesCategoriesClient) DeleteOneID(id int) *SitesCategoriesDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*SitesCategoriesClient) Get ¶
func (c *SitesCategoriesClient) Get(ctx context.Context, id int) (*SitesCategories, error)
Get returns a SitesCategories entity by its id.
func (*SitesCategoriesClient) GetX ¶
func (c *SitesCategoriesClient) GetX(ctx context.Context, id int) *SitesCategories
GetX is like Get, but panics if an error occurs.
func (*SitesCategoriesClient) Hooks ¶
func (c *SitesCategoriesClient) Hooks() []Hook
Hooks returns the client hooks.
func (*SitesCategoriesClient) Intercept ¶
func (c *SitesCategoriesClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `sitescategories.Intercept(f(g(h())))`.
func (*SitesCategoriesClient) Interceptors ¶
func (c *SitesCategoriesClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*SitesCategoriesClient) MapCreateBulk ¶
func (c *SitesCategoriesClient) MapCreateBulk(slice any, setFunc func(*SitesCategoriesCreate, int)) *SitesCategoriesCreateBulk
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 (*SitesCategoriesClient) Query ¶
func (c *SitesCategoriesClient) Query() *SitesCategoriesQuery
Query returns a query builder for SitesCategories.
func (*SitesCategoriesClient) QueryCategories ¶
func (c *SitesCategoriesClient) QueryCategories(sc *SitesCategories) *CategoriesQuery
QueryCategories queries the categories edge of a SitesCategories.
func (*SitesCategoriesClient) QuerySites ¶
func (c *SitesCategoriesClient) QuerySites(sc *SitesCategories) *SitesQuery
QuerySites queries the sites edge of a SitesCategories.
func (*SitesCategoriesClient) Update ¶
func (c *SitesCategoriesClient) Update() *SitesCategoriesUpdate
Update returns an update builder for SitesCategories.
func (*SitesCategoriesClient) UpdateOne ¶
func (c *SitesCategoriesClient) UpdateOne(sc *SitesCategories) *SitesCategoriesUpdateOne
UpdateOne returns an update builder for the given entity.
func (*SitesCategoriesClient) UpdateOneID ¶
func (c *SitesCategoriesClient) UpdateOneID(id int) *SitesCategoriesUpdateOne
UpdateOneID returns an update builder for the given id.
func (*SitesCategoriesClient) Use ¶
func (c *SitesCategoriesClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `sitescategories.Hooks(f(g(h())))`.
type SitesCategoriesCreate ¶
type SitesCategoriesCreate struct {
// contains filtered or unexported fields
}
SitesCategoriesCreate is the builder for creating a SitesCategories entity.
func (*SitesCategoriesCreate) Exec ¶
func (scc *SitesCategoriesCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*SitesCategoriesCreate) ExecX ¶
func (scc *SitesCategoriesCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SitesCategoriesCreate) Mutation ¶
func (scc *SitesCategoriesCreate) Mutation() *SitesCategoriesMutation
Mutation returns the SitesCategoriesMutation object of the builder.
func (*SitesCategoriesCreate) Save ¶
func (scc *SitesCategoriesCreate) Save(ctx context.Context) (*SitesCategories, error)
Save creates the SitesCategories in the database.
func (*SitesCategoriesCreate) SaveX ¶
func (scc *SitesCategoriesCreate) SaveX(ctx context.Context) *SitesCategories
SaveX calls Save and panics if Save returns an error.
func (*SitesCategoriesCreate) SetCategories ¶
func (scc *SitesCategoriesCreate) SetCategories(c *Categories) *SitesCategoriesCreate
SetCategories sets the "categories" edge to the Categories entity.
func (*SitesCategoriesCreate) SetCategoriesID ¶
func (scc *SitesCategoriesCreate) SetCategoriesID(i int) *SitesCategoriesCreate
SetCategoriesID sets the "categories_id" field.
func (*SitesCategoriesCreate) SetSites ¶
func (scc *SitesCategoriesCreate) SetSites(s *Sites) *SitesCategoriesCreate
SetSites sets the "sites" edge to the Sites entity.
func (*SitesCategoriesCreate) SetSitesID ¶
func (scc *SitesCategoriesCreate) SetSitesID(i int) *SitesCategoriesCreate
SetSitesID sets the "sites_id" field.
type SitesCategoriesCreateBulk ¶
type SitesCategoriesCreateBulk struct {
// contains filtered or unexported fields
}
SitesCategoriesCreateBulk is the builder for creating many SitesCategories entities in bulk.
func (*SitesCategoriesCreateBulk) Exec ¶
func (sccb *SitesCategoriesCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*SitesCategoriesCreateBulk) ExecX ¶
func (sccb *SitesCategoriesCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SitesCategoriesCreateBulk) Save ¶
func (sccb *SitesCategoriesCreateBulk) Save(ctx context.Context) ([]*SitesCategories, error)
Save creates the SitesCategories entities in the database.
func (*SitesCategoriesCreateBulk) SaveX ¶
func (sccb *SitesCategoriesCreateBulk) SaveX(ctx context.Context) []*SitesCategories
SaveX is like Save, but panics if an error occurs.
type SitesCategoriesDelete ¶
type SitesCategoriesDelete struct {
// contains filtered or unexported fields
}
SitesCategoriesDelete is the builder for deleting a SitesCategories entity.
func (*SitesCategoriesDelete) Exec ¶
func (scd *SitesCategoriesDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*SitesCategoriesDelete) ExecX ¶
func (scd *SitesCategoriesDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*SitesCategoriesDelete) Where ¶
func (scd *SitesCategoriesDelete) Where(ps ...predicate.SitesCategories) *SitesCategoriesDelete
Where appends a list predicates to the SitesCategoriesDelete builder.
type SitesCategoriesDeleteOne ¶
type SitesCategoriesDeleteOne struct {
// contains filtered or unexported fields
}
SitesCategoriesDeleteOne is the builder for deleting a single SitesCategories entity.
func (*SitesCategoriesDeleteOne) Exec ¶
func (scdo *SitesCategoriesDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*SitesCategoriesDeleteOne) ExecX ¶
func (scdo *SitesCategoriesDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SitesCategoriesDeleteOne) Where ¶
func (scdo *SitesCategoriesDeleteOne) Where(ps ...predicate.SitesCategories) *SitesCategoriesDeleteOne
Where appends a list predicates to the SitesCategoriesDelete builder.
type SitesCategoriesEdges ¶
type SitesCategoriesEdges struct { // Sites holds the value of the sites edge. Sites *Sites `json:"sites,omitempty"` // Categories holds the value of the categories edge. Categories *Categories `json:"categories,omitempty"` // contains filtered or unexported fields }
SitesCategoriesEdges holds the relations/edges for other nodes in the graph.
func (SitesCategoriesEdges) CategoriesOrErr ¶
func (e SitesCategoriesEdges) CategoriesOrErr() (*Categories, error)
CategoriesOrErr returns the Categories value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
func (SitesCategoriesEdges) SitesOrErr ¶
func (e SitesCategoriesEdges) SitesOrErr() (*Sites, error)
SitesOrErr returns the Sites value or an error if the edge was not loaded in eager-loading, or loaded but was not found.
type SitesCategoriesGroupBy ¶
type SitesCategoriesGroupBy struct {
// contains filtered or unexported fields
}
SitesCategoriesGroupBy is the group-by builder for SitesCategories entities.
func (*SitesCategoriesGroupBy) Aggregate ¶
func (scgb *SitesCategoriesGroupBy) Aggregate(fns ...AggregateFunc) *SitesCategoriesGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*SitesCategoriesGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*SitesCategoriesGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*SitesCategoriesGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*SitesCategoriesGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*SitesCategoriesGroupBy) Float64sX ¶
Float64sX is like Float64s, but panics if an error occurs.
func (*SitesCategoriesGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*SitesCategoriesGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*SitesCategoriesGroupBy) Scan ¶
func (scgb *SitesCategoriesGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*SitesCategoriesGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type SitesCategoriesMutation ¶
type SitesCategoriesMutation struct {
// contains filtered or unexported fields
}
SitesCategoriesMutation represents an operation that mutates the SitesCategories nodes in the graph.
func (*SitesCategoriesMutation) AddField ¶
func (m *SitesCategoriesMutation) 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 (*SitesCategoriesMutation) AddedEdges ¶
func (m *SitesCategoriesMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*SitesCategoriesMutation) AddedField ¶
func (m *SitesCategoriesMutation) 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 (*SitesCategoriesMutation) AddedFields ¶
func (m *SitesCategoriesMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*SitesCategoriesMutation) AddedIDs ¶
func (m *SitesCategoriesMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*SitesCategoriesMutation) CategoriesCleared ¶
func (m *SitesCategoriesMutation) CategoriesCleared() bool
CategoriesCleared reports if the "categories" edge to the Categories entity was cleared.
func (*SitesCategoriesMutation) CategoriesID ¶
func (m *SitesCategoriesMutation) CategoriesID() (r int, exists bool)
CategoriesID returns the value of the "categories_id" field in the mutation.
func (*SitesCategoriesMutation) CategoriesIDs ¶
func (m *SitesCategoriesMutation) CategoriesIDs() (ids []int)
CategoriesIDs returns the "categories" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CategoriesID instead. It exists only for internal usage by the builders.
func (*SitesCategoriesMutation) ClearCategories ¶
func (m *SitesCategoriesMutation) ClearCategories()
ClearCategories clears the "categories" edge to the Categories entity.
func (*SitesCategoriesMutation) ClearEdge ¶
func (m *SitesCategoriesMutation) 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 (*SitesCategoriesMutation) ClearField ¶
func (m *SitesCategoriesMutation) 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 (*SitesCategoriesMutation) ClearSites ¶
func (m *SitesCategoriesMutation) ClearSites()
ClearSites clears the "sites" edge to the Sites entity.
func (*SitesCategoriesMutation) ClearedEdges ¶
func (m *SitesCategoriesMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*SitesCategoriesMutation) ClearedFields ¶
func (m *SitesCategoriesMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (SitesCategoriesMutation) Client ¶
func (m SitesCategoriesMutation) 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 (*SitesCategoriesMutation) EdgeCleared ¶
func (m *SitesCategoriesMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*SitesCategoriesMutation) Field ¶
func (m *SitesCategoriesMutation) 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 (*SitesCategoriesMutation) FieldCleared ¶
func (m *SitesCategoriesMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*SitesCategoriesMutation) Fields ¶
func (m *SitesCategoriesMutation) 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 (*SitesCategoriesMutation) ID ¶
func (m *SitesCategoriesMutation) 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 (*SitesCategoriesMutation) IDs ¶
func (m *SitesCategoriesMutation) 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 (*SitesCategoriesMutation) OldCategoriesID ¶
func (m *SitesCategoriesMutation) OldCategoriesID(ctx context.Context) (v int, err error)
OldCategoriesID returns the old "categories_id" field's value of the SitesCategories entity. If the SitesCategories 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 (*SitesCategoriesMutation) 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 (*SitesCategoriesMutation) OldSitesID ¶
func (m *SitesCategoriesMutation) OldSitesID(ctx context.Context) (v int, err error)
OldSitesID returns the old "sites_id" field's value of the SitesCategories entity. If the SitesCategories 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 (*SitesCategoriesMutation) Op ¶
func (m *SitesCategoriesMutation) Op() Op
Op returns the operation name.
func (*SitesCategoriesMutation) RemovedEdges ¶
func (m *SitesCategoriesMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*SitesCategoriesMutation) RemovedIDs ¶
func (m *SitesCategoriesMutation) 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 (*SitesCategoriesMutation) ResetCategories ¶
func (m *SitesCategoriesMutation) ResetCategories()
ResetCategories resets all changes to the "categories" edge.
func (*SitesCategoriesMutation) ResetCategoriesID ¶
func (m *SitesCategoriesMutation) ResetCategoriesID()
ResetCategoriesID resets all changes to the "categories_id" field.
func (*SitesCategoriesMutation) ResetEdge ¶
func (m *SitesCategoriesMutation) 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 (*SitesCategoriesMutation) ResetField ¶
func (m *SitesCategoriesMutation) 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 (*SitesCategoriesMutation) ResetSites ¶
func (m *SitesCategoriesMutation) ResetSites()
ResetSites resets all changes to the "sites" edge.
func (*SitesCategoriesMutation) ResetSitesID ¶
func (m *SitesCategoriesMutation) ResetSitesID()
ResetSitesID resets all changes to the "sites_id" field.
func (*SitesCategoriesMutation) SetCategoriesID ¶
func (m *SitesCategoriesMutation) SetCategoriesID(i int)
SetCategoriesID sets the "categories_id" field.
func (*SitesCategoriesMutation) SetField ¶
func (m *SitesCategoriesMutation) 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 (*SitesCategoriesMutation) SetOp ¶
func (m *SitesCategoriesMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*SitesCategoriesMutation) SetSitesID ¶
func (m *SitesCategoriesMutation) SetSitesID(i int)
SetSitesID sets the "sites_id" field.
func (*SitesCategoriesMutation) SitesCleared ¶
func (m *SitesCategoriesMutation) SitesCleared() bool
SitesCleared reports if the "sites" edge to the Sites entity was cleared.
func (*SitesCategoriesMutation) SitesID ¶
func (m *SitesCategoriesMutation) SitesID() (r int, exists bool)
SitesID returns the value of the "sites_id" field in the mutation.
func (*SitesCategoriesMutation) SitesIDs ¶
func (m *SitesCategoriesMutation) SitesIDs() (ids []int)
SitesIDs returns the "sites" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use SitesID instead. It exists only for internal usage by the builders.
func (SitesCategoriesMutation) Tx ¶
func (m SitesCategoriesMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*SitesCategoriesMutation) Type ¶
func (m *SitesCategoriesMutation) Type() string
Type returns the node type of this mutation (SitesCategories).
func (*SitesCategoriesMutation) Where ¶
func (m *SitesCategoriesMutation) Where(ps ...predicate.SitesCategories)
Where appends a list predicates to the SitesCategoriesMutation builder.
func (*SitesCategoriesMutation) WhereP ¶
func (m *SitesCategoriesMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the SitesCategoriesMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type SitesCategoriesQuery ¶
type SitesCategoriesQuery struct {
// contains filtered or unexported fields
}
SitesCategoriesQuery is the builder for querying SitesCategories entities.
func (*SitesCategoriesQuery) Aggregate ¶
func (scq *SitesCategoriesQuery) Aggregate(fns ...AggregateFunc) *SitesCategoriesSelect
Aggregate returns a SitesCategoriesSelect configured with the given aggregations.
func (*SitesCategoriesQuery) All ¶
func (scq *SitesCategoriesQuery) All(ctx context.Context) ([]*SitesCategories, error)
All executes the query and returns a list of SitesCategoriesSlice.
func (*SitesCategoriesQuery) AllX ¶
func (scq *SitesCategoriesQuery) AllX(ctx context.Context) []*SitesCategories
AllX is like All, but panics if an error occurs.
func (*SitesCategoriesQuery) Clone ¶
func (scq *SitesCategoriesQuery) Clone() *SitesCategoriesQuery
Clone returns a duplicate of the SitesCategoriesQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*SitesCategoriesQuery) Count ¶
func (scq *SitesCategoriesQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*SitesCategoriesQuery) CountX ¶
func (scq *SitesCategoriesQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*SitesCategoriesQuery) Exist ¶
func (scq *SitesCategoriesQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*SitesCategoriesQuery) ExistX ¶
func (scq *SitesCategoriesQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*SitesCategoriesQuery) First ¶
func (scq *SitesCategoriesQuery) First(ctx context.Context) (*SitesCategories, error)
First returns the first SitesCategories entity from the query. Returns a *NotFoundError when no SitesCategories was found.
func (*SitesCategoriesQuery) FirstID ¶
func (scq *SitesCategoriesQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first SitesCategories ID from the query. Returns a *NotFoundError when no SitesCategories ID was found.
func (*SitesCategoriesQuery) FirstIDX ¶
func (scq *SitesCategoriesQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*SitesCategoriesQuery) FirstX ¶
func (scq *SitesCategoriesQuery) FirstX(ctx context.Context) *SitesCategories
FirstX is like First, but panics if an error occurs.
func (*SitesCategoriesQuery) GroupBy ¶
func (scq *SitesCategoriesQuery) GroupBy(field string, fields ...string) *SitesCategoriesGroupBy
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 { SitesID int `json:"sites_id,omitempty"` Count int `json:"count,omitempty"` } client.SitesCategories.Query(). GroupBy(sitescategories.FieldSitesID). Aggregate(ent.Count()). Scan(ctx, &v)
func (*SitesCategoriesQuery) IDs ¶
func (scq *SitesCategoriesQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of SitesCategories IDs.
func (*SitesCategoriesQuery) IDsX ¶
func (scq *SitesCategoriesQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*SitesCategoriesQuery) Limit ¶
func (scq *SitesCategoriesQuery) Limit(limit int) *SitesCategoriesQuery
Limit the number of records to be returned by this query.
func (*SitesCategoriesQuery) Offset ¶
func (scq *SitesCategoriesQuery) Offset(offset int) *SitesCategoriesQuery
Offset to start from.
func (*SitesCategoriesQuery) Only ¶
func (scq *SitesCategoriesQuery) Only(ctx context.Context) (*SitesCategories, error)
Only returns a single SitesCategories entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one SitesCategories entity is found. Returns a *NotFoundError when no SitesCategories entities are found.
func (*SitesCategoriesQuery) OnlyID ¶
func (scq *SitesCategoriesQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only SitesCategories ID in the query. Returns a *NotSingularError when more than one SitesCategories ID is found. Returns a *NotFoundError when no entities are found.
func (*SitesCategoriesQuery) OnlyIDX ¶
func (scq *SitesCategoriesQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*SitesCategoriesQuery) OnlyX ¶
func (scq *SitesCategoriesQuery) OnlyX(ctx context.Context) *SitesCategories
OnlyX is like Only, but panics if an error occurs.
func (*SitesCategoriesQuery) Order ¶
func (scq *SitesCategoriesQuery) Order(o ...sitescategories.OrderOption) *SitesCategoriesQuery
Order specifies how the records should be ordered.
func (*SitesCategoriesQuery) QueryCategories ¶
func (scq *SitesCategoriesQuery) QueryCategories() *CategoriesQuery
QueryCategories chains the current query on the "categories" edge.
func (*SitesCategoriesQuery) QuerySites ¶
func (scq *SitesCategoriesQuery) QuerySites() *SitesQuery
QuerySites chains the current query on the "sites" edge.
func (*SitesCategoriesQuery) Select ¶
func (scq *SitesCategoriesQuery) Select(fields ...string) *SitesCategoriesSelect
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 { SitesID int `json:"sites_id,omitempty"` } client.SitesCategories.Query(). Select(sitescategories.FieldSitesID). Scan(ctx, &v)
func (*SitesCategoriesQuery) Unique ¶
func (scq *SitesCategoriesQuery) Unique(unique bool) *SitesCategoriesQuery
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 (*SitesCategoriesQuery) Where ¶
func (scq *SitesCategoriesQuery) Where(ps ...predicate.SitesCategories) *SitesCategoriesQuery
Where adds a new predicate for the SitesCategoriesQuery builder.
func (*SitesCategoriesQuery) WithCategories ¶
func (scq *SitesCategoriesQuery) WithCategories(opts ...func(*CategoriesQuery)) *SitesCategoriesQuery
WithCategories tells the query-builder to eager-load the nodes that are connected to the "categories" edge. The optional arguments are used to configure the query builder of the edge.
func (*SitesCategoriesQuery) WithSites ¶
func (scq *SitesCategoriesQuery) WithSites(opts ...func(*SitesQuery)) *SitesCategoriesQuery
WithSites tells the query-builder to eager-load the nodes that are connected to the "sites" edge. The optional arguments are used to configure the query builder of the edge.
type SitesCategoriesSelect ¶
type SitesCategoriesSelect struct { *SitesCategoriesQuery // contains filtered or unexported fields }
SitesCategoriesSelect is the builder for selecting fields of SitesCategories entities.
func (*SitesCategoriesSelect) Aggregate ¶
func (scs *SitesCategoriesSelect) Aggregate(fns ...AggregateFunc) *SitesCategoriesSelect
Aggregate adds the given aggregation functions to the selector query.
func (*SitesCategoriesSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*SitesCategoriesSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*SitesCategoriesSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*SitesCategoriesSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*SitesCategoriesSelect) Float64sX ¶
Float64sX is like Float64s, but panics if an error occurs.
func (*SitesCategoriesSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*SitesCategoriesSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*SitesCategoriesSelect) Scan ¶
func (scs *SitesCategoriesSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*SitesCategoriesSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type SitesCategoriesSlice ¶
type SitesCategoriesSlice []*SitesCategories
SitesCategoriesSlice is a parsable slice of SitesCategories.
type SitesCategoriesUpdate ¶
type SitesCategoriesUpdate struct {
// contains filtered or unexported fields
}
SitesCategoriesUpdate is the builder for updating SitesCategories entities.
func (*SitesCategoriesUpdate) ClearCategories ¶
func (scu *SitesCategoriesUpdate) ClearCategories() *SitesCategoriesUpdate
ClearCategories clears the "categories" edge to the Categories entity.
func (*SitesCategoriesUpdate) ClearSites ¶
func (scu *SitesCategoriesUpdate) ClearSites() *SitesCategoriesUpdate
ClearSites clears the "sites" edge to the Sites entity.
func (*SitesCategoriesUpdate) Exec ¶
func (scu *SitesCategoriesUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*SitesCategoriesUpdate) ExecX ¶
func (scu *SitesCategoriesUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SitesCategoriesUpdate) Mutation ¶
func (scu *SitesCategoriesUpdate) Mutation() *SitesCategoriesMutation
Mutation returns the SitesCategoriesMutation object of the builder.
func (*SitesCategoriesUpdate) Save ¶
func (scu *SitesCategoriesUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*SitesCategoriesUpdate) SaveX ¶
func (scu *SitesCategoriesUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*SitesCategoriesUpdate) SetCategories ¶
func (scu *SitesCategoriesUpdate) SetCategories(c *Categories) *SitesCategoriesUpdate
SetCategories sets the "categories" edge to the Categories entity.
func (*SitesCategoriesUpdate) SetCategoriesID ¶
func (scu *SitesCategoriesUpdate) SetCategoriesID(i int) *SitesCategoriesUpdate
SetCategoriesID sets the "categories_id" field.
func (*SitesCategoriesUpdate) SetNillableCategoriesID ¶
func (scu *SitesCategoriesUpdate) SetNillableCategoriesID(i *int) *SitesCategoriesUpdate
SetNillableCategoriesID sets the "categories_id" field if the given value is not nil.
func (*SitesCategoriesUpdate) SetNillableSitesID ¶
func (scu *SitesCategoriesUpdate) SetNillableSitesID(i *int) *SitesCategoriesUpdate
SetNillableSitesID sets the "sites_id" field if the given value is not nil.
func (*SitesCategoriesUpdate) SetSites ¶
func (scu *SitesCategoriesUpdate) SetSites(s *Sites) *SitesCategoriesUpdate
SetSites sets the "sites" edge to the Sites entity.
func (*SitesCategoriesUpdate) SetSitesID ¶
func (scu *SitesCategoriesUpdate) SetSitesID(i int) *SitesCategoriesUpdate
SetSitesID sets the "sites_id" field.
func (*SitesCategoriesUpdate) Where ¶
func (scu *SitesCategoriesUpdate) Where(ps ...predicate.SitesCategories) *SitesCategoriesUpdate
Where appends a list predicates to the SitesCategoriesUpdate builder.
type SitesCategoriesUpdateOne ¶
type SitesCategoriesUpdateOne struct {
// contains filtered or unexported fields
}
SitesCategoriesUpdateOne is the builder for updating a single SitesCategories entity.
func (*SitesCategoriesUpdateOne) ClearCategories ¶
func (scuo *SitesCategoriesUpdateOne) ClearCategories() *SitesCategoriesUpdateOne
ClearCategories clears the "categories" edge to the Categories entity.
func (*SitesCategoriesUpdateOne) ClearSites ¶
func (scuo *SitesCategoriesUpdateOne) ClearSites() *SitesCategoriesUpdateOne
ClearSites clears the "sites" edge to the Sites entity.
func (*SitesCategoriesUpdateOne) Exec ¶
func (scuo *SitesCategoriesUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*SitesCategoriesUpdateOne) ExecX ¶
func (scuo *SitesCategoriesUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SitesCategoriesUpdateOne) Mutation ¶
func (scuo *SitesCategoriesUpdateOne) Mutation() *SitesCategoriesMutation
Mutation returns the SitesCategoriesMutation object of the builder.
func (*SitesCategoriesUpdateOne) Save ¶
func (scuo *SitesCategoriesUpdateOne) Save(ctx context.Context) (*SitesCategories, error)
Save executes the query and returns the updated SitesCategories entity.
func (*SitesCategoriesUpdateOne) SaveX ¶
func (scuo *SitesCategoriesUpdateOne) SaveX(ctx context.Context) *SitesCategories
SaveX is like Save, but panics if an error occurs.
func (*SitesCategoriesUpdateOne) Select ¶
func (scuo *SitesCategoriesUpdateOne) Select(field string, fields ...string) *SitesCategoriesUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*SitesCategoriesUpdateOne) SetCategories ¶
func (scuo *SitesCategoriesUpdateOne) SetCategories(c *Categories) *SitesCategoriesUpdateOne
SetCategories sets the "categories" edge to the Categories entity.
func (*SitesCategoriesUpdateOne) SetCategoriesID ¶
func (scuo *SitesCategoriesUpdateOne) SetCategoriesID(i int) *SitesCategoriesUpdateOne
SetCategoriesID sets the "categories_id" field.
func (*SitesCategoriesUpdateOne) SetNillableCategoriesID ¶
func (scuo *SitesCategoriesUpdateOne) SetNillableCategoriesID(i *int) *SitesCategoriesUpdateOne
SetNillableCategoriesID sets the "categories_id" field if the given value is not nil.
func (*SitesCategoriesUpdateOne) SetNillableSitesID ¶
func (scuo *SitesCategoriesUpdateOne) SetNillableSitesID(i *int) *SitesCategoriesUpdateOne
SetNillableSitesID sets the "sites_id" field if the given value is not nil.
func (*SitesCategoriesUpdateOne) SetSites ¶
func (scuo *SitesCategoriesUpdateOne) SetSites(s *Sites) *SitesCategoriesUpdateOne
SetSites sets the "sites" edge to the Sites entity.
func (*SitesCategoriesUpdateOne) SetSitesID ¶
func (scuo *SitesCategoriesUpdateOne) SetSitesID(i int) *SitesCategoriesUpdateOne
SetSitesID sets the "sites_id" field.
func (*SitesCategoriesUpdateOne) Where ¶
func (scuo *SitesCategoriesUpdateOne) Where(ps ...predicate.SitesCategories) *SitesCategoriesUpdateOne
Where appends a list predicates to the SitesCategoriesUpdate builder.
type SitesClient ¶
type SitesClient struct {
// contains filtered or unexported fields
}
SitesClient is a client for the Sites schema.
func NewSitesClient ¶
func NewSitesClient(c config) *SitesClient
NewSitesClient returns a client for the Sites from the given config.
func (*SitesClient) Create ¶
func (c *SitesClient) Create() *SitesCreate
Create returns a builder for creating a Sites entity.
func (*SitesClient) CreateBulk ¶
func (c *SitesClient) CreateBulk(builders ...*SitesCreate) *SitesCreateBulk
CreateBulk returns a builder for creating a bulk of Sites entities.
func (*SitesClient) Delete ¶
func (c *SitesClient) Delete() *SitesDelete
Delete returns a delete builder for Sites.
func (*SitesClient) DeleteOne ¶
func (c *SitesClient) DeleteOne(s *Sites) *SitesDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*SitesClient) DeleteOneID ¶
func (c *SitesClient) DeleteOneID(id int) *SitesDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*SitesClient) GetX ¶
func (c *SitesClient) GetX(ctx context.Context, id int) *Sites
GetX is like Get, but panics if an error occurs.
func (*SitesClient) Intercept ¶
func (c *SitesClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `sites.Intercept(f(g(h())))`.
func (*SitesClient) Interceptors ¶
func (c *SitesClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*SitesClient) MapCreateBulk ¶
func (c *SitesClient) MapCreateBulk(slice any, setFunc func(*SitesCreate, int)) *SitesCreateBulk
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 (*SitesClient) Query ¶
func (c *SitesClient) Query() *SitesQuery
Query returns a query builder for Sites.
func (*SitesClient) QueryBlocks ¶
func (c *SitesClient) QueryBlocks(s *Sites) *BlocksQuery
QueryBlocks queries the blocks edge of a Sites.
func (*SitesClient) QueryCategories ¶
func (c *SitesClient) QueryCategories(s *Sites) *CategoriesQuery
QueryCategories queries the categories edge of a Sites.
func (*SitesClient) QuerySitesCategories ¶
func (c *SitesClient) QuerySitesCategories(s *Sites) *SitesCategoriesQuery
QuerySitesCategories queries the sites_categories edge of a Sites.
func (*SitesClient) Update ¶
func (c *SitesClient) Update() *SitesUpdate
Update returns an update builder for Sites.
func (*SitesClient) UpdateOne ¶
func (c *SitesClient) UpdateOne(s *Sites) *SitesUpdateOne
UpdateOne returns an update builder for the given entity.
func (*SitesClient) UpdateOneID ¶
func (c *SitesClient) UpdateOneID(id int) *SitesUpdateOne
UpdateOneID returns an update builder for the given id.
func (*SitesClient) Use ¶
func (c *SitesClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `sites.Hooks(f(g(h())))`.
type SitesCreate ¶
type SitesCreate struct {
// contains filtered or unexported fields
}
SitesCreate is the builder for creating a Sites entity.
func (*SitesCreate) AddBlockIDs ¶
func (sc *SitesCreate) AddBlockIDs(ids ...int) *SitesCreate
AddBlockIDs adds the "blocks" edge to the Blocks entity by IDs.
func (*SitesCreate) AddBlocks ¶
func (sc *SitesCreate) AddBlocks(b ...*Blocks) *SitesCreate
AddBlocks adds the "blocks" edges to the Blocks entity.
func (*SitesCreate) AddCategories ¶
func (sc *SitesCreate) AddCategories(c ...*Categories) *SitesCreate
AddCategories adds the "categories" edges to the Categories entity.
func (*SitesCreate) AddCategoryIDs ¶
func (sc *SitesCreate) AddCategoryIDs(ids ...int) *SitesCreate
AddCategoryIDs adds the "categories" edge to the Categories entity by IDs.
func (*SitesCreate) AddSitesCategories ¶
func (sc *SitesCreate) AddSitesCategories(s ...*SitesCategories) *SitesCreate
AddSitesCategories adds the "sites_categories" edges to the SitesCategories entity.
func (*SitesCreate) AddSitesCategoryIDs ¶
func (sc *SitesCreate) AddSitesCategoryIDs(ids ...int) *SitesCreate
AddSitesCategoryIDs adds the "sites_categories" edge to the SitesCategories entity by IDs.
func (*SitesCreate) Exec ¶
func (sc *SitesCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*SitesCreate) ExecX ¶
func (sc *SitesCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SitesCreate) Mutation ¶
func (sc *SitesCreate) Mutation() *SitesMutation
Mutation returns the SitesMutation object of the builder.
func (*SitesCreate) Save ¶
func (sc *SitesCreate) Save(ctx context.Context) (*Sites, error)
Save creates the Sites in the database.
func (*SitesCreate) SaveX ¶
func (sc *SitesCreate) SaveX(ctx context.Context) *Sites
SaveX calls Save and panics if Save returns an error.
func (*SitesCreate) SetCreatedAt ¶
func (sc *SitesCreate) SetCreatedAt(t time.Time) *SitesCreate
SetCreatedAt sets the "created_at" field.
func (*SitesCreate) SetDomain ¶
func (sc *SitesCreate) SetDomain(s string) *SitesCreate
SetDomain sets the "domain" field.
func (*SitesCreate) SetNillableCreatedAt ¶
func (sc *SitesCreate) SetNillableCreatedAt(t *time.Time) *SitesCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*SitesCreate) SetNillableUpdatedAt ¶
func (sc *SitesCreate) SetNillableUpdatedAt(t *time.Time) *SitesCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*SitesCreate) SetUpdatedAt ¶
func (sc *SitesCreate) SetUpdatedAt(t time.Time) *SitesCreate
SetUpdatedAt sets the "updated_at" field.
type SitesCreateBulk ¶
type SitesCreateBulk struct {
// contains filtered or unexported fields
}
SitesCreateBulk is the builder for creating many Sites entities in bulk.
func (*SitesCreateBulk) Exec ¶
func (scb *SitesCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*SitesCreateBulk) ExecX ¶
func (scb *SitesCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type SitesDelete ¶
type SitesDelete struct {
// contains filtered or unexported fields
}
SitesDelete is the builder for deleting a Sites entity.
func (*SitesDelete) Exec ¶
func (sd *SitesDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*SitesDelete) ExecX ¶
func (sd *SitesDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*SitesDelete) Where ¶
func (sd *SitesDelete) Where(ps ...predicate.Sites) *SitesDelete
Where appends a list predicates to the SitesDelete builder.
type SitesDeleteOne ¶
type SitesDeleteOne struct {
// contains filtered or unexported fields
}
SitesDeleteOne is the builder for deleting a single Sites entity.
func (*SitesDeleteOne) Exec ¶
func (sdo *SitesDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*SitesDeleteOne) ExecX ¶
func (sdo *SitesDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SitesDeleteOne) Where ¶
func (sdo *SitesDeleteOne) Where(ps ...predicate.Sites) *SitesDeleteOne
Where appends a list predicates to the SitesDelete builder.
type SitesEdges ¶
type SitesEdges struct { // Blocks holds the value of the blocks edge. Blocks []*Blocks `json:"blocks,omitempty"` // Categories holds the value of the categories edge. Categories []*Categories `json:"categories,omitempty"` // SitesCategories holds the value of the sites_categories edge. SitesCategories []*SitesCategories `json:"sites_categories,omitempty"` // contains filtered or unexported fields }
SitesEdges holds the relations/edges for other nodes in the graph.
func (SitesEdges) BlocksOrErr ¶
func (e SitesEdges) BlocksOrErr() ([]*Blocks, error)
BlocksOrErr returns the Blocks value or an error if the edge was not loaded in eager-loading.
func (SitesEdges) CategoriesOrErr ¶
func (e SitesEdges) CategoriesOrErr() ([]*Categories, error)
CategoriesOrErr returns the Categories value or an error if the edge was not loaded in eager-loading.
func (SitesEdges) SitesCategoriesOrErr ¶
func (e SitesEdges) SitesCategoriesOrErr() ([]*SitesCategories, error)
SitesCategoriesOrErr returns the SitesCategories value or an error if the edge was not loaded in eager-loading.
type SitesGroupBy ¶
type SitesGroupBy struct {
// contains filtered or unexported fields
}
SitesGroupBy is the group-by builder for Sites entities.
func (*SitesGroupBy) Aggregate ¶
func (sgb *SitesGroupBy) Aggregate(fns ...AggregateFunc) *SitesGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*SitesGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*SitesGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*SitesGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*SitesGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*SitesGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*SitesGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*SitesGroupBy) Scan ¶
func (sgb *SitesGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*SitesGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type SitesMutation ¶
type SitesMutation struct {
// contains filtered or unexported fields
}
SitesMutation represents an operation that mutates the Sites nodes in the graph.
func (*SitesMutation) AddBlockIDs ¶
func (m *SitesMutation) AddBlockIDs(ids ...int)
AddBlockIDs adds the "blocks" edge to the Blocks entity by ids.
func (*SitesMutation) AddCategoryIDs ¶
func (m *SitesMutation) AddCategoryIDs(ids ...int)
AddCategoryIDs adds the "categories" edge to the Categories entity by ids.
func (*SitesMutation) AddField ¶
func (m *SitesMutation) 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 (*SitesMutation) AddSitesCategoryIDs ¶
func (m *SitesMutation) AddSitesCategoryIDs(ids ...int)
AddSitesCategoryIDs adds the "sites_categories" edge to the SitesCategories entity by ids.
func (*SitesMutation) AddedEdges ¶
func (m *SitesMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*SitesMutation) AddedField ¶
func (m *SitesMutation) 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 (*SitesMutation) AddedFields ¶
func (m *SitesMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*SitesMutation) AddedIDs ¶
func (m *SitesMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*SitesMutation) BlocksCleared ¶
func (m *SitesMutation) BlocksCleared() bool
BlocksCleared reports if the "blocks" edge to the Blocks entity was cleared.
func (*SitesMutation) BlocksIDs ¶
func (m *SitesMutation) BlocksIDs() (ids []int)
BlocksIDs returns the "blocks" edge IDs in the mutation.
func (*SitesMutation) CategoriesCleared ¶
func (m *SitesMutation) CategoriesCleared() bool
CategoriesCleared reports if the "categories" edge to the Categories entity was cleared.
func (*SitesMutation) CategoriesIDs ¶
func (m *SitesMutation) CategoriesIDs() (ids []int)
CategoriesIDs returns the "categories" edge IDs in the mutation.
func (*SitesMutation) ClearBlocks ¶
func (m *SitesMutation) ClearBlocks()
ClearBlocks clears the "blocks" edge to the Blocks entity.
func (*SitesMutation) ClearCategories ¶
func (m *SitesMutation) ClearCategories()
ClearCategories clears the "categories" edge to the Categories entity.
func (*SitesMutation) ClearEdge ¶
func (m *SitesMutation) 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 (*SitesMutation) ClearField ¶
func (m *SitesMutation) 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 (*SitesMutation) ClearSitesCategories ¶
func (m *SitesMutation) ClearSitesCategories()
ClearSitesCategories clears the "sites_categories" edge to the SitesCategories entity.
func (*SitesMutation) ClearedEdges ¶
func (m *SitesMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*SitesMutation) ClearedFields ¶
func (m *SitesMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (SitesMutation) Client ¶
func (m SitesMutation) 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 (*SitesMutation) CreatedAt ¶
func (m *SitesMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*SitesMutation) Domain ¶
func (m *SitesMutation) Domain() (r string, exists bool)
Domain returns the value of the "domain" field in the mutation.
func (*SitesMutation) EdgeCleared ¶
func (m *SitesMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*SitesMutation) Field ¶
func (m *SitesMutation) 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 (*SitesMutation) FieldCleared ¶
func (m *SitesMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*SitesMutation) Fields ¶
func (m *SitesMutation) 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 (*SitesMutation) ID ¶
func (m *SitesMutation) 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 (*SitesMutation) IDs ¶
func (m *SitesMutation) 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 (*SitesMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Sites entity. If the Sites 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 (*SitesMutation) OldDomain ¶
func (m *SitesMutation) OldDomain(ctx context.Context) (v string, err error)
OldDomain returns the old "domain" field's value of the Sites entity. If the Sites 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 (*SitesMutation) 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 (*SitesMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Sites entity. If the Sites 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 (*SitesMutation) RemoveBlockIDs ¶
func (m *SitesMutation) RemoveBlockIDs(ids ...int)
RemoveBlockIDs removes the "blocks" edge to the Blocks entity by IDs.
func (*SitesMutation) RemoveCategoryIDs ¶
func (m *SitesMutation) RemoveCategoryIDs(ids ...int)
RemoveCategoryIDs removes the "categories" edge to the Categories entity by IDs.
func (*SitesMutation) RemoveSitesCategoryIDs ¶
func (m *SitesMutation) RemoveSitesCategoryIDs(ids ...int)
RemoveSitesCategoryIDs removes the "sites_categories" edge to the SitesCategories entity by IDs.
func (*SitesMutation) RemovedBlocksIDs ¶
func (m *SitesMutation) RemovedBlocksIDs() (ids []int)
RemovedBlocks returns the removed IDs of the "blocks" edge to the Blocks entity.
func (*SitesMutation) RemovedCategoriesIDs ¶
func (m *SitesMutation) RemovedCategoriesIDs() (ids []int)
RemovedCategories returns the removed IDs of the "categories" edge to the Categories entity.
func (*SitesMutation) RemovedEdges ¶
func (m *SitesMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*SitesMutation) RemovedIDs ¶
func (m *SitesMutation) 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 (*SitesMutation) RemovedSitesCategoriesIDs ¶
func (m *SitesMutation) RemovedSitesCategoriesIDs() (ids []int)
RemovedSitesCategories returns the removed IDs of the "sites_categories" edge to the SitesCategories entity.
func (*SitesMutation) ResetBlocks ¶
func (m *SitesMutation) ResetBlocks()
ResetBlocks resets all changes to the "blocks" edge.
func (*SitesMutation) ResetCategories ¶
func (m *SitesMutation) ResetCategories()
ResetCategories resets all changes to the "categories" edge.
func (*SitesMutation) ResetCreatedAt ¶
func (m *SitesMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*SitesMutation) ResetDomain ¶
func (m *SitesMutation) ResetDomain()
ResetDomain resets all changes to the "domain" field.
func (*SitesMutation) ResetEdge ¶
func (m *SitesMutation) 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 (*SitesMutation) ResetField ¶
func (m *SitesMutation) 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 (*SitesMutation) ResetSitesCategories ¶
func (m *SitesMutation) ResetSitesCategories()
ResetSitesCategories resets all changes to the "sites_categories" edge.
func (*SitesMutation) ResetUpdatedAt ¶
func (m *SitesMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*SitesMutation) SetCreatedAt ¶
func (m *SitesMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*SitesMutation) SetDomain ¶
func (m *SitesMutation) SetDomain(s string)
SetDomain sets the "domain" field.
func (*SitesMutation) SetField ¶
func (m *SitesMutation) 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 (*SitesMutation) SetOp ¶
func (m *SitesMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*SitesMutation) SetUpdatedAt ¶
func (m *SitesMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (*SitesMutation) SitesCategoriesCleared ¶
func (m *SitesMutation) SitesCategoriesCleared() bool
SitesCategoriesCleared reports if the "sites_categories" edge to the SitesCategories entity was cleared.
func (*SitesMutation) SitesCategoriesIDs ¶
func (m *SitesMutation) SitesCategoriesIDs() (ids []int)
SitesCategoriesIDs returns the "sites_categories" edge IDs in the mutation.
func (SitesMutation) Tx ¶
func (m SitesMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*SitesMutation) Type ¶
func (m *SitesMutation) Type() string
Type returns the node type of this mutation (Sites).
func (*SitesMutation) UpdatedAt ¶
func (m *SitesMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*SitesMutation) Where ¶
func (m *SitesMutation) Where(ps ...predicate.Sites)
Where appends a list predicates to the SitesMutation builder.
func (*SitesMutation) WhereP ¶
func (m *SitesMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the SitesMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type SitesQuery ¶
type SitesQuery struct {
// contains filtered or unexported fields
}
SitesQuery is the builder for querying Sites entities.
func (*SitesQuery) Aggregate ¶
func (sq *SitesQuery) Aggregate(fns ...AggregateFunc) *SitesSelect
Aggregate returns a SitesSelect configured with the given aggregations.
func (*SitesQuery) All ¶
func (sq *SitesQuery) All(ctx context.Context) ([]*Sites, error)
All executes the query and returns a list of SitesSlice.
func (*SitesQuery) AllX ¶
func (sq *SitesQuery) AllX(ctx context.Context) []*Sites
AllX is like All, but panics if an error occurs.
func (*SitesQuery) Clone ¶
func (sq *SitesQuery) Clone() *SitesQuery
Clone returns a duplicate of the SitesQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*SitesQuery) Count ¶
func (sq *SitesQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*SitesQuery) CountX ¶
func (sq *SitesQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*SitesQuery) Exist ¶
func (sq *SitesQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*SitesQuery) ExistX ¶
func (sq *SitesQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*SitesQuery) First ¶
func (sq *SitesQuery) First(ctx context.Context) (*Sites, error)
First returns the first Sites entity from the query. Returns a *NotFoundError when no Sites was found.
func (*SitesQuery) FirstID ¶
func (sq *SitesQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Sites ID from the query. Returns a *NotFoundError when no Sites ID was found.
func (*SitesQuery) FirstIDX ¶
func (sq *SitesQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*SitesQuery) FirstX ¶
func (sq *SitesQuery) FirstX(ctx context.Context) *Sites
FirstX is like First, but panics if an error occurs.
func (*SitesQuery) GroupBy ¶
func (sq *SitesQuery) GroupBy(field string, fields ...string) *SitesGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { CreatedAt time.Time `json:"created_at,omitempty"` Count int `json:"count,omitempty"` } client.Sites.Query(). GroupBy(sites.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*SitesQuery) IDs ¶
func (sq *SitesQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Sites IDs.
func (*SitesQuery) IDsX ¶
func (sq *SitesQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*SitesQuery) Limit ¶
func (sq *SitesQuery) Limit(limit int) *SitesQuery
Limit the number of records to be returned by this query.
func (*SitesQuery) Offset ¶
func (sq *SitesQuery) Offset(offset int) *SitesQuery
Offset to start from.
func (*SitesQuery) Only ¶
func (sq *SitesQuery) Only(ctx context.Context) (*Sites, error)
Only returns a single Sites entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Sites entity is found. Returns a *NotFoundError when no Sites entities are found.
func (*SitesQuery) OnlyID ¶
func (sq *SitesQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Sites ID in the query. Returns a *NotSingularError when more than one Sites ID is found. Returns a *NotFoundError when no entities are found.
func (*SitesQuery) OnlyIDX ¶
func (sq *SitesQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*SitesQuery) OnlyX ¶
func (sq *SitesQuery) OnlyX(ctx context.Context) *Sites
OnlyX is like Only, but panics if an error occurs.
func (*SitesQuery) Order ¶
func (sq *SitesQuery) Order(o ...sites.OrderOption) *SitesQuery
Order specifies how the records should be ordered.
func (*SitesQuery) QueryBlocks ¶
func (sq *SitesQuery) QueryBlocks() *BlocksQuery
QueryBlocks chains the current query on the "blocks" edge.
func (*SitesQuery) QueryCategories ¶
func (sq *SitesQuery) QueryCategories() *CategoriesQuery
QueryCategories chains the current query on the "categories" edge.
func (*SitesQuery) QuerySitesCategories ¶
func (sq *SitesQuery) QuerySitesCategories() *SitesCategoriesQuery
QuerySitesCategories chains the current query on the "sites_categories" edge.
func (*SitesQuery) Select ¶
func (sq *SitesQuery) Select(fields ...string) *SitesSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { CreatedAt time.Time `json:"created_at,omitempty"` } client.Sites.Query(). Select(sites.FieldCreatedAt). Scan(ctx, &v)
func (*SitesQuery) Unique ¶
func (sq *SitesQuery) Unique(unique bool) *SitesQuery
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 (*SitesQuery) Where ¶
func (sq *SitesQuery) Where(ps ...predicate.Sites) *SitesQuery
Where adds a new predicate for the SitesQuery builder.
func (*SitesQuery) WithBlocks ¶
func (sq *SitesQuery) WithBlocks(opts ...func(*BlocksQuery)) *SitesQuery
WithBlocks tells the query-builder to eager-load the nodes that are connected to the "blocks" edge. The optional arguments are used to configure the query builder of the edge.
func (*SitesQuery) WithCategories ¶
func (sq *SitesQuery) WithCategories(opts ...func(*CategoriesQuery)) *SitesQuery
WithCategories tells the query-builder to eager-load the nodes that are connected to the "categories" edge. The optional arguments are used to configure the query builder of the edge.
func (*SitesQuery) WithSitesCategories ¶
func (sq *SitesQuery) WithSitesCategories(opts ...func(*SitesCategoriesQuery)) *SitesQuery
WithSitesCategories tells the query-builder to eager-load the nodes that are connected to the "sites_categories" edge. The optional arguments are used to configure the query builder of the edge.
type SitesSelect ¶
type SitesSelect struct { *SitesQuery // contains filtered or unexported fields }
SitesSelect is the builder for selecting fields of Sites entities.
func (*SitesSelect) Aggregate ¶
func (ss *SitesSelect) Aggregate(fns ...AggregateFunc) *SitesSelect
Aggregate adds the given aggregation functions to the selector query.
func (*SitesSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*SitesSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*SitesSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*SitesSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*SitesSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*SitesSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*SitesSelect) Scan ¶
func (ss *SitesSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*SitesSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type SitesUpdate ¶
type SitesUpdate struct {
// contains filtered or unexported fields
}
SitesUpdate is the builder for updating Sites entities.
func (*SitesUpdate) AddBlockIDs ¶
func (su *SitesUpdate) AddBlockIDs(ids ...int) *SitesUpdate
AddBlockIDs adds the "blocks" edge to the Blocks entity by IDs.
func (*SitesUpdate) AddBlocks ¶
func (su *SitesUpdate) AddBlocks(b ...*Blocks) *SitesUpdate
AddBlocks adds the "blocks" edges to the Blocks entity.
func (*SitesUpdate) AddCategories ¶
func (su *SitesUpdate) AddCategories(c ...*Categories) *SitesUpdate
AddCategories adds the "categories" edges to the Categories entity.
func (*SitesUpdate) AddCategoryIDs ¶
func (su *SitesUpdate) AddCategoryIDs(ids ...int) *SitesUpdate
AddCategoryIDs adds the "categories" edge to the Categories entity by IDs.
func (*SitesUpdate) AddSitesCategories ¶
func (su *SitesUpdate) AddSitesCategories(s ...*SitesCategories) *SitesUpdate
AddSitesCategories adds the "sites_categories" edges to the SitesCategories entity.
func (*SitesUpdate) AddSitesCategoryIDs ¶
func (su *SitesUpdate) AddSitesCategoryIDs(ids ...int) *SitesUpdate
AddSitesCategoryIDs adds the "sites_categories" edge to the SitesCategories entity by IDs.
func (*SitesUpdate) ClearBlocks ¶
func (su *SitesUpdate) ClearBlocks() *SitesUpdate
ClearBlocks clears all "blocks" edges to the Blocks entity.
func (*SitesUpdate) ClearCategories ¶
func (su *SitesUpdate) ClearCategories() *SitesUpdate
ClearCategories clears all "categories" edges to the Categories entity.
func (*SitesUpdate) ClearSitesCategories ¶
func (su *SitesUpdate) ClearSitesCategories() *SitesUpdate
ClearSitesCategories clears all "sites_categories" edges to the SitesCategories entity.
func (*SitesUpdate) Exec ¶
func (su *SitesUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*SitesUpdate) ExecX ¶
func (su *SitesUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SitesUpdate) Mutation ¶
func (su *SitesUpdate) Mutation() *SitesMutation
Mutation returns the SitesMutation object of the builder.
func (*SitesUpdate) RemoveBlockIDs ¶
func (su *SitesUpdate) RemoveBlockIDs(ids ...int) *SitesUpdate
RemoveBlockIDs removes the "blocks" edge to Blocks entities by IDs.
func (*SitesUpdate) RemoveBlocks ¶
func (su *SitesUpdate) RemoveBlocks(b ...*Blocks) *SitesUpdate
RemoveBlocks removes "blocks" edges to Blocks entities.
func (*SitesUpdate) RemoveCategories ¶
func (su *SitesUpdate) RemoveCategories(c ...*Categories) *SitesUpdate
RemoveCategories removes "categories" edges to Categories entities.
func (*SitesUpdate) RemoveCategoryIDs ¶
func (su *SitesUpdate) RemoveCategoryIDs(ids ...int) *SitesUpdate
RemoveCategoryIDs removes the "categories" edge to Categories entities by IDs.
func (*SitesUpdate) RemoveSitesCategories ¶
func (su *SitesUpdate) RemoveSitesCategories(s ...*SitesCategories) *SitesUpdate
RemoveSitesCategories removes "sites_categories" edges to SitesCategories entities.
func (*SitesUpdate) RemoveSitesCategoryIDs ¶
func (su *SitesUpdate) RemoveSitesCategoryIDs(ids ...int) *SitesUpdate
RemoveSitesCategoryIDs removes the "sites_categories" edge to SitesCategories entities by IDs.
func (*SitesUpdate) Save ¶
func (su *SitesUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*SitesUpdate) SaveX ¶
func (su *SitesUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*SitesUpdate) SetDomain ¶
func (su *SitesUpdate) SetDomain(s string) *SitesUpdate
SetDomain sets the "domain" field.
func (*SitesUpdate) SetNillableDomain ¶
func (su *SitesUpdate) SetNillableDomain(s *string) *SitesUpdate
SetNillableDomain sets the "domain" field if the given value is not nil.
func (*SitesUpdate) SetUpdatedAt ¶
func (su *SitesUpdate) SetUpdatedAt(t time.Time) *SitesUpdate
SetUpdatedAt sets the "updated_at" field.
func (*SitesUpdate) Where ¶
func (su *SitesUpdate) Where(ps ...predicate.Sites) *SitesUpdate
Where appends a list predicates to the SitesUpdate builder.
type SitesUpdateOne ¶
type SitesUpdateOne struct {
// contains filtered or unexported fields
}
SitesUpdateOne is the builder for updating a single Sites entity.
func (*SitesUpdateOne) AddBlockIDs ¶
func (suo *SitesUpdateOne) AddBlockIDs(ids ...int) *SitesUpdateOne
AddBlockIDs adds the "blocks" edge to the Blocks entity by IDs.
func (*SitesUpdateOne) AddBlocks ¶
func (suo *SitesUpdateOne) AddBlocks(b ...*Blocks) *SitesUpdateOne
AddBlocks adds the "blocks" edges to the Blocks entity.
func (*SitesUpdateOne) AddCategories ¶
func (suo *SitesUpdateOne) AddCategories(c ...*Categories) *SitesUpdateOne
AddCategories adds the "categories" edges to the Categories entity.
func (*SitesUpdateOne) AddCategoryIDs ¶
func (suo *SitesUpdateOne) AddCategoryIDs(ids ...int) *SitesUpdateOne
AddCategoryIDs adds the "categories" edge to the Categories entity by IDs.
func (*SitesUpdateOne) AddSitesCategories ¶
func (suo *SitesUpdateOne) AddSitesCategories(s ...*SitesCategories) *SitesUpdateOne
AddSitesCategories adds the "sites_categories" edges to the SitesCategories entity.
func (*SitesUpdateOne) AddSitesCategoryIDs ¶
func (suo *SitesUpdateOne) AddSitesCategoryIDs(ids ...int) *SitesUpdateOne
AddSitesCategoryIDs adds the "sites_categories" edge to the SitesCategories entity by IDs.
func (*SitesUpdateOne) ClearBlocks ¶
func (suo *SitesUpdateOne) ClearBlocks() *SitesUpdateOne
ClearBlocks clears all "blocks" edges to the Blocks entity.
func (*SitesUpdateOne) ClearCategories ¶
func (suo *SitesUpdateOne) ClearCategories() *SitesUpdateOne
ClearCategories clears all "categories" edges to the Categories entity.
func (*SitesUpdateOne) ClearSitesCategories ¶
func (suo *SitesUpdateOne) ClearSitesCategories() *SitesUpdateOne
ClearSitesCategories clears all "sites_categories" edges to the SitesCategories entity.
func (*SitesUpdateOne) Exec ¶
func (suo *SitesUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*SitesUpdateOne) ExecX ¶
func (suo *SitesUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*SitesUpdateOne) Mutation ¶
func (suo *SitesUpdateOne) Mutation() *SitesMutation
Mutation returns the SitesMutation object of the builder.
func (*SitesUpdateOne) RemoveBlockIDs ¶
func (suo *SitesUpdateOne) RemoveBlockIDs(ids ...int) *SitesUpdateOne
RemoveBlockIDs removes the "blocks" edge to Blocks entities by IDs.
func (*SitesUpdateOne) RemoveBlocks ¶
func (suo *SitesUpdateOne) RemoveBlocks(b ...*Blocks) *SitesUpdateOne
RemoveBlocks removes "blocks" edges to Blocks entities.
func (*SitesUpdateOne) RemoveCategories ¶
func (suo *SitesUpdateOne) RemoveCategories(c ...*Categories) *SitesUpdateOne
RemoveCategories removes "categories" edges to Categories entities.
func (*SitesUpdateOne) RemoveCategoryIDs ¶
func (suo *SitesUpdateOne) RemoveCategoryIDs(ids ...int) *SitesUpdateOne
RemoveCategoryIDs removes the "categories" edge to Categories entities by IDs.
func (*SitesUpdateOne) RemoveSitesCategories ¶
func (suo *SitesUpdateOne) RemoveSitesCategories(s ...*SitesCategories) *SitesUpdateOne
RemoveSitesCategories removes "sites_categories" edges to SitesCategories entities.
func (*SitesUpdateOne) RemoveSitesCategoryIDs ¶
func (suo *SitesUpdateOne) RemoveSitesCategoryIDs(ids ...int) *SitesUpdateOne
RemoveSitesCategoryIDs removes the "sites_categories" edge to SitesCategories entities by IDs.
func (*SitesUpdateOne) Save ¶
func (suo *SitesUpdateOne) Save(ctx context.Context) (*Sites, error)
Save executes the query and returns the updated Sites entity.
func (*SitesUpdateOne) SaveX ¶
func (suo *SitesUpdateOne) SaveX(ctx context.Context) *Sites
SaveX is like Save, but panics if an error occurs.
func (*SitesUpdateOne) Select ¶
func (suo *SitesUpdateOne) Select(field string, fields ...string) *SitesUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*SitesUpdateOne) SetDomain ¶
func (suo *SitesUpdateOne) SetDomain(s string) *SitesUpdateOne
SetDomain sets the "domain" field.
func (*SitesUpdateOne) SetNillableDomain ¶
func (suo *SitesUpdateOne) SetNillableDomain(s *string) *SitesUpdateOne
SetNillableDomain sets the "domain" field if the given value is not nil.
func (*SitesUpdateOne) SetUpdatedAt ¶
func (suo *SitesUpdateOne) SetUpdatedAt(t time.Time) *SitesUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*SitesUpdateOne) Where ¶
func (suo *SitesUpdateOne) Where(ps ...predicate.Sites) *SitesUpdateOne
Where appends a list predicates to the SitesUpdate builder.
type TraverseFunc ¶
type TraverseFunc = ent.TraverseFunc
ent aliases to avoid import conflicts in user's code.
type Tx ¶
type Tx struct { // Blocks is the client for interacting with the Blocks builders. Blocks *BlocksClient // Categories is the client for interacting with the Categories builders. Categories *CategoriesClient // Counter is the client for interacting with the Counter builders. Counter *CounterClient // Isps is the client for interacting with the Isps builders. Isps *IspsClient // Sites is the client for interacting with the Sites builders. Sites *SitesClient // SitesCategories is the client for interacting with the SitesCategories builders. SitesCategories *SitesCategoriesClient // 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.
Source Files ¶
- blocks.go
- blocks_create.go
- blocks_delete.go
- blocks_query.go
- blocks_update.go
- categories.go
- categories_create.go
- categories_delete.go
- categories_query.go
- categories_update.go
- client.go
- counter.go
- counter_create.go
- counter_delete.go
- counter_query.go
- counter_update.go
- ent.go
- generate.go
- isps.go
- isps_create.go
- isps_delete.go
- isps_query.go
- isps_update.go
- mutation.go
- runtime.go
- sites.go
- sites_create.go
- sites_delete.go
- sites_query.go
- sites_update.go
- sitescategories.go
- sitescategories_create.go
- sitescategories_delete.go
- sitescategories_query.go
- sitescategories_update.go
- tx.go