1
0
forked from ALHP/ALHP.GO

updated deps; regen ent

This commit is contained in:
2023-05-07 15:12:35 +02:00
parent 04f4efcfae
commit 302180011e
10 changed files with 192 additions and 74 deletions

View File

@@ -8,6 +8,7 @@ import (
"strings"
"time"
"entgo.io/ent"
"entgo.io/ent/dialect/sql"
"somegit.dev/ALHP/ALHP.GO/ent/dbpackage"
)
@@ -62,7 +63,8 @@ type DbPackage struct {
// SrcinfoHash holds the value of the "srcinfo_hash" field.
SrcinfoHash string `json:"srcinfo_hash,omitempty"`
// Pkgbuild holds the value of the "pkgbuild" field.
Pkgbuild string `json:"pkgbuild,omitempty"`
Pkgbuild string `json:"pkgbuild,omitempty"`
selectValues sql.SelectValues
}
// scanValues returns the types for scanning values from sql.Rows.
@@ -79,7 +81,7 @@ func (*DbPackage) scanValues(columns []string) ([]any, error) {
case dbpackage.FieldBuildTimeStart, dbpackage.FieldUpdated, dbpackage.FieldLastVerified:
values[i] = new(sql.NullTime)
default:
return nil, fmt.Errorf("unexpected column %q for type DbPackage", columns[i])
values[i] = new(sql.UnknownType)
}
}
return values, nil
@@ -245,11 +247,19 @@ func (dp *DbPackage) assignValues(columns []string, values []any) error {
} else if value.Valid {
dp.Pkgbuild = value.String
}
default:
dp.selectValues.Set(columns[i], values[i])
}
}
return nil
}
// Value returns the ent.Value that was dynamically selected and assigned to the DbPackage.
// This includes values selected through modifiers, order, etc.
func (dp *DbPackage) Value(name string) (ent.Value, error) {
return dp.selectValues.Get(name)
}
// Update returns a builder for updating this DbPackage.
// Note that you need to call DbPackage.Unwrap() before calling this method if this DbPackage
// was returned from a transaction, and the transaction was committed or rolled back.