mirror of
https://github.com/netbirdio/dex.git
synced 2026-05-22 18:43:53 -07:00
Bump ent v0.14.0 (#3670)
Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
This commit is contained in:
@@ -4,7 +4,7 @@ go 1.21
|
||||
|
||||
require (
|
||||
cloud.google.com/go/compute/metadata v0.5.0
|
||||
entgo.io/ent v0.13.1
|
||||
entgo.io/ent v0.14.0
|
||||
github.com/AppsFlyer/go-sundheit v0.6.0
|
||||
github.com/Masterminds/semver v1.5.0
|
||||
github.com/Masterminds/sprig/v3 v3.2.3
|
||||
|
||||
@@ -7,8 +7,8 @@ cloud.google.com/go/auth/oauth2adapt v0.2.3 h1:MlxF+Pd3OmSudg/b1yZ5lJwoXCEaeedAg
|
||||
cloud.google.com/go/auth/oauth2adapt v0.2.3/go.mod h1:tMQXOfZzFuNuUxOypHlQEXgdfX5cuhwU+ffUuXRJE8I=
|
||||
cloud.google.com/go/compute/metadata v0.5.0 h1:Zr0eK8JbFv6+Wi4ilXAR8FJ3wyNdpxHKJNPos6LTZOY=
|
||||
cloud.google.com/go/compute/metadata v0.5.0/go.mod h1:aHnloV2TPI38yx4s9+wAZhHykWvVCfu7hQbF+9CWoiY=
|
||||
entgo.io/ent v0.13.1 h1:uD8QwN1h6SNphdCCzmkMN3feSUzNnVvV/WIkHKMbzOE=
|
||||
entgo.io/ent v0.13.1/go.mod h1:qCEmo+biw3ccBn9OyL4ZK5dfpwg++l1Gxwac5B1206A=
|
||||
entgo.io/ent v0.14.0 h1:EO3Z9aZ5bXJatJeGqu/EVdnNr6K4mRq3rWe5owt0MC4=
|
||||
entgo.io/ent v0.14.0/go.mod h1:qCEmo+biw3ccBn9OyL4ZK5dfpwg++l1Gxwac5B1206A=
|
||||
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
|
||||
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
|
||||
github.com/AppsFlyer/go-sundheit v0.6.0 h1:d2hBvCjBSb2lUsEWGfPigr4MCOt04sxB+Rppl0yUMSk=
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"math"
|
||||
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
"entgo.io/ent/schema/field"
|
||||
@@ -60,7 +61,7 @@ func (acq *AuthCodeQuery) Order(o ...authcode.OrderOption) *AuthCodeQuery {
|
||||
// First returns the first AuthCode entity from the query.
|
||||
// Returns a *NotFoundError when no AuthCode was found.
|
||||
func (acq *AuthCodeQuery) First(ctx context.Context) (*AuthCode, error) {
|
||||
nodes, err := acq.Limit(1).All(setContextOp(ctx, acq.ctx, "First"))
|
||||
nodes, err := acq.Limit(1).All(setContextOp(ctx, acq.ctx, ent.OpQueryFirst))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -83,7 +84,7 @@ func (acq *AuthCodeQuery) FirstX(ctx context.Context) *AuthCode {
|
||||
// Returns a *NotFoundError when no AuthCode ID was found.
|
||||
func (acq *AuthCodeQuery) FirstID(ctx context.Context) (id string, err error) {
|
||||
var ids []string
|
||||
if ids, err = acq.Limit(1).IDs(setContextOp(ctx, acq.ctx, "FirstID")); err != nil {
|
||||
if ids, err = acq.Limit(1).IDs(setContextOp(ctx, acq.ctx, ent.OpQueryFirstID)); err != nil {
|
||||
return
|
||||
}
|
||||
if len(ids) == 0 {
|
||||
@@ -106,7 +107,7 @@ func (acq *AuthCodeQuery) FirstIDX(ctx context.Context) string {
|
||||
// Returns a *NotSingularError when more than one AuthCode entity is found.
|
||||
// Returns a *NotFoundError when no AuthCode entities are found.
|
||||
func (acq *AuthCodeQuery) Only(ctx context.Context) (*AuthCode, error) {
|
||||
nodes, err := acq.Limit(2).All(setContextOp(ctx, acq.ctx, "Only"))
|
||||
nodes, err := acq.Limit(2).All(setContextOp(ctx, acq.ctx, ent.OpQueryOnly))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -134,7 +135,7 @@ func (acq *AuthCodeQuery) OnlyX(ctx context.Context) *AuthCode {
|
||||
// Returns a *NotFoundError when no entities are found.
|
||||
func (acq *AuthCodeQuery) OnlyID(ctx context.Context) (id string, err error) {
|
||||
var ids []string
|
||||
if ids, err = acq.Limit(2).IDs(setContextOp(ctx, acq.ctx, "OnlyID")); err != nil {
|
||||
if ids, err = acq.Limit(2).IDs(setContextOp(ctx, acq.ctx, ent.OpQueryOnlyID)); err != nil {
|
||||
return
|
||||
}
|
||||
switch len(ids) {
|
||||
@@ -159,7 +160,7 @@ func (acq *AuthCodeQuery) OnlyIDX(ctx context.Context) string {
|
||||
|
||||
// All executes the query and returns a list of AuthCodes.
|
||||
func (acq *AuthCodeQuery) All(ctx context.Context) ([]*AuthCode, error) {
|
||||
ctx = setContextOp(ctx, acq.ctx, "All")
|
||||
ctx = setContextOp(ctx, acq.ctx, ent.OpQueryAll)
|
||||
if err := acq.prepareQuery(ctx); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -181,7 +182,7 @@ func (acq *AuthCodeQuery) IDs(ctx context.Context) (ids []string, err error) {
|
||||
if acq.ctx.Unique == nil && acq.path != nil {
|
||||
acq.Unique(true)
|
||||
}
|
||||
ctx = setContextOp(ctx, acq.ctx, "IDs")
|
||||
ctx = setContextOp(ctx, acq.ctx, ent.OpQueryIDs)
|
||||
if err = acq.Select(authcode.FieldID).Scan(ctx, &ids); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -199,7 +200,7 @@ func (acq *AuthCodeQuery) IDsX(ctx context.Context) []string {
|
||||
|
||||
// Count returns the count of the given query.
|
||||
func (acq *AuthCodeQuery) Count(ctx context.Context) (int, error) {
|
||||
ctx = setContextOp(ctx, acq.ctx, "Count")
|
||||
ctx = setContextOp(ctx, acq.ctx, ent.OpQueryCount)
|
||||
if err := acq.prepareQuery(ctx); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@@ -217,7 +218,7 @@ func (acq *AuthCodeQuery) CountX(ctx context.Context) int {
|
||||
|
||||
// Exist returns true if the query has elements in the graph.
|
||||
func (acq *AuthCodeQuery) Exist(ctx context.Context) (bool, error) {
|
||||
ctx = setContextOp(ctx, acq.ctx, "Exist")
|
||||
ctx = setContextOp(ctx, acq.ctx, ent.OpQueryExist)
|
||||
switch _, err := acq.FirstID(ctx); {
|
||||
case IsNotFound(err):
|
||||
return false, nil
|
||||
@@ -449,7 +450,7 @@ func (acgb *AuthCodeGroupBy) Aggregate(fns ...AggregateFunc) *AuthCodeGroupBy {
|
||||
|
||||
// Scan applies the selector query and scans the result into the given value.
|
||||
func (acgb *AuthCodeGroupBy) Scan(ctx context.Context, v any) error {
|
||||
ctx = setContextOp(ctx, acgb.build.ctx, "GroupBy")
|
||||
ctx = setContextOp(ctx, acgb.build.ctx, ent.OpQueryGroupBy)
|
||||
if err := acgb.build.prepareQuery(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -497,7 +498,7 @@ func (acs *AuthCodeSelect) Aggregate(fns ...AggregateFunc) *AuthCodeSelect {
|
||||
|
||||
// Scan applies the selector query and scans the result into the given value.
|
||||
func (acs *AuthCodeSelect) Scan(ctx context.Context, v any) error {
|
||||
ctx = setContextOp(ctx, acs.ctx, "Select")
|
||||
ctx = setContextOp(ctx, acs.ctx, ent.OpQuerySelect)
|
||||
if err := acs.prepareQuery(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"math"
|
||||
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
"entgo.io/ent/schema/field"
|
||||
@@ -60,7 +61,7 @@ func (arq *AuthRequestQuery) Order(o ...authrequest.OrderOption) *AuthRequestQue
|
||||
// First returns the first AuthRequest entity from the query.
|
||||
// Returns a *NotFoundError when no AuthRequest was found.
|
||||
func (arq *AuthRequestQuery) First(ctx context.Context) (*AuthRequest, error) {
|
||||
nodes, err := arq.Limit(1).All(setContextOp(ctx, arq.ctx, "First"))
|
||||
nodes, err := arq.Limit(1).All(setContextOp(ctx, arq.ctx, ent.OpQueryFirst))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -83,7 +84,7 @@ func (arq *AuthRequestQuery) FirstX(ctx context.Context) *AuthRequest {
|
||||
// Returns a *NotFoundError when no AuthRequest ID was found.
|
||||
func (arq *AuthRequestQuery) FirstID(ctx context.Context) (id string, err error) {
|
||||
var ids []string
|
||||
if ids, err = arq.Limit(1).IDs(setContextOp(ctx, arq.ctx, "FirstID")); err != nil {
|
||||
if ids, err = arq.Limit(1).IDs(setContextOp(ctx, arq.ctx, ent.OpQueryFirstID)); err != nil {
|
||||
return
|
||||
}
|
||||
if len(ids) == 0 {
|
||||
@@ -106,7 +107,7 @@ func (arq *AuthRequestQuery) FirstIDX(ctx context.Context) string {
|
||||
// Returns a *NotSingularError when more than one AuthRequest entity is found.
|
||||
// Returns a *NotFoundError when no AuthRequest entities are found.
|
||||
func (arq *AuthRequestQuery) Only(ctx context.Context) (*AuthRequest, error) {
|
||||
nodes, err := arq.Limit(2).All(setContextOp(ctx, arq.ctx, "Only"))
|
||||
nodes, err := arq.Limit(2).All(setContextOp(ctx, arq.ctx, ent.OpQueryOnly))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -134,7 +135,7 @@ func (arq *AuthRequestQuery) OnlyX(ctx context.Context) *AuthRequest {
|
||||
// Returns a *NotFoundError when no entities are found.
|
||||
func (arq *AuthRequestQuery) OnlyID(ctx context.Context) (id string, err error) {
|
||||
var ids []string
|
||||
if ids, err = arq.Limit(2).IDs(setContextOp(ctx, arq.ctx, "OnlyID")); err != nil {
|
||||
if ids, err = arq.Limit(2).IDs(setContextOp(ctx, arq.ctx, ent.OpQueryOnlyID)); err != nil {
|
||||
return
|
||||
}
|
||||
switch len(ids) {
|
||||
@@ -159,7 +160,7 @@ func (arq *AuthRequestQuery) OnlyIDX(ctx context.Context) string {
|
||||
|
||||
// All executes the query and returns a list of AuthRequests.
|
||||
func (arq *AuthRequestQuery) All(ctx context.Context) ([]*AuthRequest, error) {
|
||||
ctx = setContextOp(ctx, arq.ctx, "All")
|
||||
ctx = setContextOp(ctx, arq.ctx, ent.OpQueryAll)
|
||||
if err := arq.prepareQuery(ctx); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -181,7 +182,7 @@ func (arq *AuthRequestQuery) IDs(ctx context.Context) (ids []string, err error)
|
||||
if arq.ctx.Unique == nil && arq.path != nil {
|
||||
arq.Unique(true)
|
||||
}
|
||||
ctx = setContextOp(ctx, arq.ctx, "IDs")
|
||||
ctx = setContextOp(ctx, arq.ctx, ent.OpQueryIDs)
|
||||
if err = arq.Select(authrequest.FieldID).Scan(ctx, &ids); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -199,7 +200,7 @@ func (arq *AuthRequestQuery) IDsX(ctx context.Context) []string {
|
||||
|
||||
// Count returns the count of the given query.
|
||||
func (arq *AuthRequestQuery) Count(ctx context.Context) (int, error) {
|
||||
ctx = setContextOp(ctx, arq.ctx, "Count")
|
||||
ctx = setContextOp(ctx, arq.ctx, ent.OpQueryCount)
|
||||
if err := arq.prepareQuery(ctx); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@@ -217,7 +218,7 @@ func (arq *AuthRequestQuery) CountX(ctx context.Context) int {
|
||||
|
||||
// Exist returns true if the query has elements in the graph.
|
||||
func (arq *AuthRequestQuery) Exist(ctx context.Context) (bool, error) {
|
||||
ctx = setContextOp(ctx, arq.ctx, "Exist")
|
||||
ctx = setContextOp(ctx, arq.ctx, ent.OpQueryExist)
|
||||
switch _, err := arq.FirstID(ctx); {
|
||||
case IsNotFound(err):
|
||||
return false, nil
|
||||
@@ -449,7 +450,7 @@ func (argb *AuthRequestGroupBy) Aggregate(fns ...AggregateFunc) *AuthRequestGrou
|
||||
|
||||
// Scan applies the selector query and scans the result into the given value.
|
||||
func (argb *AuthRequestGroupBy) Scan(ctx context.Context, v any) error {
|
||||
ctx = setContextOp(ctx, argb.build.ctx, "GroupBy")
|
||||
ctx = setContextOp(ctx, argb.build.ctx, ent.OpQueryGroupBy)
|
||||
if err := argb.build.prepareQuery(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -497,7 +498,7 @@ func (ars *AuthRequestSelect) Aggregate(fns ...AggregateFunc) *AuthRequestSelect
|
||||
|
||||
// Scan applies the selector query and scans the result into the given value.
|
||||
func (ars *AuthRequestSelect) Scan(ctx context.Context, v any) error {
|
||||
ctx = setContextOp(ctx, ars.ctx, "Select")
|
||||
ctx = setContextOp(ctx, ars.ctx, ent.OpQuerySelect)
|
||||
if err := ars.prepareQuery(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"math"
|
||||
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
"entgo.io/ent/schema/field"
|
||||
@@ -60,7 +61,7 @@ func (cq *ConnectorQuery) Order(o ...connector.OrderOption) *ConnectorQuery {
|
||||
// First returns the first Connector entity from the query.
|
||||
// Returns a *NotFoundError when no Connector was found.
|
||||
func (cq *ConnectorQuery) First(ctx context.Context) (*Connector, error) {
|
||||
nodes, err := cq.Limit(1).All(setContextOp(ctx, cq.ctx, "First"))
|
||||
nodes, err := cq.Limit(1).All(setContextOp(ctx, cq.ctx, ent.OpQueryFirst))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -83,7 +84,7 @@ func (cq *ConnectorQuery) FirstX(ctx context.Context) *Connector {
|
||||
// Returns a *NotFoundError when no Connector ID was found.
|
||||
func (cq *ConnectorQuery) FirstID(ctx context.Context) (id string, err error) {
|
||||
var ids []string
|
||||
if ids, err = cq.Limit(1).IDs(setContextOp(ctx, cq.ctx, "FirstID")); err != nil {
|
||||
if ids, err = cq.Limit(1).IDs(setContextOp(ctx, cq.ctx, ent.OpQueryFirstID)); err != nil {
|
||||
return
|
||||
}
|
||||
if len(ids) == 0 {
|
||||
@@ -106,7 +107,7 @@ func (cq *ConnectorQuery) FirstIDX(ctx context.Context) string {
|
||||
// Returns a *NotSingularError when more than one Connector entity is found.
|
||||
// Returns a *NotFoundError when no Connector entities are found.
|
||||
func (cq *ConnectorQuery) Only(ctx context.Context) (*Connector, error) {
|
||||
nodes, err := cq.Limit(2).All(setContextOp(ctx, cq.ctx, "Only"))
|
||||
nodes, err := cq.Limit(2).All(setContextOp(ctx, cq.ctx, ent.OpQueryOnly))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -134,7 +135,7 @@ func (cq *ConnectorQuery) OnlyX(ctx context.Context) *Connector {
|
||||
// Returns a *NotFoundError when no entities are found.
|
||||
func (cq *ConnectorQuery) OnlyID(ctx context.Context) (id string, err error) {
|
||||
var ids []string
|
||||
if ids, err = cq.Limit(2).IDs(setContextOp(ctx, cq.ctx, "OnlyID")); err != nil {
|
||||
if ids, err = cq.Limit(2).IDs(setContextOp(ctx, cq.ctx, ent.OpQueryOnlyID)); err != nil {
|
||||
return
|
||||
}
|
||||
switch len(ids) {
|
||||
@@ -159,7 +160,7 @@ func (cq *ConnectorQuery) OnlyIDX(ctx context.Context) string {
|
||||
|
||||
// All executes the query and returns a list of Connectors.
|
||||
func (cq *ConnectorQuery) All(ctx context.Context) ([]*Connector, error) {
|
||||
ctx = setContextOp(ctx, cq.ctx, "All")
|
||||
ctx = setContextOp(ctx, cq.ctx, ent.OpQueryAll)
|
||||
if err := cq.prepareQuery(ctx); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -181,7 +182,7 @@ func (cq *ConnectorQuery) IDs(ctx context.Context) (ids []string, err error) {
|
||||
if cq.ctx.Unique == nil && cq.path != nil {
|
||||
cq.Unique(true)
|
||||
}
|
||||
ctx = setContextOp(ctx, cq.ctx, "IDs")
|
||||
ctx = setContextOp(ctx, cq.ctx, ent.OpQueryIDs)
|
||||
if err = cq.Select(connector.FieldID).Scan(ctx, &ids); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -199,7 +200,7 @@ func (cq *ConnectorQuery) IDsX(ctx context.Context) []string {
|
||||
|
||||
// Count returns the count of the given query.
|
||||
func (cq *ConnectorQuery) Count(ctx context.Context) (int, error) {
|
||||
ctx = setContextOp(ctx, cq.ctx, "Count")
|
||||
ctx = setContextOp(ctx, cq.ctx, ent.OpQueryCount)
|
||||
if err := cq.prepareQuery(ctx); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@@ -217,7 +218,7 @@ func (cq *ConnectorQuery) CountX(ctx context.Context) int {
|
||||
|
||||
// Exist returns true if the query has elements in the graph.
|
||||
func (cq *ConnectorQuery) Exist(ctx context.Context) (bool, error) {
|
||||
ctx = setContextOp(ctx, cq.ctx, "Exist")
|
||||
ctx = setContextOp(ctx, cq.ctx, ent.OpQueryExist)
|
||||
switch _, err := cq.FirstID(ctx); {
|
||||
case IsNotFound(err):
|
||||
return false, nil
|
||||
@@ -449,7 +450,7 @@ func (cgb *ConnectorGroupBy) Aggregate(fns ...AggregateFunc) *ConnectorGroupBy {
|
||||
|
||||
// Scan applies the selector query and scans the result into the given value.
|
||||
func (cgb *ConnectorGroupBy) Scan(ctx context.Context, v any) error {
|
||||
ctx = setContextOp(ctx, cgb.build.ctx, "GroupBy")
|
||||
ctx = setContextOp(ctx, cgb.build.ctx, ent.OpQueryGroupBy)
|
||||
if err := cgb.build.prepareQuery(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -497,7 +498,7 @@ func (cs *ConnectorSelect) Aggregate(fns ...AggregateFunc) *ConnectorSelect {
|
||||
|
||||
// Scan applies the selector query and scans the result into the given value.
|
||||
func (cs *ConnectorSelect) Scan(ctx context.Context, v any) error {
|
||||
ctx = setContextOp(ctx, cs.ctx, "Select")
|
||||
ctx = setContextOp(ctx, cs.ctx, ent.OpQuerySelect)
|
||||
if err := cs.prepareQuery(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"math"
|
||||
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
"entgo.io/ent/schema/field"
|
||||
@@ -60,7 +61,7 @@ func (drq *DeviceRequestQuery) Order(o ...devicerequest.OrderOption) *DeviceRequ
|
||||
// First returns the first DeviceRequest entity from the query.
|
||||
// Returns a *NotFoundError when no DeviceRequest was found.
|
||||
func (drq *DeviceRequestQuery) First(ctx context.Context) (*DeviceRequest, error) {
|
||||
nodes, err := drq.Limit(1).All(setContextOp(ctx, drq.ctx, "First"))
|
||||
nodes, err := drq.Limit(1).All(setContextOp(ctx, drq.ctx, ent.OpQueryFirst))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -83,7 +84,7 @@ func (drq *DeviceRequestQuery) FirstX(ctx context.Context) *DeviceRequest {
|
||||
// Returns a *NotFoundError when no DeviceRequest ID was found.
|
||||
func (drq *DeviceRequestQuery) FirstID(ctx context.Context) (id int, err error) {
|
||||
var ids []int
|
||||
if ids, err = drq.Limit(1).IDs(setContextOp(ctx, drq.ctx, "FirstID")); err != nil {
|
||||
if ids, err = drq.Limit(1).IDs(setContextOp(ctx, drq.ctx, ent.OpQueryFirstID)); err != nil {
|
||||
return
|
||||
}
|
||||
if len(ids) == 0 {
|
||||
@@ -106,7 +107,7 @@ func (drq *DeviceRequestQuery) FirstIDX(ctx context.Context) int {
|
||||
// Returns a *NotSingularError when more than one DeviceRequest entity is found.
|
||||
// Returns a *NotFoundError when no DeviceRequest entities are found.
|
||||
func (drq *DeviceRequestQuery) Only(ctx context.Context) (*DeviceRequest, error) {
|
||||
nodes, err := drq.Limit(2).All(setContextOp(ctx, drq.ctx, "Only"))
|
||||
nodes, err := drq.Limit(2).All(setContextOp(ctx, drq.ctx, ent.OpQueryOnly))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -134,7 +135,7 @@ func (drq *DeviceRequestQuery) OnlyX(ctx context.Context) *DeviceRequest {
|
||||
// Returns a *NotFoundError when no entities are found.
|
||||
func (drq *DeviceRequestQuery) OnlyID(ctx context.Context) (id int, err error) {
|
||||
var ids []int
|
||||
if ids, err = drq.Limit(2).IDs(setContextOp(ctx, drq.ctx, "OnlyID")); err != nil {
|
||||
if ids, err = drq.Limit(2).IDs(setContextOp(ctx, drq.ctx, ent.OpQueryOnlyID)); err != nil {
|
||||
return
|
||||
}
|
||||
switch len(ids) {
|
||||
@@ -159,7 +160,7 @@ func (drq *DeviceRequestQuery) OnlyIDX(ctx context.Context) int {
|
||||
|
||||
// All executes the query and returns a list of DeviceRequests.
|
||||
func (drq *DeviceRequestQuery) All(ctx context.Context) ([]*DeviceRequest, error) {
|
||||
ctx = setContextOp(ctx, drq.ctx, "All")
|
||||
ctx = setContextOp(ctx, drq.ctx, ent.OpQueryAll)
|
||||
if err := drq.prepareQuery(ctx); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -181,7 +182,7 @@ func (drq *DeviceRequestQuery) IDs(ctx context.Context) (ids []int, err error) {
|
||||
if drq.ctx.Unique == nil && drq.path != nil {
|
||||
drq.Unique(true)
|
||||
}
|
||||
ctx = setContextOp(ctx, drq.ctx, "IDs")
|
||||
ctx = setContextOp(ctx, drq.ctx, ent.OpQueryIDs)
|
||||
if err = drq.Select(devicerequest.FieldID).Scan(ctx, &ids); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -199,7 +200,7 @@ func (drq *DeviceRequestQuery) IDsX(ctx context.Context) []int {
|
||||
|
||||
// Count returns the count of the given query.
|
||||
func (drq *DeviceRequestQuery) Count(ctx context.Context) (int, error) {
|
||||
ctx = setContextOp(ctx, drq.ctx, "Count")
|
||||
ctx = setContextOp(ctx, drq.ctx, ent.OpQueryCount)
|
||||
if err := drq.prepareQuery(ctx); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@@ -217,7 +218,7 @@ func (drq *DeviceRequestQuery) CountX(ctx context.Context) int {
|
||||
|
||||
// Exist returns true if the query has elements in the graph.
|
||||
func (drq *DeviceRequestQuery) Exist(ctx context.Context) (bool, error) {
|
||||
ctx = setContextOp(ctx, drq.ctx, "Exist")
|
||||
ctx = setContextOp(ctx, drq.ctx, ent.OpQueryExist)
|
||||
switch _, err := drq.FirstID(ctx); {
|
||||
case IsNotFound(err):
|
||||
return false, nil
|
||||
@@ -449,7 +450,7 @@ func (drgb *DeviceRequestGroupBy) Aggregate(fns ...AggregateFunc) *DeviceRequest
|
||||
|
||||
// Scan applies the selector query and scans the result into the given value.
|
||||
func (drgb *DeviceRequestGroupBy) Scan(ctx context.Context, v any) error {
|
||||
ctx = setContextOp(ctx, drgb.build.ctx, "GroupBy")
|
||||
ctx = setContextOp(ctx, drgb.build.ctx, ent.OpQueryGroupBy)
|
||||
if err := drgb.build.prepareQuery(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -497,7 +498,7 @@ func (drs *DeviceRequestSelect) Aggregate(fns ...AggregateFunc) *DeviceRequestSe
|
||||
|
||||
// Scan applies the selector query and scans the result into the given value.
|
||||
func (drs *DeviceRequestSelect) Scan(ctx context.Context, v any) error {
|
||||
ctx = setContextOp(ctx, drs.ctx, "Select")
|
||||
ctx = setContextOp(ctx, drs.ctx, ent.OpQuerySelect)
|
||||
if err := drs.prepareQuery(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"math"
|
||||
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
"entgo.io/ent/schema/field"
|
||||
@@ -60,7 +61,7 @@ func (dtq *DeviceTokenQuery) Order(o ...devicetoken.OrderOption) *DeviceTokenQue
|
||||
// First returns the first DeviceToken entity from the query.
|
||||
// Returns a *NotFoundError when no DeviceToken was found.
|
||||
func (dtq *DeviceTokenQuery) First(ctx context.Context) (*DeviceToken, error) {
|
||||
nodes, err := dtq.Limit(1).All(setContextOp(ctx, dtq.ctx, "First"))
|
||||
nodes, err := dtq.Limit(1).All(setContextOp(ctx, dtq.ctx, ent.OpQueryFirst))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -83,7 +84,7 @@ func (dtq *DeviceTokenQuery) FirstX(ctx context.Context) *DeviceToken {
|
||||
// Returns a *NotFoundError when no DeviceToken ID was found.
|
||||
func (dtq *DeviceTokenQuery) FirstID(ctx context.Context) (id int, err error) {
|
||||
var ids []int
|
||||
if ids, err = dtq.Limit(1).IDs(setContextOp(ctx, dtq.ctx, "FirstID")); err != nil {
|
||||
if ids, err = dtq.Limit(1).IDs(setContextOp(ctx, dtq.ctx, ent.OpQueryFirstID)); err != nil {
|
||||
return
|
||||
}
|
||||
if len(ids) == 0 {
|
||||
@@ -106,7 +107,7 @@ func (dtq *DeviceTokenQuery) FirstIDX(ctx context.Context) int {
|
||||
// Returns a *NotSingularError when more than one DeviceToken entity is found.
|
||||
// Returns a *NotFoundError when no DeviceToken entities are found.
|
||||
func (dtq *DeviceTokenQuery) Only(ctx context.Context) (*DeviceToken, error) {
|
||||
nodes, err := dtq.Limit(2).All(setContextOp(ctx, dtq.ctx, "Only"))
|
||||
nodes, err := dtq.Limit(2).All(setContextOp(ctx, dtq.ctx, ent.OpQueryOnly))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -134,7 +135,7 @@ func (dtq *DeviceTokenQuery) OnlyX(ctx context.Context) *DeviceToken {
|
||||
// Returns a *NotFoundError when no entities are found.
|
||||
func (dtq *DeviceTokenQuery) OnlyID(ctx context.Context) (id int, err error) {
|
||||
var ids []int
|
||||
if ids, err = dtq.Limit(2).IDs(setContextOp(ctx, dtq.ctx, "OnlyID")); err != nil {
|
||||
if ids, err = dtq.Limit(2).IDs(setContextOp(ctx, dtq.ctx, ent.OpQueryOnlyID)); err != nil {
|
||||
return
|
||||
}
|
||||
switch len(ids) {
|
||||
@@ -159,7 +160,7 @@ func (dtq *DeviceTokenQuery) OnlyIDX(ctx context.Context) int {
|
||||
|
||||
// All executes the query and returns a list of DeviceTokens.
|
||||
func (dtq *DeviceTokenQuery) All(ctx context.Context) ([]*DeviceToken, error) {
|
||||
ctx = setContextOp(ctx, dtq.ctx, "All")
|
||||
ctx = setContextOp(ctx, dtq.ctx, ent.OpQueryAll)
|
||||
if err := dtq.prepareQuery(ctx); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -181,7 +182,7 @@ func (dtq *DeviceTokenQuery) IDs(ctx context.Context) (ids []int, err error) {
|
||||
if dtq.ctx.Unique == nil && dtq.path != nil {
|
||||
dtq.Unique(true)
|
||||
}
|
||||
ctx = setContextOp(ctx, dtq.ctx, "IDs")
|
||||
ctx = setContextOp(ctx, dtq.ctx, ent.OpQueryIDs)
|
||||
if err = dtq.Select(devicetoken.FieldID).Scan(ctx, &ids); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -199,7 +200,7 @@ func (dtq *DeviceTokenQuery) IDsX(ctx context.Context) []int {
|
||||
|
||||
// Count returns the count of the given query.
|
||||
func (dtq *DeviceTokenQuery) Count(ctx context.Context) (int, error) {
|
||||
ctx = setContextOp(ctx, dtq.ctx, "Count")
|
||||
ctx = setContextOp(ctx, dtq.ctx, ent.OpQueryCount)
|
||||
if err := dtq.prepareQuery(ctx); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@@ -217,7 +218,7 @@ func (dtq *DeviceTokenQuery) CountX(ctx context.Context) int {
|
||||
|
||||
// Exist returns true if the query has elements in the graph.
|
||||
func (dtq *DeviceTokenQuery) Exist(ctx context.Context) (bool, error) {
|
||||
ctx = setContextOp(ctx, dtq.ctx, "Exist")
|
||||
ctx = setContextOp(ctx, dtq.ctx, ent.OpQueryExist)
|
||||
switch _, err := dtq.FirstID(ctx); {
|
||||
case IsNotFound(err):
|
||||
return false, nil
|
||||
@@ -449,7 +450,7 @@ func (dtgb *DeviceTokenGroupBy) Aggregate(fns ...AggregateFunc) *DeviceTokenGrou
|
||||
|
||||
// Scan applies the selector query and scans the result into the given value.
|
||||
func (dtgb *DeviceTokenGroupBy) Scan(ctx context.Context, v any) error {
|
||||
ctx = setContextOp(ctx, dtgb.build.ctx, "GroupBy")
|
||||
ctx = setContextOp(ctx, dtgb.build.ctx, ent.OpQueryGroupBy)
|
||||
if err := dtgb.build.prepareQuery(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -497,7 +498,7 @@ func (dts *DeviceTokenSelect) Aggregate(fns ...AggregateFunc) *DeviceTokenSelect
|
||||
|
||||
// Scan applies the selector query and scans the result into the given value.
|
||||
func (dts *DeviceTokenSelect) Scan(ctx context.Context, v any) error {
|
||||
ctx = setContextOp(ctx, dts.ctx, "Select")
|
||||
ctx = setContextOp(ctx, dts.ctx, ent.OpQuerySelect)
|
||||
if err := dts.prepareQuery(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ var (
|
||||
columnCheck sql.ColumnCheck
|
||||
)
|
||||
|
||||
// columnChecker checks if the column exists in the given table.
|
||||
// checkColumn checks if the column exists in the given table.
|
||||
func checkColumn(table, column string) error {
|
||||
initCheck.Do(func() {
|
||||
columnCheck = sql.NewColumnCheck(map[string]func(string) bool{
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"math"
|
||||
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
"entgo.io/ent/schema/field"
|
||||
@@ -60,7 +61,7 @@ func (kq *KeysQuery) Order(o ...keys.OrderOption) *KeysQuery {
|
||||
// First returns the first Keys entity from the query.
|
||||
// Returns a *NotFoundError when no Keys was found.
|
||||
func (kq *KeysQuery) First(ctx context.Context) (*Keys, error) {
|
||||
nodes, err := kq.Limit(1).All(setContextOp(ctx, kq.ctx, "First"))
|
||||
nodes, err := kq.Limit(1).All(setContextOp(ctx, kq.ctx, ent.OpQueryFirst))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -83,7 +84,7 @@ func (kq *KeysQuery) FirstX(ctx context.Context) *Keys {
|
||||
// Returns a *NotFoundError when no Keys ID was found.
|
||||
func (kq *KeysQuery) FirstID(ctx context.Context) (id string, err error) {
|
||||
var ids []string
|
||||
if ids, err = kq.Limit(1).IDs(setContextOp(ctx, kq.ctx, "FirstID")); err != nil {
|
||||
if ids, err = kq.Limit(1).IDs(setContextOp(ctx, kq.ctx, ent.OpQueryFirstID)); err != nil {
|
||||
return
|
||||
}
|
||||
if len(ids) == 0 {
|
||||
@@ -106,7 +107,7 @@ func (kq *KeysQuery) FirstIDX(ctx context.Context) string {
|
||||
// Returns a *NotSingularError when more than one Keys entity is found.
|
||||
// Returns a *NotFoundError when no Keys entities are found.
|
||||
func (kq *KeysQuery) Only(ctx context.Context) (*Keys, error) {
|
||||
nodes, err := kq.Limit(2).All(setContextOp(ctx, kq.ctx, "Only"))
|
||||
nodes, err := kq.Limit(2).All(setContextOp(ctx, kq.ctx, ent.OpQueryOnly))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -134,7 +135,7 @@ func (kq *KeysQuery) OnlyX(ctx context.Context) *Keys {
|
||||
// Returns a *NotFoundError when no entities are found.
|
||||
func (kq *KeysQuery) OnlyID(ctx context.Context) (id string, err error) {
|
||||
var ids []string
|
||||
if ids, err = kq.Limit(2).IDs(setContextOp(ctx, kq.ctx, "OnlyID")); err != nil {
|
||||
if ids, err = kq.Limit(2).IDs(setContextOp(ctx, kq.ctx, ent.OpQueryOnlyID)); err != nil {
|
||||
return
|
||||
}
|
||||
switch len(ids) {
|
||||
@@ -159,7 +160,7 @@ func (kq *KeysQuery) OnlyIDX(ctx context.Context) string {
|
||||
|
||||
// All executes the query and returns a list of KeysSlice.
|
||||
func (kq *KeysQuery) All(ctx context.Context) ([]*Keys, error) {
|
||||
ctx = setContextOp(ctx, kq.ctx, "All")
|
||||
ctx = setContextOp(ctx, kq.ctx, ent.OpQueryAll)
|
||||
if err := kq.prepareQuery(ctx); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -181,7 +182,7 @@ func (kq *KeysQuery) IDs(ctx context.Context) (ids []string, err error) {
|
||||
if kq.ctx.Unique == nil && kq.path != nil {
|
||||
kq.Unique(true)
|
||||
}
|
||||
ctx = setContextOp(ctx, kq.ctx, "IDs")
|
||||
ctx = setContextOp(ctx, kq.ctx, ent.OpQueryIDs)
|
||||
if err = kq.Select(keys.FieldID).Scan(ctx, &ids); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -199,7 +200,7 @@ func (kq *KeysQuery) IDsX(ctx context.Context) []string {
|
||||
|
||||
// Count returns the count of the given query.
|
||||
func (kq *KeysQuery) Count(ctx context.Context) (int, error) {
|
||||
ctx = setContextOp(ctx, kq.ctx, "Count")
|
||||
ctx = setContextOp(ctx, kq.ctx, ent.OpQueryCount)
|
||||
if err := kq.prepareQuery(ctx); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@@ -217,7 +218,7 @@ func (kq *KeysQuery) CountX(ctx context.Context) int {
|
||||
|
||||
// Exist returns true if the query has elements in the graph.
|
||||
func (kq *KeysQuery) Exist(ctx context.Context) (bool, error) {
|
||||
ctx = setContextOp(ctx, kq.ctx, "Exist")
|
||||
ctx = setContextOp(ctx, kq.ctx, ent.OpQueryExist)
|
||||
switch _, err := kq.FirstID(ctx); {
|
||||
case IsNotFound(err):
|
||||
return false, nil
|
||||
@@ -449,7 +450,7 @@ func (kgb *KeysGroupBy) Aggregate(fns ...AggregateFunc) *KeysGroupBy {
|
||||
|
||||
// Scan applies the selector query and scans the result into the given value.
|
||||
func (kgb *KeysGroupBy) Scan(ctx context.Context, v any) error {
|
||||
ctx = setContextOp(ctx, kgb.build.ctx, "GroupBy")
|
||||
ctx = setContextOp(ctx, kgb.build.ctx, ent.OpQueryGroupBy)
|
||||
if err := kgb.build.prepareQuery(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -497,7 +498,7 @@ func (ks *KeysSelect) Aggregate(fns ...AggregateFunc) *KeysSelect {
|
||||
|
||||
// Scan applies the selector query and scans the result into the given value.
|
||||
func (ks *KeysSelect) Scan(ctx context.Context, v any) error {
|
||||
ctx = setContextOp(ctx, ks.ctx, "Select")
|
||||
ctx = setContextOp(ctx, ks.ctx, ent.OpQuerySelect)
|
||||
if err := ks.prepareQuery(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"math"
|
||||
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
"entgo.io/ent/schema/field"
|
||||
@@ -60,7 +61,7 @@ func (oq *OAuth2ClientQuery) Order(o ...oauth2client.OrderOption) *OAuth2ClientQ
|
||||
// First returns the first OAuth2Client entity from the query.
|
||||
// Returns a *NotFoundError when no OAuth2Client was found.
|
||||
func (oq *OAuth2ClientQuery) First(ctx context.Context) (*OAuth2Client, error) {
|
||||
nodes, err := oq.Limit(1).All(setContextOp(ctx, oq.ctx, "First"))
|
||||
nodes, err := oq.Limit(1).All(setContextOp(ctx, oq.ctx, ent.OpQueryFirst))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -83,7 +84,7 @@ func (oq *OAuth2ClientQuery) FirstX(ctx context.Context) *OAuth2Client {
|
||||
// Returns a *NotFoundError when no OAuth2Client ID was found.
|
||||
func (oq *OAuth2ClientQuery) FirstID(ctx context.Context) (id string, err error) {
|
||||
var ids []string
|
||||
if ids, err = oq.Limit(1).IDs(setContextOp(ctx, oq.ctx, "FirstID")); err != nil {
|
||||
if ids, err = oq.Limit(1).IDs(setContextOp(ctx, oq.ctx, ent.OpQueryFirstID)); err != nil {
|
||||
return
|
||||
}
|
||||
if len(ids) == 0 {
|
||||
@@ -106,7 +107,7 @@ func (oq *OAuth2ClientQuery) FirstIDX(ctx context.Context) string {
|
||||
// Returns a *NotSingularError when more than one OAuth2Client entity is found.
|
||||
// Returns a *NotFoundError when no OAuth2Client entities are found.
|
||||
func (oq *OAuth2ClientQuery) Only(ctx context.Context) (*OAuth2Client, error) {
|
||||
nodes, err := oq.Limit(2).All(setContextOp(ctx, oq.ctx, "Only"))
|
||||
nodes, err := oq.Limit(2).All(setContextOp(ctx, oq.ctx, ent.OpQueryOnly))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -134,7 +135,7 @@ func (oq *OAuth2ClientQuery) OnlyX(ctx context.Context) *OAuth2Client {
|
||||
// Returns a *NotFoundError when no entities are found.
|
||||
func (oq *OAuth2ClientQuery) OnlyID(ctx context.Context) (id string, err error) {
|
||||
var ids []string
|
||||
if ids, err = oq.Limit(2).IDs(setContextOp(ctx, oq.ctx, "OnlyID")); err != nil {
|
||||
if ids, err = oq.Limit(2).IDs(setContextOp(ctx, oq.ctx, ent.OpQueryOnlyID)); err != nil {
|
||||
return
|
||||
}
|
||||
switch len(ids) {
|
||||
@@ -159,7 +160,7 @@ func (oq *OAuth2ClientQuery) OnlyIDX(ctx context.Context) string {
|
||||
|
||||
// All executes the query and returns a list of OAuth2Clients.
|
||||
func (oq *OAuth2ClientQuery) All(ctx context.Context) ([]*OAuth2Client, error) {
|
||||
ctx = setContextOp(ctx, oq.ctx, "All")
|
||||
ctx = setContextOp(ctx, oq.ctx, ent.OpQueryAll)
|
||||
if err := oq.prepareQuery(ctx); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -181,7 +182,7 @@ func (oq *OAuth2ClientQuery) IDs(ctx context.Context) (ids []string, err error)
|
||||
if oq.ctx.Unique == nil && oq.path != nil {
|
||||
oq.Unique(true)
|
||||
}
|
||||
ctx = setContextOp(ctx, oq.ctx, "IDs")
|
||||
ctx = setContextOp(ctx, oq.ctx, ent.OpQueryIDs)
|
||||
if err = oq.Select(oauth2client.FieldID).Scan(ctx, &ids); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -199,7 +200,7 @@ func (oq *OAuth2ClientQuery) IDsX(ctx context.Context) []string {
|
||||
|
||||
// Count returns the count of the given query.
|
||||
func (oq *OAuth2ClientQuery) Count(ctx context.Context) (int, error) {
|
||||
ctx = setContextOp(ctx, oq.ctx, "Count")
|
||||
ctx = setContextOp(ctx, oq.ctx, ent.OpQueryCount)
|
||||
if err := oq.prepareQuery(ctx); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@@ -217,7 +218,7 @@ func (oq *OAuth2ClientQuery) CountX(ctx context.Context) int {
|
||||
|
||||
// Exist returns true if the query has elements in the graph.
|
||||
func (oq *OAuth2ClientQuery) Exist(ctx context.Context) (bool, error) {
|
||||
ctx = setContextOp(ctx, oq.ctx, "Exist")
|
||||
ctx = setContextOp(ctx, oq.ctx, ent.OpQueryExist)
|
||||
switch _, err := oq.FirstID(ctx); {
|
||||
case IsNotFound(err):
|
||||
return false, nil
|
||||
@@ -449,7 +450,7 @@ func (ogb *OAuth2ClientGroupBy) Aggregate(fns ...AggregateFunc) *OAuth2ClientGro
|
||||
|
||||
// Scan applies the selector query and scans the result into the given value.
|
||||
func (ogb *OAuth2ClientGroupBy) Scan(ctx context.Context, v any) error {
|
||||
ctx = setContextOp(ctx, ogb.build.ctx, "GroupBy")
|
||||
ctx = setContextOp(ctx, ogb.build.ctx, ent.OpQueryGroupBy)
|
||||
if err := ogb.build.prepareQuery(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -497,7 +498,7 @@ func (os *OAuth2ClientSelect) Aggregate(fns ...AggregateFunc) *OAuth2ClientSelec
|
||||
|
||||
// Scan applies the selector query and scans the result into the given value.
|
||||
func (os *OAuth2ClientSelect) Scan(ctx context.Context, v any) error {
|
||||
ctx = setContextOp(ctx, os.ctx, "Select")
|
||||
ctx = setContextOp(ctx, os.ctx, ent.OpQuerySelect)
|
||||
if err := os.prepareQuery(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"math"
|
||||
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
"entgo.io/ent/schema/field"
|
||||
@@ -60,7 +61,7 @@ func (osq *OfflineSessionQuery) Order(o ...offlinesession.OrderOption) *OfflineS
|
||||
// First returns the first OfflineSession entity from the query.
|
||||
// Returns a *NotFoundError when no OfflineSession was found.
|
||||
func (osq *OfflineSessionQuery) First(ctx context.Context) (*OfflineSession, error) {
|
||||
nodes, err := osq.Limit(1).All(setContextOp(ctx, osq.ctx, "First"))
|
||||
nodes, err := osq.Limit(1).All(setContextOp(ctx, osq.ctx, ent.OpQueryFirst))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -83,7 +84,7 @@ func (osq *OfflineSessionQuery) FirstX(ctx context.Context) *OfflineSession {
|
||||
// Returns a *NotFoundError when no OfflineSession ID was found.
|
||||
func (osq *OfflineSessionQuery) FirstID(ctx context.Context) (id string, err error) {
|
||||
var ids []string
|
||||
if ids, err = osq.Limit(1).IDs(setContextOp(ctx, osq.ctx, "FirstID")); err != nil {
|
||||
if ids, err = osq.Limit(1).IDs(setContextOp(ctx, osq.ctx, ent.OpQueryFirstID)); err != nil {
|
||||
return
|
||||
}
|
||||
if len(ids) == 0 {
|
||||
@@ -106,7 +107,7 @@ func (osq *OfflineSessionQuery) FirstIDX(ctx context.Context) string {
|
||||
// Returns a *NotSingularError when more than one OfflineSession entity is found.
|
||||
// Returns a *NotFoundError when no OfflineSession entities are found.
|
||||
func (osq *OfflineSessionQuery) Only(ctx context.Context) (*OfflineSession, error) {
|
||||
nodes, err := osq.Limit(2).All(setContextOp(ctx, osq.ctx, "Only"))
|
||||
nodes, err := osq.Limit(2).All(setContextOp(ctx, osq.ctx, ent.OpQueryOnly))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -134,7 +135,7 @@ func (osq *OfflineSessionQuery) OnlyX(ctx context.Context) *OfflineSession {
|
||||
// Returns a *NotFoundError when no entities are found.
|
||||
func (osq *OfflineSessionQuery) OnlyID(ctx context.Context) (id string, err error) {
|
||||
var ids []string
|
||||
if ids, err = osq.Limit(2).IDs(setContextOp(ctx, osq.ctx, "OnlyID")); err != nil {
|
||||
if ids, err = osq.Limit(2).IDs(setContextOp(ctx, osq.ctx, ent.OpQueryOnlyID)); err != nil {
|
||||
return
|
||||
}
|
||||
switch len(ids) {
|
||||
@@ -159,7 +160,7 @@ func (osq *OfflineSessionQuery) OnlyIDX(ctx context.Context) string {
|
||||
|
||||
// All executes the query and returns a list of OfflineSessions.
|
||||
func (osq *OfflineSessionQuery) All(ctx context.Context) ([]*OfflineSession, error) {
|
||||
ctx = setContextOp(ctx, osq.ctx, "All")
|
||||
ctx = setContextOp(ctx, osq.ctx, ent.OpQueryAll)
|
||||
if err := osq.prepareQuery(ctx); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -181,7 +182,7 @@ func (osq *OfflineSessionQuery) IDs(ctx context.Context) (ids []string, err erro
|
||||
if osq.ctx.Unique == nil && osq.path != nil {
|
||||
osq.Unique(true)
|
||||
}
|
||||
ctx = setContextOp(ctx, osq.ctx, "IDs")
|
||||
ctx = setContextOp(ctx, osq.ctx, ent.OpQueryIDs)
|
||||
if err = osq.Select(offlinesession.FieldID).Scan(ctx, &ids); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -199,7 +200,7 @@ func (osq *OfflineSessionQuery) IDsX(ctx context.Context) []string {
|
||||
|
||||
// Count returns the count of the given query.
|
||||
func (osq *OfflineSessionQuery) Count(ctx context.Context) (int, error) {
|
||||
ctx = setContextOp(ctx, osq.ctx, "Count")
|
||||
ctx = setContextOp(ctx, osq.ctx, ent.OpQueryCount)
|
||||
if err := osq.prepareQuery(ctx); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@@ -217,7 +218,7 @@ func (osq *OfflineSessionQuery) CountX(ctx context.Context) int {
|
||||
|
||||
// Exist returns true if the query has elements in the graph.
|
||||
func (osq *OfflineSessionQuery) Exist(ctx context.Context) (bool, error) {
|
||||
ctx = setContextOp(ctx, osq.ctx, "Exist")
|
||||
ctx = setContextOp(ctx, osq.ctx, ent.OpQueryExist)
|
||||
switch _, err := osq.FirstID(ctx); {
|
||||
case IsNotFound(err):
|
||||
return false, nil
|
||||
@@ -449,7 +450,7 @@ func (osgb *OfflineSessionGroupBy) Aggregate(fns ...AggregateFunc) *OfflineSessi
|
||||
|
||||
// Scan applies the selector query and scans the result into the given value.
|
||||
func (osgb *OfflineSessionGroupBy) Scan(ctx context.Context, v any) error {
|
||||
ctx = setContextOp(ctx, osgb.build.ctx, "GroupBy")
|
||||
ctx = setContextOp(ctx, osgb.build.ctx, ent.OpQueryGroupBy)
|
||||
if err := osgb.build.prepareQuery(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -497,7 +498,7 @@ func (oss *OfflineSessionSelect) Aggregate(fns ...AggregateFunc) *OfflineSession
|
||||
|
||||
// Scan applies the selector query and scans the result into the given value.
|
||||
func (oss *OfflineSessionSelect) Scan(ctx context.Context, v any) error {
|
||||
ctx = setContextOp(ctx, oss.ctx, "Select")
|
||||
ctx = setContextOp(ctx, oss.ctx, ent.OpQuerySelect)
|
||||
if err := oss.prepareQuery(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"math"
|
||||
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
"entgo.io/ent/schema/field"
|
||||
@@ -60,7 +61,7 @@ func (pq *PasswordQuery) Order(o ...password.OrderOption) *PasswordQuery {
|
||||
// First returns the first Password entity from the query.
|
||||
// Returns a *NotFoundError when no Password was found.
|
||||
func (pq *PasswordQuery) First(ctx context.Context) (*Password, error) {
|
||||
nodes, err := pq.Limit(1).All(setContextOp(ctx, pq.ctx, "First"))
|
||||
nodes, err := pq.Limit(1).All(setContextOp(ctx, pq.ctx, ent.OpQueryFirst))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -83,7 +84,7 @@ func (pq *PasswordQuery) FirstX(ctx context.Context) *Password {
|
||||
// Returns a *NotFoundError when no Password ID was found.
|
||||
func (pq *PasswordQuery) FirstID(ctx context.Context) (id int, err error) {
|
||||
var ids []int
|
||||
if ids, err = pq.Limit(1).IDs(setContextOp(ctx, pq.ctx, "FirstID")); err != nil {
|
||||
if ids, err = pq.Limit(1).IDs(setContextOp(ctx, pq.ctx, ent.OpQueryFirstID)); err != nil {
|
||||
return
|
||||
}
|
||||
if len(ids) == 0 {
|
||||
@@ -106,7 +107,7 @@ func (pq *PasswordQuery) FirstIDX(ctx context.Context) int {
|
||||
// Returns a *NotSingularError when more than one Password entity is found.
|
||||
// Returns a *NotFoundError when no Password entities are found.
|
||||
func (pq *PasswordQuery) Only(ctx context.Context) (*Password, error) {
|
||||
nodes, err := pq.Limit(2).All(setContextOp(ctx, pq.ctx, "Only"))
|
||||
nodes, err := pq.Limit(2).All(setContextOp(ctx, pq.ctx, ent.OpQueryOnly))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -134,7 +135,7 @@ func (pq *PasswordQuery) OnlyX(ctx context.Context) *Password {
|
||||
// Returns a *NotFoundError when no entities are found.
|
||||
func (pq *PasswordQuery) OnlyID(ctx context.Context) (id int, err error) {
|
||||
var ids []int
|
||||
if ids, err = pq.Limit(2).IDs(setContextOp(ctx, pq.ctx, "OnlyID")); err != nil {
|
||||
if ids, err = pq.Limit(2).IDs(setContextOp(ctx, pq.ctx, ent.OpQueryOnlyID)); err != nil {
|
||||
return
|
||||
}
|
||||
switch len(ids) {
|
||||
@@ -159,7 +160,7 @@ func (pq *PasswordQuery) OnlyIDX(ctx context.Context) int {
|
||||
|
||||
// All executes the query and returns a list of Passwords.
|
||||
func (pq *PasswordQuery) All(ctx context.Context) ([]*Password, error) {
|
||||
ctx = setContextOp(ctx, pq.ctx, "All")
|
||||
ctx = setContextOp(ctx, pq.ctx, ent.OpQueryAll)
|
||||
if err := pq.prepareQuery(ctx); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -181,7 +182,7 @@ func (pq *PasswordQuery) IDs(ctx context.Context) (ids []int, err error) {
|
||||
if pq.ctx.Unique == nil && pq.path != nil {
|
||||
pq.Unique(true)
|
||||
}
|
||||
ctx = setContextOp(ctx, pq.ctx, "IDs")
|
||||
ctx = setContextOp(ctx, pq.ctx, ent.OpQueryIDs)
|
||||
if err = pq.Select(password.FieldID).Scan(ctx, &ids); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -199,7 +200,7 @@ func (pq *PasswordQuery) IDsX(ctx context.Context) []int {
|
||||
|
||||
// Count returns the count of the given query.
|
||||
func (pq *PasswordQuery) Count(ctx context.Context) (int, error) {
|
||||
ctx = setContextOp(ctx, pq.ctx, "Count")
|
||||
ctx = setContextOp(ctx, pq.ctx, ent.OpQueryCount)
|
||||
if err := pq.prepareQuery(ctx); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@@ -217,7 +218,7 @@ func (pq *PasswordQuery) CountX(ctx context.Context) int {
|
||||
|
||||
// Exist returns true if the query has elements in the graph.
|
||||
func (pq *PasswordQuery) Exist(ctx context.Context) (bool, error) {
|
||||
ctx = setContextOp(ctx, pq.ctx, "Exist")
|
||||
ctx = setContextOp(ctx, pq.ctx, ent.OpQueryExist)
|
||||
switch _, err := pq.FirstID(ctx); {
|
||||
case IsNotFound(err):
|
||||
return false, nil
|
||||
@@ -449,7 +450,7 @@ func (pgb *PasswordGroupBy) Aggregate(fns ...AggregateFunc) *PasswordGroupBy {
|
||||
|
||||
// Scan applies the selector query and scans the result into the given value.
|
||||
func (pgb *PasswordGroupBy) Scan(ctx context.Context, v any) error {
|
||||
ctx = setContextOp(ctx, pgb.build.ctx, "GroupBy")
|
||||
ctx = setContextOp(ctx, pgb.build.ctx, ent.OpQueryGroupBy)
|
||||
if err := pgb.build.prepareQuery(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -497,7 +498,7 @@ func (ps *PasswordSelect) Aggregate(fns ...AggregateFunc) *PasswordSelect {
|
||||
|
||||
// Scan applies the selector query and scans the result into the given value.
|
||||
func (ps *PasswordSelect) Scan(ctx context.Context, v any) error {
|
||||
ctx = setContextOp(ctx, ps.ctx, "Select")
|
||||
ctx = setContextOp(ctx, ps.ctx, ent.OpQuerySelect)
|
||||
if err := ps.prepareQuery(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"math"
|
||||
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/dialect/sql"
|
||||
"entgo.io/ent/dialect/sql/sqlgraph"
|
||||
"entgo.io/ent/schema/field"
|
||||
@@ -60,7 +61,7 @@ func (rtq *RefreshTokenQuery) Order(o ...refreshtoken.OrderOption) *RefreshToken
|
||||
// First returns the first RefreshToken entity from the query.
|
||||
// Returns a *NotFoundError when no RefreshToken was found.
|
||||
func (rtq *RefreshTokenQuery) First(ctx context.Context) (*RefreshToken, error) {
|
||||
nodes, err := rtq.Limit(1).All(setContextOp(ctx, rtq.ctx, "First"))
|
||||
nodes, err := rtq.Limit(1).All(setContextOp(ctx, rtq.ctx, ent.OpQueryFirst))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -83,7 +84,7 @@ func (rtq *RefreshTokenQuery) FirstX(ctx context.Context) *RefreshToken {
|
||||
// Returns a *NotFoundError when no RefreshToken ID was found.
|
||||
func (rtq *RefreshTokenQuery) FirstID(ctx context.Context) (id string, err error) {
|
||||
var ids []string
|
||||
if ids, err = rtq.Limit(1).IDs(setContextOp(ctx, rtq.ctx, "FirstID")); err != nil {
|
||||
if ids, err = rtq.Limit(1).IDs(setContextOp(ctx, rtq.ctx, ent.OpQueryFirstID)); err != nil {
|
||||
return
|
||||
}
|
||||
if len(ids) == 0 {
|
||||
@@ -106,7 +107,7 @@ func (rtq *RefreshTokenQuery) FirstIDX(ctx context.Context) string {
|
||||
// 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(setContextOp(ctx, rtq.ctx, "Only"))
|
||||
nodes, err := rtq.Limit(2).All(setContextOp(ctx, rtq.ctx, ent.OpQueryOnly))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -134,7 +135,7 @@ func (rtq *RefreshTokenQuery) OnlyX(ctx context.Context) *RefreshToken {
|
||||
// Returns a *NotFoundError when no entities are found.
|
||||
func (rtq *RefreshTokenQuery) OnlyID(ctx context.Context) (id string, err error) {
|
||||
var ids []string
|
||||
if ids, err = rtq.Limit(2).IDs(setContextOp(ctx, rtq.ctx, "OnlyID")); err != nil {
|
||||
if ids, err = rtq.Limit(2).IDs(setContextOp(ctx, rtq.ctx, ent.OpQueryOnlyID)); err != nil {
|
||||
return
|
||||
}
|
||||
switch len(ids) {
|
||||
@@ -159,7 +160,7 @@ func (rtq *RefreshTokenQuery) OnlyIDX(ctx context.Context) string {
|
||||
|
||||
// All executes the query and returns a list of RefreshTokens.
|
||||
func (rtq *RefreshTokenQuery) All(ctx context.Context) ([]*RefreshToken, error) {
|
||||
ctx = setContextOp(ctx, rtq.ctx, "All")
|
||||
ctx = setContextOp(ctx, rtq.ctx, ent.OpQueryAll)
|
||||
if err := rtq.prepareQuery(ctx); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -181,7 +182,7 @@ func (rtq *RefreshTokenQuery) IDs(ctx context.Context) (ids []string, err error)
|
||||
if rtq.ctx.Unique == nil && rtq.path != nil {
|
||||
rtq.Unique(true)
|
||||
}
|
||||
ctx = setContextOp(ctx, rtq.ctx, "IDs")
|
||||
ctx = setContextOp(ctx, rtq.ctx, ent.OpQueryIDs)
|
||||
if err = rtq.Select(refreshtoken.FieldID).Scan(ctx, &ids); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -199,7 +200,7 @@ func (rtq *RefreshTokenQuery) IDsX(ctx context.Context) []string {
|
||||
|
||||
// Count returns the count of the given query.
|
||||
func (rtq *RefreshTokenQuery) Count(ctx context.Context) (int, error) {
|
||||
ctx = setContextOp(ctx, rtq.ctx, "Count")
|
||||
ctx = setContextOp(ctx, rtq.ctx, ent.OpQueryCount)
|
||||
if err := rtq.prepareQuery(ctx); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@@ -217,7 +218,7 @@ func (rtq *RefreshTokenQuery) CountX(ctx context.Context) int {
|
||||
|
||||
// Exist returns true if the query has elements in the graph.
|
||||
func (rtq *RefreshTokenQuery) Exist(ctx context.Context) (bool, error) {
|
||||
ctx = setContextOp(ctx, rtq.ctx, "Exist")
|
||||
ctx = setContextOp(ctx, rtq.ctx, ent.OpQueryExist)
|
||||
switch _, err := rtq.FirstID(ctx); {
|
||||
case IsNotFound(err):
|
||||
return false, nil
|
||||
@@ -449,7 +450,7 @@ func (rtgb *RefreshTokenGroupBy) Aggregate(fns ...AggregateFunc) *RefreshTokenGr
|
||||
|
||||
// Scan applies the selector query and scans the result into the given value.
|
||||
func (rtgb *RefreshTokenGroupBy) Scan(ctx context.Context, v any) error {
|
||||
ctx = setContextOp(ctx, rtgb.build.ctx, "GroupBy")
|
||||
ctx = setContextOp(ctx, rtgb.build.ctx, ent.OpQueryGroupBy)
|
||||
if err := rtgb.build.prepareQuery(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -497,7 +498,7 @@ func (rts *RefreshTokenSelect) Aggregate(fns ...AggregateFunc) *RefreshTokenSele
|
||||
|
||||
// Scan applies the selector query and scans the result into the given value.
|
||||
func (rts *RefreshTokenSelect) Scan(ctx context.Context, v any) error {
|
||||
ctx = setContextOp(ctx, rts.ctx, "Select")
|
||||
ctx = setContextOp(ctx, rts.ctx, ent.OpQuerySelect)
|
||||
if err := rts.prepareQuery(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -5,6 +5,6 @@ package runtime
|
||||
// The schema-stitching logic is generated in github.com/dexidp/dex/storage/ent/db/runtime.go
|
||||
|
||||
const (
|
||||
Version = "v0.13.1" // Version of ent codegen.
|
||||
Sum = "h1:uD8QwN1h6SNphdCCzmkMN3feSUzNnVvV/WIkHKMbzOE=" // Sum of ent codegen.
|
||||
Version = "v0.14.0" // Version of ent codegen.
|
||||
Sum = "h1:EO3Z9aZ5bXJatJeGqu/EVdnNr6K4mRq3rWe5owt0MC4=" // Sum of ent codegen.
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user