代码拉取完成,页面将自动刷新
// Code generated by ent, DO NOT EDIT.
package ent
import (
"context"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
"entgo.io/ent/schema/field"
"gitee.com/yuLingNet/simple-iot-data-rpc/ent/deviceupsterstatistics"
"gitee.com/yuLingNet/simple-iot-data-rpc/ent/predicate"
)
// DeviceUpsterStatisticsDelete is the builder for deleting a DeviceUpsterStatistics entity.
type DeviceUpsterStatisticsDelete struct {
config
hooks []Hook
mutation *DeviceUpsterStatisticsMutation
}
// Where appends a list predicates to the DeviceUpsterStatisticsDelete builder.
func (dusd *DeviceUpsterStatisticsDelete) Where(ps ...predicate.DeviceUpsterStatistics) *DeviceUpsterStatisticsDelete {
dusd.mutation.Where(ps...)
return dusd
}
// Exec executes the deletion query and returns how many vertices were deleted.
func (dusd *DeviceUpsterStatisticsDelete) Exec(ctx context.Context) (int, error) {
return withHooks(ctx, dusd.sqlExec, dusd.mutation, dusd.hooks)
}
// ExecX is like Exec, but panics if an error occurs.
func (dusd *DeviceUpsterStatisticsDelete) ExecX(ctx context.Context) int {
n, err := dusd.Exec(ctx)
if err != nil {
panic(err)
}
return n
}
func (dusd *DeviceUpsterStatisticsDelete) sqlExec(ctx context.Context) (int, error) {
_spec := sqlgraph.NewDeleteSpec(deviceupsterstatistics.Table, sqlgraph.NewFieldSpec(deviceupsterstatistics.FieldID, field.TypeUint64))
if ps := dusd.mutation.predicates; len(ps) > 0 {
_spec.Predicate = func(selector *sql.Selector) {
for i := range ps {
ps[i](selector)
}
}
}
affected, err := sqlgraph.DeleteNodes(ctx, dusd.driver, _spec)
if err != nil && sqlgraph.IsConstraintError(err) {
err = &ConstraintError{msg: err.Error(), wrap: err}
}
dusd.mutation.done = true
return affected, err
}
// DeviceUpsterStatisticsDeleteOne is the builder for deleting a single DeviceUpsterStatistics entity.
type DeviceUpsterStatisticsDeleteOne struct {
dusd *DeviceUpsterStatisticsDelete
}
// Where appends a list predicates to the DeviceUpsterStatisticsDelete builder.
func (dusdo *DeviceUpsterStatisticsDeleteOne) Where(ps ...predicate.DeviceUpsterStatistics) *DeviceUpsterStatisticsDeleteOne {
dusdo.dusd.mutation.Where(ps...)
return dusdo
}
// Exec executes the deletion query.
func (dusdo *DeviceUpsterStatisticsDeleteOne) Exec(ctx context.Context) error {
n, err := dusdo.dusd.Exec(ctx)
switch {
case err != nil:
return err
case n == 0:
return &NotFoundError{deviceupsterstatistics.Label}
default:
return nil
}
}
// ExecX is like Exec, but panics if an error occurs.
func (dusdo *DeviceUpsterStatisticsDeleteOne) ExecX(ctx context.Context) {
if err := dusdo.Exec(ctx); err != nil {
panic(err)
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。