[feature] migrate to monorepo
This commit is contained in:
commit
05ddc1f783
267 changed files with 75165 additions and 0 deletions
88
backend/ent/daily_delete.go
Normal file
88
backend/ent/daily_delete.go
Normal file
|
@ -0,0 +1,88 @@
|
|||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package ent
|
||||
|
||||
import (
|
||||
"context"
|
||||
"tss-rocks-be/ent/daily"
|
||||
"tss-rocks-be/ent/predicate"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
"entgo.io/ent/schema/field"
|
||||
)
|
||||
|
||||
// DailyDelete is the builder for deleting a Daily entity.
|
||||
type DailyDelete struct {
|
||||
config
|
||||
hooks []Hook
|
||||
mutation *DailyMutation
|
||||
}
|
||||
|
||||
// Where appends a list predicates to the DailyDelete builder.
|
||||
func (dd *DailyDelete) Where(ps ...predicate.Daily) *DailyDelete {
|
||||
dd.mutation.Where(ps...)
|
||||
return dd
|
||||
}
|
||||
|
||||
// Exec executes the deletion query and returns how many vertices were deleted.
|
||||
func (dd *DailyDelete) Exec(ctx context.Context) (int, error) {
|
||||
return withHooks(ctx, dd.sqlExec, dd.mutation, dd.hooks)
|
||||
}
|
||||
|
||||
// ExecX is like Exec, but panics if an error occurs.
|
||||
func (dd *DailyDelete) ExecX(ctx context.Context) int {
|
||||
n, err := dd.Exec(ctx)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func (dd *DailyDelete) sqlExec(ctx context.Context) (int, error) {
|
||||
_spec := sqlgraph.NewDeleteSpec(daily.Table, sqlgraph.NewFieldSpec(daily.FieldID, field.TypeString))
|
||||
if ps := dd.mutation.predicates; len(ps) > 0 {
|
||||
_spec.Predicate = func(selector *sql.Selector) {
|
||||
for i := range ps {
|
||||
ps[i](selector)
|
||||
}
|
||||
}
|
||||
}
|
||||
affected, err := sqlgraph.DeleteNodes(ctx, dd.driver, _spec)
|
||||
if err != nil && sqlgraph.IsConstraintError(err) {
|
||||
err = &ConstraintError{msg: err.Error(), wrap: err}
|
||||
}
|
||||
dd.mutation.done = true
|
||||
return affected, err
|
||||
}
|
||||
|
||||
// DailyDeleteOne is the builder for deleting a single Daily entity.
|
||||
type DailyDeleteOne struct {
|
||||
dd *DailyDelete
|
||||
}
|
||||
|
||||
// Where appends a list predicates to the DailyDelete builder.
|
||||
func (ddo *DailyDeleteOne) Where(ps ...predicate.Daily) *DailyDeleteOne {
|
||||
ddo.dd.mutation.Where(ps...)
|
||||
return ddo
|
||||
}
|
||||
|
||||
// Exec executes the deletion query.
|
||||
func (ddo *DailyDeleteOne) Exec(ctx context.Context) error {
|
||||
n, err := ddo.dd.Exec(ctx)
|
||||
switch {
|
||||
case err != nil:
|
||||
return err
|
||||
case n == 0:
|
||||
return &NotFoundError{daily.Label}
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// ExecX is like Exec, but panics if an error occurs.
|
||||
func (ddo *DailyDeleteOne) ExecX(ctx context.Context) {
|
||||
if err := ddo.Exec(ctx); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue