feat: update generated storage files

Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
This commit is contained in:
Mark Sagi-Kazar
2022-03-07 10:15:01 +01:00
parent 07a43f2d66
commit 20b03b3f6d
36 changed files with 747 additions and 437 deletions

View File

@@ -106,7 +106,7 @@ func (rtq *RefreshTokenQuery) FirstIDX(ctx context.Context) string {
}
// Only returns a single RefreshToken entity found by the query, ensuring it only returns one.
// Returns a *NotSingularError when exactly one RefreshToken entity is not found.
// Returns a *NotSingularError when more than one RefreshToken entity is found.
// Returns a *NotFoundError when no RefreshToken entities are found.
func (rtq *RefreshTokenQuery) Only(ctx context.Context) (*RefreshToken, error) {
nodes, err := rtq.Limit(2).All(ctx)
@@ -133,7 +133,7 @@ func (rtq *RefreshTokenQuery) OnlyX(ctx context.Context) *RefreshToken {
}
// OnlyID is like Only, but returns the only RefreshToken ID in the query.
// Returns a *NotSingularError when exactly one RefreshToken ID is not found.
// Returns a *NotSingularError when more than one RefreshToken ID is found.
// Returns a *NotFoundError when no entities are found.
func (rtq *RefreshTokenQuery) OnlyID(ctx context.Context) (id string, err error) {
var ids []string
@@ -242,8 +242,9 @@ func (rtq *RefreshTokenQuery) Clone() *RefreshTokenQuery {
order: append([]OrderFunc{}, rtq.order...),
predicates: append([]predicate.RefreshToken{}, rtq.predicates...),
// clone intermediate query.
sql: rtq.sql.Clone(),
path: rtq.path,
sql: rtq.sql.Clone(),
path: rtq.path,
unique: rtq.unique,
}
}
@@ -336,6 +337,10 @@ func (rtq *RefreshTokenQuery) sqlAll(ctx context.Context) ([]*RefreshToken, erro
func (rtq *RefreshTokenQuery) sqlCount(ctx context.Context) (int, error) {
_spec := rtq.querySpec()
_spec.Node.Columns = rtq.fields
if len(rtq.fields) > 0 {
_spec.Unique = rtq.unique != nil && *rtq.unique
}
return sqlgraph.CountNodes(ctx, rtq.driver, _spec)
}
@@ -407,6 +412,9 @@ func (rtq *RefreshTokenQuery) sqlQuery(ctx context.Context) *sql.Selector {
selector = rtq.sql
selector.Select(selector.Columns(columns...)...)
}
if rtq.unique != nil && *rtq.unique {
selector.Distinct()
}
for _, p := range rtq.predicates {
p(selector)
}
@@ -685,9 +693,7 @@ func (rtgb *RefreshTokenGroupBy) sqlQuery() *sql.Selector {
for _, f := range rtgb.fields {
columns = append(columns, selector.C(f))
}
for _, c := range aggregation {
columns = append(columns, c)
}
columns = append(columns, aggregation...)
selector.Select(columns...)
}
return selector.GroupBy(selector.Columns(rtgb.fields...)...)