updated deps; regen ent
This commit is contained in:
parent
401802e12d
commit
2af46109eb
@ -178,7 +178,7 @@ func (c *DbPackageClient) DeleteOne(dp *DbPackage) *DbPackageDeleteOne {
|
||||
return c.DeleteOneID(dp.ID)
|
||||
}
|
||||
|
||||
// DeleteOne returns a builder for deleting the given entity by its id.
|
||||
// DeleteOneID returns a builder for deleting the given entity by its id.
|
||||
func (c *DbPackageClient) DeleteOneID(id int) *DbPackageDeleteOne {
|
||||
builder := c.Delete().Where(dbpackage.ID(id))
|
||||
builder.mutation.id = &id
|
||||
|
@ -470,187 +470,95 @@ func (dpc *DbPackageCreate) createSpec() (*DbPackage, *sqlgraph.CreateSpec) {
|
||||
}
|
||||
)
|
||||
if value, ok := dpc.mutation.Pkgbase(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldPkgbase,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldPkgbase, field.TypeString, value)
|
||||
_node.Pkgbase = value
|
||||
}
|
||||
if value, ok := dpc.mutation.Packages(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeJSON,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldPackages,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldPackages, field.TypeJSON, value)
|
||||
_node.Packages = value
|
||||
}
|
||||
if value, ok := dpc.mutation.Status(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeEnum,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldStatus,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldStatus, field.TypeEnum, value)
|
||||
_node.Status = value
|
||||
}
|
||||
if value, ok := dpc.mutation.SkipReason(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldSkipReason,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldSkipReason, field.TypeString, value)
|
||||
_node.SkipReason = value
|
||||
}
|
||||
if value, ok := dpc.mutation.Repository(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeEnum,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldRepository,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldRepository, field.TypeEnum, value)
|
||||
_node.Repository = value
|
||||
}
|
||||
if value, ok := dpc.mutation.March(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldMarch,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldMarch, field.TypeString, value)
|
||||
_node.March = value
|
||||
}
|
||||
if value, ok := dpc.mutation.Version(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldVersion,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldVersion, field.TypeString, value)
|
||||
_node.Version = value
|
||||
}
|
||||
if value, ok := dpc.mutation.RepoVersion(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldRepoVersion,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldRepoVersion, field.TypeString, value)
|
||||
_node.RepoVersion = value
|
||||
}
|
||||
if value, ok := dpc.mutation.BuildTimeStart(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldBuildTimeStart,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldBuildTimeStart, field.TypeTime, value)
|
||||
_node.BuildTimeStart = value
|
||||
}
|
||||
if value, ok := dpc.mutation.Updated(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldUpdated,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldUpdated, field.TypeTime, value)
|
||||
_node.Updated = value
|
||||
}
|
||||
if value, ok := dpc.mutation.Hash(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldHash,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldHash, field.TypeString, value)
|
||||
_node.Hash = value
|
||||
}
|
||||
if value, ok := dpc.mutation.Lto(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeEnum,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldLto,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldLto, field.TypeEnum, value)
|
||||
_node.Lto = value
|
||||
}
|
||||
if value, ok := dpc.mutation.LastVersionBuild(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldLastVersionBuild,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldLastVersionBuild, field.TypeString, value)
|
||||
_node.LastVersionBuild = value
|
||||
}
|
||||
if value, ok := dpc.mutation.LastVerified(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldLastVerified,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldLastVerified, field.TypeTime, value)
|
||||
_node.LastVerified = value
|
||||
}
|
||||
if value, ok := dpc.mutation.DebugSymbols(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeEnum,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldDebugSymbols,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldDebugSymbols, field.TypeEnum, value)
|
||||
_node.DebugSymbols = value
|
||||
}
|
||||
if value, ok := dpc.mutation.MaxRss(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldMaxRss,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldMaxRss, field.TypeInt64, value)
|
||||
_node.MaxRss = &value
|
||||
}
|
||||
if value, ok := dpc.mutation.UTime(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldUTime,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldUTime, field.TypeInt64, value)
|
||||
_node.UTime = &value
|
||||
}
|
||||
if value, ok := dpc.mutation.STime(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldSTime,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldSTime, field.TypeInt64, value)
|
||||
_node.STime = &value
|
||||
}
|
||||
if value, ok := dpc.mutation.IoIn(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldIoIn,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldIoIn, field.TypeInt64, value)
|
||||
_node.IoIn = &value
|
||||
}
|
||||
if value, ok := dpc.mutation.IoOut(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldIoOut,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldIoOut, field.TypeInt64, value)
|
||||
_node.IoOut = &value
|
||||
}
|
||||
if value, ok := dpc.mutation.Srcinfo(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldSrcinfo,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldSrcinfo, field.TypeString, value)
|
||||
_node.Srcinfo = &value
|
||||
}
|
||||
if value, ok := dpc.mutation.SrcinfoHash(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldSrcinfoHash,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldSrcinfoHash, field.TypeString, value)
|
||||
_node.SrcinfoHash = value
|
||||
}
|
||||
if value, ok := dpc.mutation.Pkgbuild(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldPkgbuild,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldPkgbuild, field.TypeString, value)
|
||||
_node.Pkgbuild = value
|
||||
}
|
||||
return _node, _spec
|
||||
|
@ -296,6 +296,11 @@ func (dpq *DbPackageQuery) Select(fields ...string) *DbPackageSelect {
|
||||
return selbuild
|
||||
}
|
||||
|
||||
// Aggregate returns a DbPackageSelect configured with the given aggregations.
|
||||
func (dpq *DbPackageQuery) Aggregate(fns ...AggregateFunc) *DbPackageSelect {
|
||||
return dpq.Select().Aggregate(fns...)
|
||||
}
|
||||
|
||||
func (dpq *DbPackageQuery) prepareQuery(ctx context.Context) error {
|
||||
for _, f := range dpq.fields {
|
||||
if !dbpackage.ValidColumn(f) {
|
||||
@ -504,8 +509,6 @@ func (dpgb *DbPackageGroupBy) sqlQuery() *sql.Selector {
|
||||
for _, fn := range dpgb.fns {
|
||||
aggregation = append(aggregation, fn(selector))
|
||||
}
|
||||
// If no columns were selected in a custom aggregation function, the default
|
||||
// selection is the fields used for "group-by", and the aggregation functions.
|
||||
if len(selector.SelectedColumns()) == 0 {
|
||||
columns := make([]string, 0, len(dpgb.fields)+len(dpgb.fns))
|
||||
for _, f := range dpgb.fields {
|
||||
@ -525,6 +528,12 @@ type DbPackageSelect struct {
|
||||
sql *sql.Selector
|
||||
}
|
||||
|
||||
// Aggregate adds the given aggregation functions to the selector query.
|
||||
func (dps *DbPackageSelect) Aggregate(fns ...AggregateFunc) *DbPackageSelect {
|
||||
dps.fns = append(dps.fns, fns...)
|
||||
return dps
|
||||
}
|
||||
|
||||
// Scan applies the selector query and scans the result into the given value.
|
||||
func (dps *DbPackageSelect) Scan(ctx context.Context, v any) error {
|
||||
if err := dps.prepareQuery(ctx); err != nil {
|
||||
@ -535,6 +544,16 @@ func (dps *DbPackageSelect) Scan(ctx context.Context, v any) error {
|
||||
}
|
||||
|
||||
func (dps *DbPackageSelect) sqlScan(ctx context.Context, v any) error {
|
||||
aggregation := make([]string, 0, len(dps.fns))
|
||||
for _, fn := range dps.fns {
|
||||
aggregation = append(aggregation, fn(dps.sql))
|
||||
}
|
||||
switch n := len(*dps.selector.flds); {
|
||||
case n == 0 && len(aggregation) > 0:
|
||||
dps.sql.Select(aggregation...)
|
||||
case n != 0 && len(aggregation) > 0:
|
||||
dps.sql.AppendSelect(aggregation...)
|
||||
}
|
||||
rows := &sql.Rows{}
|
||||
query, args := dps.sql.Query()
|
||||
if err := dps.driver.Query(ctx, query, args, rows); err != nil {
|
||||
|
@ -10,6 +10,7 @@ import (
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
"entgo.io/ent/dialect/sql/sqljson"
|
||||
"entgo.io/ent/schema/field"
|
||||
"git.harting.dev/ALHP/ALHP.GO/ent/dbpackage"
|
||||
"git.harting.dev/ALHP/ALHP.GO/ent/predicate"
|
||||
@ -35,6 +36,12 @@ func (dpu *DbPackageUpdate) SetPackages(s []string) *DbPackageUpdate {
|
||||
return dpu
|
||||
}
|
||||
|
||||
// AppendPackages appends s to the "packages" field.
|
||||
func (dpu *DbPackageUpdate) AppendPackages(s []string) *DbPackageUpdate {
|
||||
dpu.mutation.AppendPackages(s)
|
||||
return dpu
|
||||
}
|
||||
|
||||
// ClearPackages clears the value of the "packages" field.
|
||||
func (dpu *DbPackageUpdate) ClearPackages() *DbPackageUpdate {
|
||||
dpu.mutation.ClearPackages()
|
||||
@ -577,308 +584,149 @@ func (dpu *DbPackageUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
}
|
||||
}
|
||||
if value, ok := dpu.mutation.Packages(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeJSON,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldPackages,
|
||||
_spec.SetField(dbpackage.FieldPackages, field.TypeJSON, value)
|
||||
}
|
||||
if value, ok := dpu.mutation.AppendedPackages(); ok {
|
||||
_spec.AddModifier(func(u *sql.UpdateBuilder) {
|
||||
sqljson.Append(u, dbpackage.FieldPackages, value)
|
||||
})
|
||||
}
|
||||
if dpu.mutation.PackagesCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeJSON,
|
||||
Column: dbpackage.FieldPackages,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldPackages, field.TypeJSON)
|
||||
}
|
||||
if value, ok := dpu.mutation.Status(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeEnum,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldStatus,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldStatus, field.TypeEnum, value)
|
||||
}
|
||||
if dpu.mutation.StatusCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeEnum,
|
||||
Column: dbpackage.FieldStatus,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldStatus, field.TypeEnum)
|
||||
}
|
||||
if value, ok := dpu.mutation.SkipReason(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldSkipReason,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldSkipReason, field.TypeString, value)
|
||||
}
|
||||
if dpu.mutation.SkipReasonCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: dbpackage.FieldSkipReason,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldSkipReason, field.TypeString)
|
||||
}
|
||||
if value, ok := dpu.mutation.Repository(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeEnum,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldRepository,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldRepository, field.TypeEnum, value)
|
||||
}
|
||||
if value, ok := dpu.mutation.Version(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldVersion,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldVersion, field.TypeString, value)
|
||||
}
|
||||
if dpu.mutation.VersionCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: dbpackage.FieldVersion,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldVersion, field.TypeString)
|
||||
}
|
||||
if value, ok := dpu.mutation.RepoVersion(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldRepoVersion,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldRepoVersion, field.TypeString, value)
|
||||
}
|
||||
if dpu.mutation.RepoVersionCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: dbpackage.FieldRepoVersion,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldRepoVersion, field.TypeString)
|
||||
}
|
||||
if value, ok := dpu.mutation.BuildTimeStart(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldBuildTimeStart,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldBuildTimeStart, field.TypeTime, value)
|
||||
}
|
||||
if dpu.mutation.BuildTimeStartCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Column: dbpackage.FieldBuildTimeStart,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldBuildTimeStart, field.TypeTime)
|
||||
}
|
||||
if value, ok := dpu.mutation.Updated(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldUpdated,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldUpdated, field.TypeTime, value)
|
||||
}
|
||||
if dpu.mutation.UpdatedCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Column: dbpackage.FieldUpdated,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldUpdated, field.TypeTime)
|
||||
}
|
||||
if value, ok := dpu.mutation.Hash(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldHash,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldHash, field.TypeString, value)
|
||||
}
|
||||
if dpu.mutation.HashCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: dbpackage.FieldHash,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldHash, field.TypeString)
|
||||
}
|
||||
if value, ok := dpu.mutation.Lto(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeEnum,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldLto,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldLto, field.TypeEnum, value)
|
||||
}
|
||||
if dpu.mutation.LtoCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeEnum,
|
||||
Column: dbpackage.FieldLto,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldLto, field.TypeEnum)
|
||||
}
|
||||
if value, ok := dpu.mutation.LastVersionBuild(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldLastVersionBuild,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldLastVersionBuild, field.TypeString, value)
|
||||
}
|
||||
if dpu.mutation.LastVersionBuildCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: dbpackage.FieldLastVersionBuild,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldLastVersionBuild, field.TypeString)
|
||||
}
|
||||
if value, ok := dpu.mutation.LastVerified(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldLastVerified,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldLastVerified, field.TypeTime, value)
|
||||
}
|
||||
if dpu.mutation.LastVerifiedCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Column: dbpackage.FieldLastVerified,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldLastVerified, field.TypeTime)
|
||||
}
|
||||
if value, ok := dpu.mutation.DebugSymbols(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeEnum,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldDebugSymbols,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldDebugSymbols, field.TypeEnum, value)
|
||||
}
|
||||
if dpu.mutation.DebugSymbolsCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeEnum,
|
||||
Column: dbpackage.FieldDebugSymbols,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldDebugSymbols, field.TypeEnum)
|
||||
}
|
||||
if value, ok := dpu.mutation.MaxRss(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldMaxRss,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldMaxRss, field.TypeInt64, value)
|
||||
}
|
||||
if value, ok := dpu.mutation.AddedMaxRss(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldMaxRss,
|
||||
})
|
||||
_spec.AddField(dbpackage.FieldMaxRss, field.TypeInt64, value)
|
||||
}
|
||||
if dpu.mutation.MaxRssCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Column: dbpackage.FieldMaxRss,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldMaxRss, field.TypeInt64)
|
||||
}
|
||||
if value, ok := dpu.mutation.UTime(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldUTime,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldUTime, field.TypeInt64, value)
|
||||
}
|
||||
if value, ok := dpu.mutation.AddedUTime(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldUTime,
|
||||
})
|
||||
_spec.AddField(dbpackage.FieldUTime, field.TypeInt64, value)
|
||||
}
|
||||
if dpu.mutation.UTimeCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Column: dbpackage.FieldUTime,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldUTime, field.TypeInt64)
|
||||
}
|
||||
if value, ok := dpu.mutation.STime(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldSTime,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldSTime, field.TypeInt64, value)
|
||||
}
|
||||
if value, ok := dpu.mutation.AddedSTime(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldSTime,
|
||||
})
|
||||
_spec.AddField(dbpackage.FieldSTime, field.TypeInt64, value)
|
||||
}
|
||||
if dpu.mutation.STimeCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Column: dbpackage.FieldSTime,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldSTime, field.TypeInt64)
|
||||
}
|
||||
if value, ok := dpu.mutation.IoIn(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldIoIn,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldIoIn, field.TypeInt64, value)
|
||||
}
|
||||
if value, ok := dpu.mutation.AddedIoIn(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldIoIn,
|
||||
})
|
||||
_spec.AddField(dbpackage.FieldIoIn, field.TypeInt64, value)
|
||||
}
|
||||
if dpu.mutation.IoInCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Column: dbpackage.FieldIoIn,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldIoIn, field.TypeInt64)
|
||||
}
|
||||
if value, ok := dpu.mutation.IoOut(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldIoOut,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldIoOut, field.TypeInt64, value)
|
||||
}
|
||||
if value, ok := dpu.mutation.AddedIoOut(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldIoOut,
|
||||
})
|
||||
_spec.AddField(dbpackage.FieldIoOut, field.TypeInt64, value)
|
||||
}
|
||||
if dpu.mutation.IoOutCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Column: dbpackage.FieldIoOut,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldIoOut, field.TypeInt64)
|
||||
}
|
||||
if value, ok := dpu.mutation.Srcinfo(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldSrcinfo,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldSrcinfo, field.TypeString, value)
|
||||
}
|
||||
if dpu.mutation.SrcinfoCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: dbpackage.FieldSrcinfo,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldSrcinfo, field.TypeString)
|
||||
}
|
||||
if value, ok := dpu.mutation.SrcinfoHash(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldSrcinfoHash,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldSrcinfoHash, field.TypeString, value)
|
||||
}
|
||||
if dpu.mutation.SrcinfoHashCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: dbpackage.FieldSrcinfoHash,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldSrcinfoHash, field.TypeString)
|
||||
}
|
||||
if value, ok := dpu.mutation.Pkgbuild(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldPkgbuild,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldPkgbuild, field.TypeString, value)
|
||||
}
|
||||
if dpu.mutation.PkgbuildCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: dbpackage.FieldPkgbuild,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldPkgbuild, field.TypeString)
|
||||
}
|
||||
_spec.Modifiers = dpu.modifiers
|
||||
_spec.AddModifiers(dpu.modifiers...)
|
||||
if n, err = sqlgraph.UpdateNodes(ctx, dpu.driver, _spec); err != nil {
|
||||
if _, ok := err.(*sqlgraph.NotFoundError); ok {
|
||||
err = &NotFoundError{dbpackage.Label}
|
||||
@ -905,6 +753,12 @@ func (dpuo *DbPackageUpdateOne) SetPackages(s []string) *DbPackageUpdateOne {
|
||||
return dpuo
|
||||
}
|
||||
|
||||
// AppendPackages appends s to the "packages" field.
|
||||
func (dpuo *DbPackageUpdateOne) AppendPackages(s []string) *DbPackageUpdateOne {
|
||||
dpuo.mutation.AppendPackages(s)
|
||||
return dpuo
|
||||
}
|
||||
|
||||
// ClearPackages clears the value of the "packages" field.
|
||||
func (dpuo *DbPackageUpdateOne) ClearPackages() *DbPackageUpdateOne {
|
||||
dpuo.mutation.ClearPackages()
|
||||
@ -1477,308 +1331,149 @@ func (dpuo *DbPackageUpdateOne) sqlSave(ctx context.Context) (_node *DbPackage,
|
||||
}
|
||||
}
|
||||
if value, ok := dpuo.mutation.Packages(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeJSON,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldPackages,
|
||||
_spec.SetField(dbpackage.FieldPackages, field.TypeJSON, value)
|
||||
}
|
||||
if value, ok := dpuo.mutation.AppendedPackages(); ok {
|
||||
_spec.AddModifier(func(u *sql.UpdateBuilder) {
|
||||
sqljson.Append(u, dbpackage.FieldPackages, value)
|
||||
})
|
||||
}
|
||||
if dpuo.mutation.PackagesCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeJSON,
|
||||
Column: dbpackage.FieldPackages,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldPackages, field.TypeJSON)
|
||||
}
|
||||
if value, ok := dpuo.mutation.Status(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeEnum,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldStatus,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldStatus, field.TypeEnum, value)
|
||||
}
|
||||
if dpuo.mutation.StatusCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeEnum,
|
||||
Column: dbpackage.FieldStatus,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldStatus, field.TypeEnum)
|
||||
}
|
||||
if value, ok := dpuo.mutation.SkipReason(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldSkipReason,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldSkipReason, field.TypeString, value)
|
||||
}
|
||||
if dpuo.mutation.SkipReasonCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: dbpackage.FieldSkipReason,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldSkipReason, field.TypeString)
|
||||
}
|
||||
if value, ok := dpuo.mutation.Repository(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeEnum,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldRepository,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldRepository, field.TypeEnum, value)
|
||||
}
|
||||
if value, ok := dpuo.mutation.Version(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldVersion,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldVersion, field.TypeString, value)
|
||||
}
|
||||
if dpuo.mutation.VersionCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: dbpackage.FieldVersion,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldVersion, field.TypeString)
|
||||
}
|
||||
if value, ok := dpuo.mutation.RepoVersion(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldRepoVersion,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldRepoVersion, field.TypeString, value)
|
||||
}
|
||||
if dpuo.mutation.RepoVersionCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: dbpackage.FieldRepoVersion,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldRepoVersion, field.TypeString)
|
||||
}
|
||||
if value, ok := dpuo.mutation.BuildTimeStart(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldBuildTimeStart,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldBuildTimeStart, field.TypeTime, value)
|
||||
}
|
||||
if dpuo.mutation.BuildTimeStartCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Column: dbpackage.FieldBuildTimeStart,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldBuildTimeStart, field.TypeTime)
|
||||
}
|
||||
if value, ok := dpuo.mutation.Updated(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldUpdated,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldUpdated, field.TypeTime, value)
|
||||
}
|
||||
if dpuo.mutation.UpdatedCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Column: dbpackage.FieldUpdated,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldUpdated, field.TypeTime)
|
||||
}
|
||||
if value, ok := dpuo.mutation.Hash(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldHash,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldHash, field.TypeString, value)
|
||||
}
|
||||
if dpuo.mutation.HashCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: dbpackage.FieldHash,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldHash, field.TypeString)
|
||||
}
|
||||
if value, ok := dpuo.mutation.Lto(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeEnum,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldLto,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldLto, field.TypeEnum, value)
|
||||
}
|
||||
if dpuo.mutation.LtoCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeEnum,
|
||||
Column: dbpackage.FieldLto,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldLto, field.TypeEnum)
|
||||
}
|
||||
if value, ok := dpuo.mutation.LastVersionBuild(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldLastVersionBuild,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldLastVersionBuild, field.TypeString, value)
|
||||
}
|
||||
if dpuo.mutation.LastVersionBuildCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: dbpackage.FieldLastVersionBuild,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldLastVersionBuild, field.TypeString)
|
||||
}
|
||||
if value, ok := dpuo.mutation.LastVerified(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldLastVerified,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldLastVerified, field.TypeTime, value)
|
||||
}
|
||||
if dpuo.mutation.LastVerifiedCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Column: dbpackage.FieldLastVerified,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldLastVerified, field.TypeTime)
|
||||
}
|
||||
if value, ok := dpuo.mutation.DebugSymbols(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeEnum,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldDebugSymbols,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldDebugSymbols, field.TypeEnum, value)
|
||||
}
|
||||
if dpuo.mutation.DebugSymbolsCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeEnum,
|
||||
Column: dbpackage.FieldDebugSymbols,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldDebugSymbols, field.TypeEnum)
|
||||
}
|
||||
if value, ok := dpuo.mutation.MaxRss(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldMaxRss,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldMaxRss, field.TypeInt64, value)
|
||||
}
|
||||
if value, ok := dpuo.mutation.AddedMaxRss(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldMaxRss,
|
||||
})
|
||||
_spec.AddField(dbpackage.FieldMaxRss, field.TypeInt64, value)
|
||||
}
|
||||
if dpuo.mutation.MaxRssCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Column: dbpackage.FieldMaxRss,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldMaxRss, field.TypeInt64)
|
||||
}
|
||||
if value, ok := dpuo.mutation.UTime(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldUTime,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldUTime, field.TypeInt64, value)
|
||||
}
|
||||
if value, ok := dpuo.mutation.AddedUTime(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldUTime,
|
||||
})
|
||||
_spec.AddField(dbpackage.FieldUTime, field.TypeInt64, value)
|
||||
}
|
||||
if dpuo.mutation.UTimeCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Column: dbpackage.FieldUTime,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldUTime, field.TypeInt64)
|
||||
}
|
||||
if value, ok := dpuo.mutation.STime(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldSTime,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldSTime, field.TypeInt64, value)
|
||||
}
|
||||
if value, ok := dpuo.mutation.AddedSTime(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldSTime,
|
||||
})
|
||||
_spec.AddField(dbpackage.FieldSTime, field.TypeInt64, value)
|
||||
}
|
||||
if dpuo.mutation.STimeCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Column: dbpackage.FieldSTime,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldSTime, field.TypeInt64)
|
||||
}
|
||||
if value, ok := dpuo.mutation.IoIn(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldIoIn,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldIoIn, field.TypeInt64, value)
|
||||
}
|
||||
if value, ok := dpuo.mutation.AddedIoIn(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldIoIn,
|
||||
})
|
||||
_spec.AddField(dbpackage.FieldIoIn, field.TypeInt64, value)
|
||||
}
|
||||
if dpuo.mutation.IoInCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Column: dbpackage.FieldIoIn,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldIoIn, field.TypeInt64)
|
||||
}
|
||||
if value, ok := dpuo.mutation.IoOut(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldIoOut,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldIoOut, field.TypeInt64, value)
|
||||
}
|
||||
if value, ok := dpuo.mutation.AddedIoOut(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldIoOut,
|
||||
})
|
||||
_spec.AddField(dbpackage.FieldIoOut, field.TypeInt64, value)
|
||||
}
|
||||
if dpuo.mutation.IoOutCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt64,
|
||||
Column: dbpackage.FieldIoOut,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldIoOut, field.TypeInt64)
|
||||
}
|
||||
if value, ok := dpuo.mutation.Srcinfo(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldSrcinfo,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldSrcinfo, field.TypeString, value)
|
||||
}
|
||||
if dpuo.mutation.SrcinfoCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: dbpackage.FieldSrcinfo,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldSrcinfo, field.TypeString)
|
||||
}
|
||||
if value, ok := dpuo.mutation.SrcinfoHash(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldSrcinfoHash,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldSrcinfoHash, field.TypeString, value)
|
||||
}
|
||||
if dpuo.mutation.SrcinfoHashCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: dbpackage.FieldSrcinfoHash,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldSrcinfoHash, field.TypeString)
|
||||
}
|
||||
if value, ok := dpuo.mutation.Pkgbuild(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: dbpackage.FieldPkgbuild,
|
||||
})
|
||||
_spec.SetField(dbpackage.FieldPkgbuild, field.TypeString, value)
|
||||
}
|
||||
if dpuo.mutation.PkgbuildCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: dbpackage.FieldPkgbuild,
|
||||
})
|
||||
_spec.ClearField(dbpackage.FieldPkgbuild, field.TypeString)
|
||||
}
|
||||
_spec.Modifiers = dpuo.modifiers
|
||||
_spec.AddModifiers(dpuo.modifiers...)
|
||||
_node = &DbPackage{config: dpuo.config}
|
||||
_spec.Assign = _node.assignValues
|
||||
_spec.ScanValues = _node.scanValues
|
||||
|
@ -263,6 +263,7 @@ func IsConstraintError(err error) bool {
|
||||
type selector struct {
|
||||
label string
|
||||
flds *[]string
|
||||
fns []AggregateFunc
|
||||
scan func(context.Context, any) error
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,7 @@ type DbPackageMutation struct {
|
||||
id *int
|
||||
pkgbase *string
|
||||
packages *[]string
|
||||
appendpackages []string
|
||||
status *dbpackage.Status
|
||||
skip_reason *string
|
||||
repository *dbpackage.Repository
|
||||
@ -204,6 +205,7 @@ func (m *DbPackageMutation) ResetPkgbase() {
|
||||
// SetPackages sets the "packages" field.
|
||||
func (m *DbPackageMutation) SetPackages(s []string) {
|
||||
m.packages = &s
|
||||
m.appendpackages = nil
|
||||
}
|
||||
|
||||
// Packages returns the value of the "packages" field in the mutation.
|
||||
@ -232,9 +234,23 @@ func (m *DbPackageMutation) OldPackages(ctx context.Context) (v []string, err er
|
||||
return oldValue.Packages, nil
|
||||
}
|
||||
|
||||
// AppendPackages adds s to the "packages" field.
|
||||
func (m *DbPackageMutation) AppendPackages(s []string) {
|
||||
m.appendpackages = append(m.appendpackages, s...)
|
||||
}
|
||||
|
||||
// AppendedPackages returns the list of values that were appended to the "packages" field in this mutation.
|
||||
func (m *DbPackageMutation) AppendedPackages() ([]string, bool) {
|
||||
if len(m.appendpackages) == 0 {
|
||||
return nil, false
|
||||
}
|
||||
return m.appendpackages, true
|
||||
}
|
||||
|
||||
// ClearPackages clears the value of the "packages" field.
|
||||
func (m *DbPackageMutation) ClearPackages() {
|
||||
m.packages = nil
|
||||
m.appendpackages = nil
|
||||
m.clearedFields[dbpackage.FieldPackages] = struct{}{}
|
||||
}
|
||||
|
||||
@ -247,6 +263,7 @@ func (m *DbPackageMutation) PackagesCleared() bool {
|
||||
// ResetPackages resets all changes to the "packages" field.
|
||||
func (m *DbPackageMutation) ResetPackages() {
|
||||
m.packages = nil
|
||||
m.appendpackages = nil
|
||||
delete(m.clearedFields, dbpackage.FieldPackages)
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,6 @@ package runtime
|
||||
// The schema-stitching logic is generated in git.harting.dev/ALHP/ALHP.GO/ent/runtime.go
|
||||
|
||||
const (
|
||||
Version = "v0.11.3" // Version of ent codegen.
|
||||
Sum = "h1:F5FBGAWiDCGder7YT+lqMnyzXl6d0xU3xMBM/SO3CMc=" // Sum of ent codegen.
|
||||
Version = "v0.11.4" // Version of ent codegen.
|
||||
Sum = "h1:grwVY0fp31BZ6oEo3YrXenAuv8VJmEw7F/Bi6WqeH3Q=" // Sum of ent codegen.
|
||||
)
|
||||
|
36
ent/tx.go
36
ent/tx.go
@ -18,12 +18,6 @@ type Tx struct {
|
||||
// lazily loaded.
|
||||
client *Client
|
||||
clientOnce sync.Once
|
||||
|
||||
// completion callbacks.
|
||||
mu sync.Mutex
|
||||
onCommit []CommitHook
|
||||
onRollback []RollbackHook
|
||||
|
||||
// ctx lives for the life of the transaction. It is
|
||||
// the same context used by the underlying connection.
|
||||
ctx context.Context
|
||||
@ -68,9 +62,9 @@ func (tx *Tx) Commit() error {
|
||||
var fn Committer = CommitFunc(func(context.Context, *Tx) error {
|
||||
return txDriver.tx.Commit()
|
||||
})
|
||||
tx.mu.Lock()
|
||||
hooks := append([]CommitHook(nil), tx.onCommit...)
|
||||
tx.mu.Unlock()
|
||||
txDriver.mu.Lock()
|
||||
hooks := append([]CommitHook(nil), txDriver.onCommit...)
|
||||
txDriver.mu.Unlock()
|
||||
for i := len(hooks) - 1; i >= 0; i-- {
|
||||
fn = hooks[i](fn)
|
||||
}
|
||||
@ -79,9 +73,10 @@ func (tx *Tx) Commit() error {
|
||||
|
||||
// OnCommit adds a hook to call on commit.
|
||||
func (tx *Tx) OnCommit(f CommitHook) {
|
||||
tx.mu.Lock()
|
||||
defer tx.mu.Unlock()
|
||||
tx.onCommit = append(tx.onCommit, f)
|
||||
txDriver := tx.config.driver.(*txDriver)
|
||||
txDriver.mu.Lock()
|
||||
txDriver.onCommit = append(txDriver.onCommit, f)
|
||||
txDriver.mu.Unlock()
|
||||
}
|
||||
|
||||
type (
|
||||
@ -123,9 +118,9 @@ func (tx *Tx) Rollback() error {
|
||||
var fn Rollbacker = RollbackFunc(func(context.Context, *Tx) error {
|
||||
return txDriver.tx.Rollback()
|
||||
})
|
||||
tx.mu.Lock()
|
||||
hooks := append([]RollbackHook(nil), tx.onRollback...)
|
||||
tx.mu.Unlock()
|
||||
txDriver.mu.Lock()
|
||||
hooks := append([]RollbackHook(nil), txDriver.onRollback...)
|
||||
txDriver.mu.Unlock()
|
||||
for i := len(hooks) - 1; i >= 0; i-- {
|
||||
fn = hooks[i](fn)
|
||||
}
|
||||
@ -134,9 +129,10 @@ func (tx *Tx) Rollback() error {
|
||||
|
||||
// OnRollback adds a hook to call on rollback.
|
||||
func (tx *Tx) OnRollback(f RollbackHook) {
|
||||
tx.mu.Lock()
|
||||
defer tx.mu.Unlock()
|
||||
tx.onRollback = append(tx.onRollback, f)
|
||||
txDriver := tx.config.driver.(*txDriver)
|
||||
txDriver.mu.Lock()
|
||||
txDriver.onRollback = append(txDriver.onRollback, f)
|
||||
txDriver.mu.Unlock()
|
||||
}
|
||||
|
||||
// Client returns a Client that binds to current transaction.
|
||||
@ -168,6 +164,10 @@ type txDriver struct {
|
||||
drv dialect.Driver
|
||||
// tx is the underlying transaction.
|
||||
tx dialect.Tx
|
||||
// completion hooks.
|
||||
mu sync.Mutex
|
||||
onCommit []CommitHook
|
||||
onRollback []RollbackHook
|
||||
}
|
||||
|
||||
// newTx creates a new transactional driver.
|
||||
|
2
go.mod
2
go.mod
@ -3,7 +3,7 @@ module git.harting.dev/ALHP/ALHP.GO
|
||||
go 1.18
|
||||
|
||||
require (
|
||||
entgo.io/ent v0.11.3
|
||||
entgo.io/ent v0.11.4
|
||||
github.com/Jguer/go-alpm/v2 v2.1.2
|
||||
github.com/Morganamilo/go-pacmanconf v0.0.0-20210502114700-cff030e927a5
|
||||
github.com/Morganamilo/go-srcinfo v1.0.0
|
||||
|
6
go.sum
6
go.sum
@ -1,7 +1,7 @@
|
||||
ariga.io/atlas v0.8.1 h1:eTZS+qyBpqMTkCbatFquYXIqGPAIEzjQzkVXlOwkcEY=
|
||||
ariga.io/atlas v0.8.1/go.mod h1:ft47uSh5hWGDCmQC9DsztZg6Xk+KagM5Ts/mZYKb9JE=
|
||||
entgo.io/ent v0.11.3 h1:F5FBGAWiDCGder7YT+lqMnyzXl6d0xU3xMBM/SO3CMc=
|
||||
entgo.io/ent v0.11.3/go.mod h1:mvDhvynOzAsOe7anH7ynPPtMjA/eeXP96kAfweevyxc=
|
||||
entgo.io/ent v0.11.4 h1:grwVY0fp31BZ6oEo3YrXenAuv8VJmEw7F/Bi6WqeH3Q=
|
||||
entgo.io/ent v0.11.4/go.mod h1:fnQIXL36RYnCk/9nvG4aE7YHBFZhCycfh7wMjY5p7SE=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60=
|
||||
github.com/Jguer/go-alpm/v2 v2.1.2 h1:CGTIxzuEpT9Q3a7IBrx0E6acoYoaHX2Z93UOApPDhgU=
|
||||
@ -112,7 +112,7 @@ github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope
|
||||
github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||
github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/mattn/go-sqlite3 v1.14.15 h1:vfoHhTN1af61xCRSWzFIWzx2YskyMTwHLrExkBOjvxI=
|
||||
github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y=
|
||||
github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0=
|
||||
github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0=
|
||||
github.com/otiai10/copy v1.7.0 h1:hVoPiN+t+7d2nzzwMiDHPSOogsWAStewq3TwU05+clE=
|
||||
|
Loading…
Reference in New Issue
Block a user