forked from ALHP/ALHP.GO
Switched to parsing srcinfo with channels on all available cpus, speeding up srcinfo-parsing and queue generation by a lot. New memory-limit based building will max out the available memory while not building the same packages at the same time for different marchs, fixing some long-standing bugs like firefox not building at the same time because the same ports are used for profile-based optimization. This also drops the artificial delay on build-start, speeding up things even more. This also means there is no hard-coded limit on how many packages can be build at once anymore. As long as there is RAM available, builds will be started.
89 lines
2.3 KiB
Go
89 lines
2.3 KiB
Go
// 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"
|
|
"somegit.dev/ALHP/ALHP.GO/ent/dbpackage"
|
|
"somegit.dev/ALHP/ALHP.GO/ent/predicate"
|
|
)
|
|
|
|
// DbPackageDelete is the builder for deleting a DbPackage entity.
|
|
type DbPackageDelete struct {
|
|
config
|
|
hooks []Hook
|
|
mutation *DbPackageMutation
|
|
}
|
|
|
|
// Where appends a list predicates to the DbPackageDelete builder.
|
|
func (dpd *DbPackageDelete) Where(ps ...predicate.DbPackage) *DbPackageDelete {
|
|
dpd.mutation.Where(ps...)
|
|
return dpd
|
|
}
|
|
|
|
// Exec executes the deletion query and returns how many vertices were deleted.
|
|
func (dpd *DbPackageDelete) Exec(ctx context.Context) (int, error) {
|
|
return withHooks[int, DbPackageMutation](ctx, dpd.sqlExec, dpd.mutation, dpd.hooks)
|
|
}
|
|
|
|
// ExecX is like Exec, but panics if an error occurs.
|
|
func (dpd *DbPackageDelete) ExecX(ctx context.Context) int {
|
|
n, err := dpd.Exec(ctx)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (dpd *DbPackageDelete) sqlExec(ctx context.Context) (int, error) {
|
|
_spec := sqlgraph.NewDeleteSpec(dbpackage.Table, sqlgraph.NewFieldSpec(dbpackage.FieldID, field.TypeInt))
|
|
if ps := dpd.mutation.predicates; len(ps) > 0 {
|
|
_spec.Predicate = func(selector *sql.Selector) {
|
|
for i := range ps {
|
|
ps[i](selector)
|
|
}
|
|
}
|
|
}
|
|
affected, err := sqlgraph.DeleteNodes(ctx, dpd.driver, _spec)
|
|
if err != nil && sqlgraph.IsConstraintError(err) {
|
|
err = &ConstraintError{msg: err.Error(), wrap: err}
|
|
}
|
|
dpd.mutation.done = true
|
|
return affected, err
|
|
}
|
|
|
|
// DbPackageDeleteOne is the builder for deleting a single DbPackage entity.
|
|
type DbPackageDeleteOne struct {
|
|
dpd *DbPackageDelete
|
|
}
|
|
|
|
// Where appends a list predicates to the DbPackageDelete builder.
|
|
func (dpdo *DbPackageDeleteOne) Where(ps ...predicate.DbPackage) *DbPackageDeleteOne {
|
|
dpdo.dpd.mutation.Where(ps...)
|
|
return dpdo
|
|
}
|
|
|
|
// Exec executes the deletion query.
|
|
func (dpdo *DbPackageDeleteOne) Exec(ctx context.Context) error {
|
|
n, err := dpdo.dpd.Exec(ctx)
|
|
switch {
|
|
case err != nil:
|
|
return err
|
|
case n == 0:
|
|
return &NotFoundError{dbpackage.Label}
|
|
default:
|
|
return nil
|
|
}
|
|
}
|
|
|
|
// ExecX is like Exec, but panics if an error occurs.
|
|
func (dpdo *DbPackageDeleteOne) ExecX(ctx context.Context) {
|
|
if err := dpdo.Exec(ctx); err != nil {
|
|
panic(err)
|
|
}
|
|
}
|