chore: Bump ent to 0.11.2 (#2640)

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
This commit is contained in:
Maksim Nabokikh
2022-08-29 11:16:12 +04:00
committed by GitHub
parent c5833e6b6f
commit 7efe1e28a8
88 changed files with 982 additions and 5380 deletions
+5 -5
View File
@@ -3,7 +3,7 @@ module github.com/dexidp/dex
go 1.18
require (
entgo.io/ent v0.10.1
entgo.io/ent v0.11.2
github.com/AppsFlyer/go-sundheit v0.5.0
github.com/Masterminds/semver v1.5.0
github.com/Masterminds/sprig/v3 v3.2.2
@@ -18,7 +18,7 @@ require (
github.com/gorilla/mux v1.8.0
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/kylelemons/godebug v1.1.0
github.com/lib/pq v1.10.4
github.com/lib/pq v1.10.5
github.com/mattermost/xml-roundtrip-validator v0.1.0
github.com/mattn/go-sqlite3 v1.14.15
github.com/oklog/run v1.1.0
@@ -40,7 +40,7 @@ require (
)
require (
ariga.io/atlas v0.3.7-0.20220303204946-787354f533c3 // indirect
ariga.io/atlas v0.5.1-0.20220717122844-8593d7eb1a8e // indirect
cloud.google.com/go/compute v1.7.0 // indirect
github.com/Azure/go-ntlmssp v0.0.0-20220621081337-cb9428e4ac1e // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
@@ -83,8 +83,8 @@ require (
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.17.0 // indirect
golang.org/x/mod v0.5.1 // indirect
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f // indirect
+13 -9
View File
@@ -1,5 +1,5 @@
ariga.io/atlas v0.3.7-0.20220303204946-787354f533c3 h1:fjG4oFCQEfGrRi0QoxWcH2OO28CE6VYa6DkIr3yDySU=
ariga.io/atlas v0.3.7-0.20220303204946-787354f533c3/go.mod h1:yWGf4VPiD4SW83+kAqzD624txN9VKoJC+bpVXr2pKJA=
ariga.io/atlas v0.5.1-0.20220717122844-8593d7eb1a8e h1:/r1xGMwmLg4LZ2V3/wWui9TtM3+STh1fp5ExSVRNFZo=
ariga.io/atlas v0.5.1-0.20220717122844-8593d7eb1a8e/go.mod h1:ofVetkJqlaWle3mvYmaS2uyFGFcc7dSq436tmxa/Mzk=
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
@@ -57,8 +57,8 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
entgo.io/ent v0.10.1 h1:dM5h4Zk6yHGIgw4dCqVzGw3nWgpGYJiV4/kyHEF6PFo=
entgo.io/ent v0.10.1/go.mod h1:YPgxeLnoQ/YdpVORRtqjBF+wCy9NX9IR7veTv3Bffus=
entgo.io/ent v0.11.2 h1:UM2/BUhF2FfsxPHRxLjQbhqJNaDdVlOwNIAMLs2jyto=
entgo.io/ent v0.11.2/go.mod h1:YGHEQnmmIUgtD5b1ICD5vg74dS3npkNnmC5K+0J+IHU=
github.com/AppsFlyer/go-sundheit v0.5.0 h1:/VxpyigCfJrq1r97mn9HPiAB2qrhcTFHwNIIDr15CZM=
github.com/AppsFlyer/go-sundheit v0.5.0/go.mod h1:2ZM0BnfqT/mljBQO224VbL5XH06TgWuQ6Cn+cTtCpTY=
github.com/Azure/go-ntlmssp v0.0.0-20220621081337-cb9428e4ac1e h1:NeAW1fUYUEWhft7pkxDf6WoUvEZJ/uOKsvtpjLnn8MU=
@@ -300,10 +300,11 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/lib/pq v1.10.4 h1:SO9z7FRPzA03QhHKJrH5BXA6HU1rS4V2nIVrrNC1iYk=
github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/lib/pq v1.10.5 h1:J+gdV2cUmX7ZqL2B0lFcW0m+egaHC2V3lpO8nWxyYiQ=
github.com/lib/pq v1.10.5/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/mattermost/xml-roundtrip-validator v0.1.0 h1:RXbVD2UAl7A7nOTR4u7E3ILa4IbtvKBHw64LDsmu9hU=
github.com/mattermost/xml-roundtrip-validator v0.1.0/go.mod h1:qccnGMcpgwcNaBnxqpJpWWUiPNr5H3O8eDgGV9gT5To=
github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
github.com/mattn/go-sqlite3 v1.14.15 h1:vfoHhTN1af61xCRSWzFIWzx2YskyMTwHLrExkBOjvxI=
github.com/mattn/go-sqlite3 v1.14.15/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg=
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
@@ -323,6 +324,7 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA=
github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU=
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
@@ -475,8 +477,8 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.5.1 h1:OJxoQ/rynoF0dcCdI7cLPktw/hR2cueqYfjm43oqK38=
golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -630,8 +632,9 @@ golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 h1:0A+M6Uqn+Eje4kHMK80dtF3JCXC4ykBgQG4Fe06QRhQ=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -700,6 +703,7 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.13-0.20220804200503-81c7dc4e4efa h1:uKcci2q7Qtp6nMTC/AAvfNUAldFtJuHWV9/5QWiypts=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+33 -19
View File
@@ -1,4 +1,4 @@
// Code generated by entc, DO NOT EDIT.
// Code generated by ent, DO NOT EDIT.
package db
@@ -192,11 +192,11 @@ func (ac *AuthCode) Update() *AuthCodeUpdateOne {
// Unwrap unwraps the AuthCode entity that was returned from a transaction after it was closed,
// so that all future queries will be executed through the driver which created the transaction.
func (ac *AuthCode) Unwrap() *AuthCode {
tx, ok := ac.config.driver.(*txDriver)
_tx, ok := ac.config.driver.(*txDriver)
if !ok {
panic("db: AuthCode is not a transactional entity")
}
ac.config.driver = tx.drv
ac.config.driver = _tx.drv
return ac
}
@@ -204,38 +204,52 @@ func (ac *AuthCode) Unwrap() *AuthCode {
func (ac *AuthCode) String() string {
var builder strings.Builder
builder.WriteString("AuthCode(")
builder.WriteString(fmt.Sprintf("id=%v", ac.ID))
builder.WriteString(", client_id=")
builder.WriteString(fmt.Sprintf("id=%v, ", ac.ID))
builder.WriteString("client_id=")
builder.WriteString(ac.ClientID)
builder.WriteString(", scopes=")
builder.WriteString(", ")
builder.WriteString("scopes=")
builder.WriteString(fmt.Sprintf("%v", ac.Scopes))
builder.WriteString(", nonce=")
builder.WriteString(", ")
builder.WriteString("nonce=")
builder.WriteString(ac.Nonce)
builder.WriteString(", redirect_uri=")
builder.WriteString(", ")
builder.WriteString("redirect_uri=")
builder.WriteString(ac.RedirectURI)
builder.WriteString(", claims_user_id=")
builder.WriteString(", ")
builder.WriteString("claims_user_id=")
builder.WriteString(ac.ClaimsUserID)
builder.WriteString(", claims_username=")
builder.WriteString(", ")
builder.WriteString("claims_username=")
builder.WriteString(ac.ClaimsUsername)
builder.WriteString(", claims_email=")
builder.WriteString(", ")
builder.WriteString("claims_email=")
builder.WriteString(ac.ClaimsEmail)
builder.WriteString(", claims_email_verified=")
builder.WriteString(", ")
builder.WriteString("claims_email_verified=")
builder.WriteString(fmt.Sprintf("%v", ac.ClaimsEmailVerified))
builder.WriteString(", claims_groups=")
builder.WriteString(", ")
builder.WriteString("claims_groups=")
builder.WriteString(fmt.Sprintf("%v", ac.ClaimsGroups))
builder.WriteString(", claims_preferred_username=")
builder.WriteString(", ")
builder.WriteString("claims_preferred_username=")
builder.WriteString(ac.ClaimsPreferredUsername)
builder.WriteString(", connector_id=")
builder.WriteString(", ")
builder.WriteString("connector_id=")
builder.WriteString(ac.ConnectorID)
builder.WriteString(", ")
if v := ac.ConnectorData; v != nil {
builder.WriteString(", connector_data=")
builder.WriteString("connector_data=")
builder.WriteString(fmt.Sprintf("%v", *v))
}
builder.WriteString(", expiry=")
builder.WriteString(", ")
builder.WriteString("expiry=")
builder.WriteString(ac.Expiry.Format(time.ANSIC))
builder.WriteString(", code_challenge=")
builder.WriteString(", ")
builder.WriteString("code_challenge=")
builder.WriteString(ac.CodeChallenge)
builder.WriteString(", code_challenge_method=")
builder.WriteString(", ")
builder.WriteString("code_challenge_method=")
builder.WriteString(ac.CodeChallengeMethod)
builder.WriteByte(')')
return builder.String()
+1 -1
View File
@@ -1,4 +1,4 @@
// Code generated by entc, DO NOT EDIT.
// Code generated by ent, DO NOT EDIT.
package authcode
+1 -157
View File
@@ -1,4 +1,4 @@
// Code generated by entc, DO NOT EDIT.
// Code generated by ent, DO NOT EDIT.
package authcode
@@ -33,12 +33,6 @@ func IDNEQ(id string) predicate.AuthCode {
// IDIn applies the In predicate on the ID field.
func IDIn(ids ...string) predicate.AuthCode {
return predicate.AuthCode(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(ids) == 0 {
s.Where(sql.False())
return
}
v := make([]interface{}, len(ids))
for i := range v {
v[i] = ids[i]
@@ -50,12 +44,6 @@ func IDIn(ids ...string) predicate.AuthCode {
// IDNotIn applies the NotIn predicate on the ID field.
func IDNotIn(ids ...string) predicate.AuthCode {
return predicate.AuthCode(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(ids) == 0 {
s.Where(sql.False())
return
}
v := make([]interface{}, len(ids))
for i := range v {
v[i] = ids[i]
@@ -204,12 +192,6 @@ func ClientIDIn(vs ...string) predicate.AuthCode {
v[i] = vs[i]
}
return predicate.AuthCode(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldClientID), v...))
})
}
@@ -221,12 +203,6 @@ func ClientIDNotIn(vs ...string) predicate.AuthCode {
v[i] = vs[i]
}
return predicate.AuthCode(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldClientID), v...))
})
}
@@ -329,12 +305,6 @@ func NonceIn(vs ...string) predicate.AuthCode {
v[i] = vs[i]
}
return predicate.AuthCode(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldNonce), v...))
})
}
@@ -346,12 +316,6 @@ func NonceNotIn(vs ...string) predicate.AuthCode {
v[i] = vs[i]
}
return predicate.AuthCode(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldNonce), v...))
})
}
@@ -440,12 +404,6 @@ func RedirectURIIn(vs ...string) predicate.AuthCode {
v[i] = vs[i]
}
return predicate.AuthCode(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldRedirectURI), v...))
})
}
@@ -457,12 +415,6 @@ func RedirectURINotIn(vs ...string) predicate.AuthCode {
v[i] = vs[i]
}
return predicate.AuthCode(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldRedirectURI), v...))
})
}
@@ -551,12 +503,6 @@ func ClaimsUserIDIn(vs ...string) predicate.AuthCode {
v[i] = vs[i]
}
return predicate.AuthCode(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldClaimsUserID), v...))
})
}
@@ -568,12 +514,6 @@ func ClaimsUserIDNotIn(vs ...string) predicate.AuthCode {
v[i] = vs[i]
}
return predicate.AuthCode(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldClaimsUserID), v...))
})
}
@@ -662,12 +602,6 @@ func ClaimsUsernameIn(vs ...string) predicate.AuthCode {
v[i] = vs[i]
}
return predicate.AuthCode(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldClaimsUsername), v...))
})
}
@@ -679,12 +613,6 @@ func ClaimsUsernameNotIn(vs ...string) predicate.AuthCode {
v[i] = vs[i]
}
return predicate.AuthCode(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldClaimsUsername), v...))
})
}
@@ -773,12 +701,6 @@ func ClaimsEmailIn(vs ...string) predicate.AuthCode {
v[i] = vs[i]
}
return predicate.AuthCode(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldClaimsEmail), v...))
})
}
@@ -790,12 +712,6 @@ func ClaimsEmailNotIn(vs ...string) predicate.AuthCode {
v[i] = vs[i]
}
return predicate.AuthCode(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldClaimsEmail), v...))
})
}
@@ -912,12 +828,6 @@ func ClaimsPreferredUsernameIn(vs ...string) predicate.AuthCode {
v[i] = vs[i]
}
return predicate.AuthCode(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldClaimsPreferredUsername), v...))
})
}
@@ -929,12 +839,6 @@ func ClaimsPreferredUsernameNotIn(vs ...string) predicate.AuthCode {
v[i] = vs[i]
}
return predicate.AuthCode(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldClaimsPreferredUsername), v...))
})
}
@@ -1023,12 +927,6 @@ func ConnectorIDIn(vs ...string) predicate.AuthCode {
v[i] = vs[i]
}
return predicate.AuthCode(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldConnectorID), v...))
})
}
@@ -1040,12 +938,6 @@ func ConnectorIDNotIn(vs ...string) predicate.AuthCode {
v[i] = vs[i]
}
return predicate.AuthCode(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldConnectorID), v...))
})
}
@@ -1134,12 +1026,6 @@ func ConnectorDataIn(vs ...[]byte) predicate.AuthCode {
v[i] = vs[i]
}
return predicate.AuthCode(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldConnectorData), v...))
})
}
@@ -1151,12 +1037,6 @@ func ConnectorDataNotIn(vs ...[]byte) predicate.AuthCode {
v[i] = vs[i]
}
return predicate.AuthCode(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldConnectorData), v...))
})
}
@@ -1224,12 +1104,6 @@ func ExpiryIn(vs ...time.Time) predicate.AuthCode {
v[i] = vs[i]
}
return predicate.AuthCode(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldExpiry), v...))
})
}
@@ -1241,12 +1115,6 @@ func ExpiryNotIn(vs ...time.Time) predicate.AuthCode {
v[i] = vs[i]
}
return predicate.AuthCode(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldExpiry), v...))
})
}
@@ -1300,12 +1168,6 @@ func CodeChallengeIn(vs ...string) predicate.AuthCode {
v[i] = vs[i]
}
return predicate.AuthCode(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldCodeChallenge), v...))
})
}
@@ -1317,12 +1179,6 @@ func CodeChallengeNotIn(vs ...string) predicate.AuthCode {
v[i] = vs[i]
}
return predicate.AuthCode(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldCodeChallenge), v...))
})
}
@@ -1411,12 +1267,6 @@ func CodeChallengeMethodIn(vs ...string) predicate.AuthCode {
v[i] = vs[i]
}
return predicate.AuthCode(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldCodeChallengeMethod), v...))
})
}
@@ -1428,12 +1278,6 @@ func CodeChallengeMethodNotIn(vs ...string) predicate.AuthCode {
v[i] = vs[i]
}
return predicate.AuthCode(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldCodeChallengeMethod), v...))
})
}
+10 -4
View File
@@ -1,4 +1,4 @@
// Code generated by entc, DO NOT EDIT.
// Code generated by ent, DO NOT EDIT.
package db
@@ -180,9 +180,15 @@ func (acc *AuthCodeCreate) Save(ctx context.Context) (*AuthCode, error) {
}
mut = acc.hooks[i](mut)
}
if _, err := mut.Mutate(ctx, acc.mutation); err != nil {
v, err := mut.Mutate(ctx, acc.mutation)
if err != nil {
return nil, err
}
nv, ok := v.(*AuthCode)
if !ok {
return nil, fmt.Errorf("unexpected node type %T returned from AuthCodeMutation", v)
}
node = nv
}
return node, err
}
@@ -310,7 +316,7 @@ func (acc *AuthCodeCreate) sqlSave(ctx context.Context) (*AuthCode, error) {
_node, _spec := acc.createSpec()
if err := sqlgraph.CreateNode(ctx, acc.driver, _spec); err != nil {
if sqlgraph.IsConstraintError(err) {
err = &ConstraintError{err.Error(), err}
err = &ConstraintError{msg: err.Error(), wrap: err}
}
return nil, err
}
@@ -495,7 +501,7 @@ func (accb *AuthCodeCreateBulk) Save(ctx context.Context) ([]*AuthCode, error) {
// Invoke the actual operation on the latest mutation in the chain.
if err = sqlgraph.BatchCreate(ctx, accb.driver, spec); err != nil {
if sqlgraph.IsConstraintError(err) {
err = &ConstraintError{err.Error(), err}
err = &ConstraintError{msg: err.Error(), wrap: err}
}
}
}
+6 -2
View File
@@ -1,4 +1,4 @@
// Code generated by entc, DO NOT EDIT.
// Code generated by ent, DO NOT EDIT.
package db
@@ -84,7 +84,11 @@ func (acd *AuthCodeDelete) sqlExec(ctx context.Context) (int, error) {
}
}
}
return sqlgraph.DeleteNodes(ctx, acd.driver, _spec)
affected, err := sqlgraph.DeleteNodes(ctx, acd.driver, _spec)
if err != nil && sqlgraph.IsConstraintError(err) {
err = &ConstraintError{msg: err.Error(), wrap: err}
}
return affected, err
}
// AuthCodeDeleteOne is the builder for deleting a single AuthCode entity.
+20 -413
View File
@@ -1,10 +1,9 @@
// Code generated by entc, DO NOT EDIT.
// Code generated by ent, DO NOT EDIT.
package db
import (
"context"
"errors"
"fmt"
"math"
@@ -264,15 +263,17 @@ func (acq *AuthCodeQuery) Clone() *AuthCodeQuery {
// Scan(ctx, &v)
//
func (acq *AuthCodeQuery) GroupBy(field string, fields ...string) *AuthCodeGroupBy {
group := &AuthCodeGroupBy{config: acq.config}
group.fields = append([]string{field}, fields...)
group.path = func(ctx context.Context) (prev *sql.Selector, err error) {
grbuild := &AuthCodeGroupBy{config: acq.config}
grbuild.fields = append([]string{field}, fields...)
grbuild.path = func(ctx context.Context) (prev *sql.Selector, err error) {
if err := acq.prepareQuery(ctx); err != nil {
return nil, err
}
return acq.sqlQuery(ctx), nil
}
return group
grbuild.label = authcode.Label
grbuild.flds, grbuild.scan = &grbuild.fields, grbuild.Scan
return grbuild
}
// Select allows the selection one or more fields/columns for the given query,
@@ -290,7 +291,10 @@ func (acq *AuthCodeQuery) GroupBy(field string, fields ...string) *AuthCodeGroup
//
func (acq *AuthCodeQuery) Select(fields ...string) *AuthCodeSelect {
acq.fields = append(acq.fields, fields...)
return &AuthCodeSelect{AuthCodeQuery: acq}
selbuild := &AuthCodeSelect{AuthCodeQuery: acq}
selbuild.label = authcode.Label
selbuild.flds, selbuild.scan = &acq.fields, selbuild.Scan
return selbuild
}
func (acq *AuthCodeQuery) prepareQuery(ctx context.Context) error {
@@ -309,23 +313,22 @@ func (acq *AuthCodeQuery) prepareQuery(ctx context.Context) error {
return nil
}
func (acq *AuthCodeQuery) sqlAll(ctx context.Context) ([]*AuthCode, error) {
func (acq *AuthCodeQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*AuthCode, error) {
var (
nodes = []*AuthCode{}
_spec = acq.querySpec()
)
_spec.ScanValues = func(columns []string) ([]interface{}, error) {
node := &AuthCode{config: acq.config}
nodes = append(nodes, node)
return node.scanValues(columns)
return (*AuthCode).scanValues(nil, columns)
}
_spec.Assign = func(columns []string, values []interface{}) error {
if len(nodes) == 0 {
return fmt.Errorf("db: Assign called without calling ScanValues")
}
node := nodes[len(nodes)-1]
node := &AuthCode{config: acq.config}
nodes = append(nodes, node)
return node.assignValues(columns, values)
}
for i := range hooks {
hooks[i](ctx, _spec)
}
if err := sqlgraph.QueryNodes(ctx, acq.driver, _spec); err != nil {
return nil, err
}
@@ -435,6 +438,7 @@ func (acq *AuthCodeQuery) sqlQuery(ctx context.Context) *sql.Selector {
// AuthCodeGroupBy is the group-by builder for AuthCode entities.
type AuthCodeGroupBy struct {
config
selector
fields []string
fns []AggregateFunc
// intermediate query (i.e. traversal path).
@@ -458,209 +462,6 @@ func (acgb *AuthCodeGroupBy) Scan(ctx context.Context, v interface{}) error {
return acgb.sqlScan(ctx, v)
}
// ScanX is like Scan, but panics if an error occurs.
func (acgb *AuthCodeGroupBy) ScanX(ctx context.Context, v interface{}) {
if err := acgb.Scan(ctx, v); err != nil {
panic(err)
}
}
// Strings returns list of strings from group-by.
// It is only allowed when executing a group-by query with one field.
func (acgb *AuthCodeGroupBy) Strings(ctx context.Context) ([]string, error) {
if len(acgb.fields) > 1 {
return nil, errors.New("db: AuthCodeGroupBy.Strings is not achievable when grouping more than 1 field")
}
var v []string
if err := acgb.Scan(ctx, &v); err != nil {
return nil, err
}
return v, nil
}
// StringsX is like Strings, but panics if an error occurs.
func (acgb *AuthCodeGroupBy) StringsX(ctx context.Context) []string {
v, err := acgb.Strings(ctx)
if err != nil {
panic(err)
}
return v
}
// String returns a single string from a group-by query.
// It is only allowed when executing a group-by query with one field.
func (acgb *AuthCodeGroupBy) String(ctx context.Context) (_ string, err error) {
var v []string
if v, err = acgb.Strings(ctx); err != nil {
return
}
switch len(v) {
case 1:
return v[0], nil
case 0:
err = &NotFoundError{authcode.Label}
default:
err = fmt.Errorf("db: AuthCodeGroupBy.Strings returned %d results when one was expected", len(v))
}
return
}
// StringX is like String, but panics if an error occurs.
func (acgb *AuthCodeGroupBy) StringX(ctx context.Context) string {
v, err := acgb.String(ctx)
if err != nil {
panic(err)
}
return v
}
// Ints returns list of ints from group-by.
// It is only allowed when executing a group-by query with one field.
func (acgb *AuthCodeGroupBy) Ints(ctx context.Context) ([]int, error) {
if len(acgb.fields) > 1 {
return nil, errors.New("db: AuthCodeGroupBy.Ints is not achievable when grouping more than 1 field")
}
var v []int
if err := acgb.Scan(ctx, &v); err != nil {
return nil, err
}
return v, nil
}
// IntsX is like Ints, but panics if an error occurs.
func (acgb *AuthCodeGroupBy) IntsX(ctx context.Context) []int {
v, err := acgb.Ints(ctx)
if err != nil {
panic(err)
}
return v
}
// Int returns a single int from a group-by query.
// It is only allowed when executing a group-by query with one field.
func (acgb *AuthCodeGroupBy) Int(ctx context.Context) (_ int, err error) {
var v []int
if v, err = acgb.Ints(ctx); err != nil {
return
}
switch len(v) {
case 1:
return v[0], nil
case 0:
err = &NotFoundError{authcode.Label}
default:
err = fmt.Errorf("db: AuthCodeGroupBy.Ints returned %d results when one was expected", len(v))
}
return
}
// IntX is like Int, but panics if an error occurs.
func (acgb *AuthCodeGroupBy) IntX(ctx context.Context) int {
v, err := acgb.Int(ctx)
if err != nil {
panic(err)
}
return v
}
// Float64s returns list of float64s from group-by.
// It is only allowed when executing a group-by query with one field.
func (acgb *AuthCodeGroupBy) Float64s(ctx context.Context) ([]float64, error) {
if len(acgb.fields) > 1 {
return nil, errors.New("db: AuthCodeGroupBy.Float64s is not achievable when grouping more than 1 field")
}
var v []float64
if err := acgb.Scan(ctx, &v); err != nil {
return nil, err
}
return v, nil
}
// Float64sX is like Float64s, but panics if an error occurs.
func (acgb *AuthCodeGroupBy) Float64sX(ctx context.Context) []float64 {
v, err := acgb.Float64s(ctx)
if err != nil {
panic(err)
}
return v
}
// Float64 returns a single float64 from a group-by query.
// It is only allowed when executing a group-by query with one field.
func (acgb *AuthCodeGroupBy) Float64(ctx context.Context) (_ float64, err error) {
var v []float64
if v, err = acgb.Float64s(ctx); err != nil {
return
}
switch len(v) {
case 1:
return v[0], nil
case 0:
err = &NotFoundError{authcode.Label}
default:
err = fmt.Errorf("db: AuthCodeGroupBy.Float64s returned %d results when one was expected", len(v))
}
return
}
// Float64X is like Float64, but panics if an error occurs.
func (acgb *AuthCodeGroupBy) Float64X(ctx context.Context) float64 {
v, err := acgb.Float64(ctx)
if err != nil {
panic(err)
}
return v
}
// Bools returns list of bools from group-by.
// It is only allowed when executing a group-by query with one field.
func (acgb *AuthCodeGroupBy) Bools(ctx context.Context) ([]bool, error) {
if len(acgb.fields) > 1 {
return nil, errors.New("db: AuthCodeGroupBy.Bools is not achievable when grouping more than 1 field")
}
var v []bool
if err := acgb.Scan(ctx, &v); err != nil {
return nil, err
}
return v, nil
}
// BoolsX is like Bools, but panics if an error occurs.
func (acgb *AuthCodeGroupBy) BoolsX(ctx context.Context) []bool {
v, err := acgb.Bools(ctx)
if err != nil {
panic(err)
}
return v
}
// Bool returns a single bool from a group-by query.
// It is only allowed when executing a group-by query with one field.
func (acgb *AuthCodeGroupBy) Bool(ctx context.Context) (_ bool, err error) {
var v []bool
if v, err = acgb.Bools(ctx); err != nil {
return
}
switch len(v) {
case 1:
return v[0], nil
case 0:
err = &NotFoundError{authcode.Label}
default:
err = fmt.Errorf("db: AuthCodeGroupBy.Bools returned %d results when one was expected", len(v))
}
return
}
// BoolX is like Bool, but panics if an error occurs.
func (acgb *AuthCodeGroupBy) BoolX(ctx context.Context) bool {
v, err := acgb.Bool(ctx)
if err != nil {
panic(err)
}
return v
}
func (acgb *AuthCodeGroupBy) sqlScan(ctx context.Context, v interface{}) error {
for _, f := range acgb.fields {
if !authcode.ValidColumn(f) {
@@ -702,6 +503,7 @@ func (acgb *AuthCodeGroupBy) sqlQuery() *sql.Selector {
// AuthCodeSelect is the builder for selecting fields of AuthCode entities.
type AuthCodeSelect struct {
*AuthCodeQuery
selector
// intermediate query (i.e. traversal path).
sql *sql.Selector
}
@@ -715,201 +517,6 @@ func (acs *AuthCodeSelect) Scan(ctx context.Context, v interface{}) error {
return acs.sqlScan(ctx, v)
}
// ScanX is like Scan, but panics if an error occurs.
func (acs *AuthCodeSelect) ScanX(ctx context.Context, v interface{}) {
if err := acs.Scan(ctx, v); err != nil {
panic(err)
}
}
// Strings returns list of strings from a selector. It is only allowed when selecting one field.
func (acs *AuthCodeSelect) Strings(ctx context.Context) ([]string, error) {
if len(acs.fields) > 1 {
return nil, errors.New("db: AuthCodeSelect.Strings is not achievable when selecting more than 1 field")
}
var v []string
if err := acs.Scan(ctx, &v); err != nil {
return nil, err
}
return v, nil
}
// StringsX is like Strings, but panics if an error occurs.
func (acs *AuthCodeSelect) StringsX(ctx context.Context) []string {
v, err := acs.Strings(ctx)
if err != nil {
panic(err)
}
return v
}
// String returns a single string from a selector. It is only allowed when selecting one field.
func (acs *AuthCodeSelect) String(ctx context.Context) (_ string, err error) {
var v []string
if v, err = acs.Strings(ctx); err != nil {
return
}
switch len(v) {
case 1:
return v[0], nil
case 0:
err = &NotFoundError{authcode.Label}
default:
err = fmt.Errorf("db: AuthCodeSelect.Strings returned %d results when one was expected", len(v))
}
return
}
// StringX is like String, but panics if an error occurs.
func (acs *AuthCodeSelect) StringX(ctx context.Context) string {
v, err := acs.String(ctx)
if err != nil {
panic(err)
}
return v
}
// Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (acs *AuthCodeSelect) Ints(ctx context.Context) ([]int, error) {
if len(acs.fields) > 1 {
return nil, errors.New("db: AuthCodeSelect.Ints is not achievable when selecting more than 1 field")
}
var v []int
if err := acs.Scan(ctx, &v); err != nil {
return nil, err
}
return v, nil
}
// IntsX is like Ints, but panics if an error occurs.
func (acs *AuthCodeSelect) IntsX(ctx context.Context) []int {
v, err := acs.Ints(ctx)
if err != nil {
panic(err)
}
return v
}
// Int returns a single int from a selector. It is only allowed when selecting one field.
func (acs *AuthCodeSelect) Int(ctx context.Context) (_ int, err error) {
var v []int
if v, err = acs.Ints(ctx); err != nil {
return
}
switch len(v) {
case 1:
return v[0], nil
case 0:
err = &NotFoundError{authcode.Label}
default:
err = fmt.Errorf("db: AuthCodeSelect.Ints returned %d results when one was expected", len(v))
}
return
}
// IntX is like Int, but panics if an error occurs.
func (acs *AuthCodeSelect) IntX(ctx context.Context) int {
v, err := acs.Int(ctx)
if err != nil {
panic(err)
}
return v
}
// Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (acs *AuthCodeSelect) Float64s(ctx context.Context) ([]float64, error) {
if len(acs.fields) > 1 {
return nil, errors.New("db: AuthCodeSelect.Float64s is not achievable when selecting more than 1 field")
}
var v []float64
if err := acs.Scan(ctx, &v); err != nil {
return nil, err
}
return v, nil
}
// Float64sX is like Float64s, but panics if an error occurs.
func (acs *AuthCodeSelect) Float64sX(ctx context.Context) []float64 {
v, err := acs.Float64s(ctx)
if err != nil {
panic(err)
}
return v
}
// Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (acs *AuthCodeSelect) Float64(ctx context.Context) (_ float64, err error) {
var v []float64
if v, err = acs.Float64s(ctx); err != nil {
return
}
switch len(v) {
case 1:
return v[0], nil
case 0:
err = &NotFoundError{authcode.Label}
default:
err = fmt.Errorf("db: AuthCodeSelect.Float64s returned %d results when one was expected", len(v))
}
return
}
// Float64X is like Float64, but panics if an error occurs.
func (acs *AuthCodeSelect) Float64X(ctx context.Context) float64 {
v, err := acs.Float64(ctx)
if err != nil {
panic(err)
}
return v
}
// Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (acs *AuthCodeSelect) Bools(ctx context.Context) ([]bool, error) {
if len(acs.fields) > 1 {
return nil, errors.New("db: AuthCodeSelect.Bools is not achievable when selecting more than 1 field")
}
var v []bool
if err := acs.Scan(ctx, &v); err != nil {
return nil, err
}
return v, nil
}
// BoolsX is like Bools, but panics if an error occurs.
func (acs *AuthCodeSelect) BoolsX(ctx context.Context) []bool {
v, err := acs.Bools(ctx)
if err != nil {
panic(err)
}
return v
}
// Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (acs *AuthCodeSelect) Bool(ctx context.Context) (_ bool, err error) {
var v []bool
if v, err = acs.Bools(ctx); err != nil {
return
}
switch len(v) {
case 1:
return v[0], nil
case 0:
err = &NotFoundError{authcode.Label}
default:
err = fmt.Errorf("db: AuthCodeSelect.Bools returned %d results when one was expected", len(v))
}
return
}
// BoolX is like Bool, but panics if an error occurs.
func (acs *AuthCodeSelect) BoolX(ctx context.Context) bool {
v, err := acs.Bool(ctx)
if err != nil {
panic(err)
}
return v
}
func (acs *AuthCodeSelect) sqlScan(ctx context.Context, v interface{}) error {
rows := &sql.Rows{}
query, args := acs.sql.Query()
+10 -4
View File
@@ -1,4 +1,4 @@
// Code generated by entc, DO NOT EDIT.
// Code generated by ent, DO NOT EDIT.
package db
@@ -410,7 +410,7 @@ func (acu *AuthCodeUpdate) sqlSave(ctx context.Context) (n int, err error) {
if _, ok := err.(*sqlgraph.NotFoundError); ok {
err = &NotFoundError{authcode.Label}
} else if sqlgraph.IsConstraintError(err) {
err = &ConstraintError{err.Error(), err}
err = &ConstraintError{msg: err.Error(), wrap: err}
}
return 0, err
}
@@ -600,9 +600,15 @@ func (acuo *AuthCodeUpdateOne) Save(ctx context.Context) (*AuthCode, error) {
}
mut = acuo.hooks[i](mut)
}
if _, err := mut.Mutate(ctx, acuo.mutation); err != nil {
v, err := mut.Mutate(ctx, acuo.mutation)
if err != nil {
return nil, err
}
nv, ok := v.(*AuthCode)
if !ok {
return nil, fmt.Errorf("unexpected node type %T returned from AuthCodeMutation", v)
}
node = nv
}
return node, err
}
@@ -834,7 +840,7 @@ func (acuo *AuthCodeUpdateOne) sqlSave(ctx context.Context) (_node *AuthCode, er
if _, ok := err.(*sqlgraph.NotFoundError); ok {
err = &NotFoundError{authcode.Label}
} else if sqlgraph.IsConstraintError(err) {
err = &ConstraintError{err.Error(), err}
err = &ConstraintError{msg: err.Error(), wrap: err}
}
return nil, err
}
+41 -23
View File
@@ -1,4 +1,4 @@
// Code generated by entc, DO NOT EDIT.
// Code generated by ent, DO NOT EDIT.
package db
@@ -226,11 +226,11 @@ func (ar *AuthRequest) Update() *AuthRequestUpdateOne {
// Unwrap unwraps the AuthRequest entity that was returned from a transaction after it was closed,
// so that all future queries will be executed through the driver which created the transaction.
func (ar *AuthRequest) Unwrap() *AuthRequest {
tx, ok := ar.config.driver.(*txDriver)
_tx, ok := ar.config.driver.(*txDriver)
if !ok {
panic("db: AuthRequest is not a transactional entity")
}
ar.config.driver = tx.drv
ar.config.driver = _tx.drv
return ar
}
@@ -238,46 +238,64 @@ func (ar *AuthRequest) Unwrap() *AuthRequest {
func (ar *AuthRequest) String() string {
var builder strings.Builder
builder.WriteString("AuthRequest(")
builder.WriteString(fmt.Sprintf("id=%v", ar.ID))
builder.WriteString(", client_id=")
builder.WriteString(fmt.Sprintf("id=%v, ", ar.ID))
builder.WriteString("client_id=")
builder.WriteString(ar.ClientID)
builder.WriteString(", scopes=")
builder.WriteString(", ")
builder.WriteString("scopes=")
builder.WriteString(fmt.Sprintf("%v", ar.Scopes))
builder.WriteString(", response_types=")
builder.WriteString(", ")
builder.WriteString("response_types=")
builder.WriteString(fmt.Sprintf("%v", ar.ResponseTypes))
builder.WriteString(", redirect_uri=")
builder.WriteString(", ")
builder.WriteString("redirect_uri=")
builder.WriteString(ar.RedirectURI)
builder.WriteString(", nonce=")
builder.WriteString(", ")
builder.WriteString("nonce=")
builder.WriteString(ar.Nonce)
builder.WriteString(", state=")
builder.WriteString(", ")
builder.WriteString("state=")
builder.WriteString(ar.State)
builder.WriteString(", force_approval_prompt=")
builder.WriteString(", ")
builder.WriteString("force_approval_prompt=")
builder.WriteString(fmt.Sprintf("%v", ar.ForceApprovalPrompt))
builder.WriteString(", logged_in=")
builder.WriteString(", ")
builder.WriteString("logged_in=")
builder.WriteString(fmt.Sprintf("%v", ar.LoggedIn))
builder.WriteString(", claims_user_id=")
builder.WriteString(", ")
builder.WriteString("claims_user_id=")
builder.WriteString(ar.ClaimsUserID)
builder.WriteString(", claims_username=")
builder.WriteString(", ")
builder.WriteString("claims_username=")
builder.WriteString(ar.ClaimsUsername)
builder.WriteString(", claims_email=")
builder.WriteString(", ")
builder.WriteString("claims_email=")
builder.WriteString(ar.ClaimsEmail)
builder.WriteString(", claims_email_verified=")
builder.WriteString(", ")
builder.WriteString("claims_email_verified=")
builder.WriteString(fmt.Sprintf("%v", ar.ClaimsEmailVerified))
builder.WriteString(", claims_groups=")
builder.WriteString(", ")
builder.WriteString("claims_groups=")
builder.WriteString(fmt.Sprintf("%v", ar.ClaimsGroups))
builder.WriteString(", claims_preferred_username=")
builder.WriteString(", ")
builder.WriteString("claims_preferred_username=")
builder.WriteString(ar.ClaimsPreferredUsername)
builder.WriteString(", connector_id=")
builder.WriteString(", ")
builder.WriteString("connector_id=")
builder.WriteString(ar.ConnectorID)
builder.WriteString(", ")
if v := ar.ConnectorData; v != nil {
builder.WriteString(", connector_data=")
builder.WriteString("connector_data=")
builder.WriteString(fmt.Sprintf("%v", *v))
}
builder.WriteString(", expiry=")
builder.WriteString(", ")
builder.WriteString("expiry=")
builder.WriteString(ar.Expiry.Format(time.ANSIC))
builder.WriteString(", code_challenge=")
builder.WriteString(", ")
builder.WriteString("code_challenge=")
builder.WriteString(ar.CodeChallenge)
builder.WriteString(", code_challenge_method=")
builder.WriteString(", ")
builder.WriteString("code_challenge_method=")
builder.WriteString(ar.CodeChallengeMethod)
builder.WriteByte(')')
return builder.String()
+1 -1
View File
@@ -1,4 +1,4 @@
// Code generated by entc, DO NOT EDIT.
// Code generated by ent, DO NOT EDIT.
package authrequest
+1 -169
View File
@@ -1,4 +1,4 @@
// Code generated by entc, DO NOT EDIT.
// Code generated by ent, DO NOT EDIT.
package authrequest
@@ -33,12 +33,6 @@ func IDNEQ(id string) predicate.AuthRequest {
// IDIn applies the In predicate on the ID field.
func IDIn(ids ...string) predicate.AuthRequest {
return predicate.AuthRequest(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(ids) == 0 {
s.Where(sql.False())
return
}
v := make([]interface{}, len(ids))
for i := range v {
v[i] = ids[i]
@@ -50,12 +44,6 @@ func IDIn(ids ...string) predicate.AuthRequest {
// IDNotIn applies the NotIn predicate on the ID field.
func IDNotIn(ids ...string) predicate.AuthRequest {
return predicate.AuthRequest(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(ids) == 0 {
s.Where(sql.False())
return
}
v := make([]interface{}, len(ids))
for i := range v {
v[i] = ids[i]
@@ -225,12 +213,6 @@ func ClientIDIn(vs ...string) predicate.AuthRequest {
v[i] = vs[i]
}
return predicate.AuthRequest(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldClientID), v...))
})
}
@@ -242,12 +224,6 @@ func ClientIDNotIn(vs ...string) predicate.AuthRequest {
v[i] = vs[i]
}
return predicate.AuthRequest(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldClientID), v...))
})
}
@@ -364,12 +340,6 @@ func RedirectURIIn(vs ...string) predicate.AuthRequest {
v[i] = vs[i]
}
return predicate.AuthRequest(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldRedirectURI), v...))
})
}
@@ -381,12 +351,6 @@ func RedirectURINotIn(vs ...string) predicate.AuthRequest {
v[i] = vs[i]
}
return predicate.AuthRequest(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldRedirectURI), v...))
})
}
@@ -475,12 +439,6 @@ func NonceIn(vs ...string) predicate.AuthRequest {
v[i] = vs[i]
}
return predicate.AuthRequest(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldNonce), v...))
})
}
@@ -492,12 +450,6 @@ func NonceNotIn(vs ...string) predicate.AuthRequest {
v[i] = vs[i]
}
return predicate.AuthRequest(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldNonce), v...))
})
}
@@ -586,12 +538,6 @@ func StateIn(vs ...string) predicate.AuthRequest {
v[i] = vs[i]
}
return predicate.AuthRequest(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldState), v...))
})
}
@@ -603,12 +549,6 @@ func StateNotIn(vs ...string) predicate.AuthRequest {
v[i] = vs[i]
}
return predicate.AuthRequest(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldState), v...))
})
}
@@ -725,12 +665,6 @@ func ClaimsUserIDIn(vs ...string) predicate.AuthRequest {
v[i] = vs[i]
}
return predicate.AuthRequest(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldClaimsUserID), v...))
})
}
@@ -742,12 +676,6 @@ func ClaimsUserIDNotIn(vs ...string) predicate.AuthRequest {
v[i] = vs[i]
}
return predicate.AuthRequest(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldClaimsUserID), v...))
})
}
@@ -836,12 +764,6 @@ func ClaimsUsernameIn(vs ...string) predicate.AuthRequest {
v[i] = vs[i]
}
return predicate.AuthRequest(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldClaimsUsername), v...))
})
}
@@ -853,12 +775,6 @@ func ClaimsUsernameNotIn(vs ...string) predicate.AuthRequest {
v[i] = vs[i]
}
return predicate.AuthRequest(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldClaimsUsername), v...))
})
}
@@ -947,12 +863,6 @@ func ClaimsEmailIn(vs ...string) predicate.AuthRequest {
v[i] = vs[i]
}
return predicate.AuthRequest(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldClaimsEmail), v...))
})
}
@@ -964,12 +874,6 @@ func ClaimsEmailNotIn(vs ...string) predicate.AuthRequest {
v[i] = vs[i]
}
return predicate.AuthRequest(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldClaimsEmail), v...))
})
}
@@ -1086,12 +990,6 @@ func ClaimsPreferredUsernameIn(vs ...string) predicate.AuthRequest {
v[i] = vs[i]
}
return predicate.AuthRequest(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldClaimsPreferredUsername), v...))
})
}
@@ -1103,12 +1001,6 @@ func ClaimsPreferredUsernameNotIn(vs ...string) predicate.AuthRequest {
v[i] = vs[i]
}
return predicate.AuthRequest(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldClaimsPreferredUsername), v...))
})
}
@@ -1197,12 +1089,6 @@ func ConnectorIDIn(vs ...string) predicate.AuthRequest {
v[i] = vs[i]
}
return predicate.AuthRequest(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldConnectorID), v...))
})
}
@@ -1214,12 +1100,6 @@ func ConnectorIDNotIn(vs ...string) predicate.AuthRequest {
v[i] = vs[i]
}
return predicate.AuthRequest(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldConnectorID), v...))
})
}
@@ -1308,12 +1188,6 @@ func ConnectorDataIn(vs ...[]byte) predicate.AuthRequest {
v[i] = vs[i]
}
return predicate.AuthRequest(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldConnectorData), v...))
})
}
@@ -1325,12 +1199,6 @@ func ConnectorDataNotIn(vs ...[]byte) predicate.AuthRequest {
v[i] = vs[i]
}
return predicate.AuthRequest(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldConnectorData), v...))
})
}
@@ -1398,12 +1266,6 @@ func ExpiryIn(vs ...time.Time) predicate.AuthRequest {
v[i] = vs[i]
}
return predicate.AuthRequest(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldExpiry), v...))
})
}
@@ -1415,12 +1277,6 @@ func ExpiryNotIn(vs ...time.Time) predicate.AuthRequest {
v[i] = vs[i]
}
return predicate.AuthRequest(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldExpiry), v...))
})
}
@@ -1474,12 +1330,6 @@ func CodeChallengeIn(vs ...string) predicate.AuthRequest {
v[i] = vs[i]
}
return predicate.AuthRequest(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldCodeChallenge), v...))
})
}
@@ -1491,12 +1341,6 @@ func CodeChallengeNotIn(vs ...string) predicate.AuthRequest {
v[i] = vs[i]
}
return predicate.AuthRequest(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldCodeChallenge), v...))
})
}
@@ -1585,12 +1429,6 @@ func CodeChallengeMethodIn(vs ...string) predicate.AuthRequest {
v[i] = vs[i]
}
return predicate.AuthRequest(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldCodeChallengeMethod), v...))
})
}
@@ -1602,12 +1440,6 @@ func CodeChallengeMethodNotIn(vs ...string) predicate.AuthRequest {
v[i] = vs[i]
}
return predicate.AuthRequest(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldCodeChallengeMethod), v...))
})
}
+10 -4
View File
@@ -1,4 +1,4 @@
// Code generated by entc, DO NOT EDIT.
// Code generated by ent, DO NOT EDIT.
package db
@@ -204,9 +204,15 @@ func (arc *AuthRequestCreate) Save(ctx context.Context) (*AuthRequest, error) {
}
mut = arc.hooks[i](mut)
}
if _, err := mut.Mutate(ctx, arc.mutation); err != nil {
v, err := mut.Mutate(ctx, arc.mutation)
if err != nil {
return nil, err
}
nv, ok := v.(*AuthRequest)
if !ok {
return nil, fmt.Errorf("unexpected node type %T returned from AuthRequestMutation", v)
}
node = nv
}
return node, err
}
@@ -308,7 +314,7 @@ func (arc *AuthRequestCreate) sqlSave(ctx context.Context) (*AuthRequest, error)
_node, _spec := arc.createSpec()
if err := sqlgraph.CreateNode(ctx, arc.driver, _spec); err != nil {
if sqlgraph.IsConstraintError(err) {
err = &ConstraintError{err.Error(), err}
err = &ConstraintError{msg: err.Error(), wrap: err}
}
return nil, err
}
@@ -525,7 +531,7 @@ func (arcb *AuthRequestCreateBulk) Save(ctx context.Context) ([]*AuthRequest, er
// Invoke the actual operation on the latest mutation in the chain.
if err = sqlgraph.BatchCreate(ctx, arcb.driver, spec); err != nil {
if sqlgraph.IsConstraintError(err) {
err = &ConstraintError{err.Error(), err}
err = &ConstraintError{msg: err.Error(), wrap: err}
}
}
}
+6 -2
View File
@@ -1,4 +1,4 @@
// Code generated by entc, DO NOT EDIT.
// Code generated by ent, DO NOT EDIT.
package db
@@ -84,7 +84,11 @@ func (ard *AuthRequestDelete) sqlExec(ctx context.Context) (int, error) {
}
}
}
return sqlgraph.DeleteNodes(ctx, ard.driver, _spec)
affected, err := sqlgraph.DeleteNodes(ctx, ard.driver, _spec)
if err != nil && sqlgraph.IsConstraintError(err) {
err = &ConstraintError{msg: err.Error(), wrap: err}
}
return affected, err
}
// AuthRequestDeleteOne is the builder for deleting a single AuthRequest entity.
+20 -413
View File
@@ -1,10 +1,9 @@
// Code generated by entc, DO NOT EDIT.
// Code generated by ent, DO NOT EDIT.
package db
import (
"context"
"errors"
"fmt"
"math"
@@ -264,15 +263,17 @@ func (arq *AuthRequestQuery) Clone() *AuthRequestQuery {
// Scan(ctx, &v)
//
func (arq *AuthRequestQuery) GroupBy(field string, fields ...string) *AuthRequestGroupBy {
group := &AuthRequestGroupBy{config: arq.config}
group.fields = append([]string{field}, fields...)
group.path = func(ctx context.Context) (prev *sql.Selector, err error) {
grbuild := &AuthRequestGroupBy{config: arq.config}
grbuild.fields = append([]string{field}, fields...)
grbuild.path = func(ctx context.Context) (prev *sql.Selector, err error) {
if err := arq.prepareQuery(ctx); err != nil {
return nil, err
}
return arq.sqlQuery(ctx), nil
}
return group
grbuild.label = authrequest.Label
grbuild.flds, grbuild.scan = &grbuild.fields, grbuild.Scan
return grbuild
}
// Select allows the selection one or more fields/columns for the given query,
@@ -290,7 +291,10 @@ func (arq *AuthRequestQuery) GroupBy(field string, fields ...string) *AuthReques
//
func (arq *AuthRequestQuery) Select(fields ...string) *AuthRequestSelect {
arq.fields = append(arq.fields, fields...)
return &AuthRequestSelect{AuthRequestQuery: arq}
selbuild := &AuthRequestSelect{AuthRequestQuery: arq}
selbuild.label = authrequest.Label
selbuild.flds, selbuild.scan = &arq.fields, selbuild.Scan
return selbuild
}
func (arq *AuthRequestQuery) prepareQuery(ctx context.Context) error {
@@ -309,23 +313,22 @@ func (arq *AuthRequestQuery) prepareQuery(ctx context.Context) error {
return nil
}
func (arq *AuthRequestQuery) sqlAll(ctx context.Context) ([]*AuthRequest, error) {
func (arq *AuthRequestQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*AuthRequest, error) {
var (
nodes = []*AuthRequest{}
_spec = arq.querySpec()
)
_spec.ScanValues = func(columns []string) ([]interface{}, error) {
node := &AuthRequest{config: arq.config}
nodes = append(nodes, node)
return node.scanValues(columns)
return (*AuthRequest).scanValues(nil, columns)
}
_spec.Assign = func(columns []string, values []interface{}) error {
if len(nodes) == 0 {
return fmt.Errorf("db: Assign called without calling ScanValues")
}
node := nodes[len(nodes)-1]
node := &AuthRequest{config: arq.config}
nodes = append(nodes, node)
return node.assignValues(columns, values)
}
for i := range hooks {
hooks[i](ctx, _spec)
}
if err := sqlgraph.QueryNodes(ctx, arq.driver, _spec); err != nil {
return nil, err
}
@@ -435,6 +438,7 @@ func (arq *AuthRequestQuery) sqlQuery(ctx context.Context) *sql.Selector {
// AuthRequestGroupBy is the group-by builder for AuthRequest entities.
type AuthRequestGroupBy struct {
config
selector
fields []string
fns []AggregateFunc
// intermediate query (i.e. traversal path).
@@ -458,209 +462,6 @@ func (argb *AuthRequestGroupBy) Scan(ctx context.Context, v interface{}) error {
return argb.sqlScan(ctx, v)
}
// ScanX is like Scan, but panics if an error occurs.
func (argb *AuthRequestGroupBy) ScanX(ctx context.Context, v interface{}) {
if err := argb.Scan(ctx, v); err != nil {
panic(err)
}
}
// Strings returns list of strings from group-by.
// It is only allowed when executing a group-by query with one field.
func (argb *AuthRequestGroupBy) Strings(ctx context.Context) ([]string, error) {
if len(argb.fields) > 1 {
return nil, errors.New("db: AuthRequestGroupBy.Strings is not achievable when grouping more than 1 field")
}
var v []string
if err := argb.Scan(ctx, &v); err != nil {
return nil, err
}
return v, nil
}
// StringsX is like Strings, but panics if an error occurs.
func (argb *AuthRequestGroupBy) StringsX(ctx context.Context) []string {
v, err := argb.Strings(ctx)
if err != nil {
panic(err)
}
return v
}
// String returns a single string from a group-by query.
// It is only allowed when executing a group-by query with one field.
func (argb *AuthRequestGroupBy) String(ctx context.Context) (_ string, err error) {
var v []string
if v, err = argb.Strings(ctx); err != nil {
return
}
switch len(v) {
case 1:
return v[0], nil
case 0:
err = &NotFoundError{authrequest.Label}
default:
err = fmt.Errorf("db: AuthRequestGroupBy.Strings returned %d results when one was expected", len(v))
}
return
}
// StringX is like String, but panics if an error occurs.
func (argb *AuthRequestGroupBy) StringX(ctx context.Context) string {
v, err := argb.String(ctx)
if err != nil {
panic(err)
}
return v
}
// Ints returns list of ints from group-by.
// It is only allowed when executing a group-by query with one field.
func (argb *AuthRequestGroupBy) Ints(ctx context.Context) ([]int, error) {
if len(argb.fields) > 1 {
return nil, errors.New("db: AuthRequestGroupBy.Ints is not achievable when grouping more than 1 field")
}
var v []int
if err := argb.Scan(ctx, &v); err != nil {
return nil, err
}
return v, nil
}
// IntsX is like Ints, but panics if an error occurs.
func (argb *AuthRequestGroupBy) IntsX(ctx context.Context) []int {
v, err := argb.Ints(ctx)
if err != nil {
panic(err)
}
return v
}
// Int returns a single int from a group-by query.
// It is only allowed when executing a group-by query with one field.
func (argb *AuthRequestGroupBy) Int(ctx context.Context) (_ int, err error) {
var v []int
if v, err = argb.Ints(ctx); err != nil {
return
}
switch len(v) {
case 1:
return v[0], nil
case 0:
err = &NotFoundError{authrequest.Label}
default:
err = fmt.Errorf("db: AuthRequestGroupBy.Ints returned %d results when one was expected", len(v))
}
return
}
// IntX is like Int, but panics if an error occurs.
func (argb *AuthRequestGroupBy) IntX(ctx context.Context) int {
v, err := argb.Int(ctx)
if err != nil {
panic(err)
}
return v
}
// Float64s returns list of float64s from group-by.
// It is only allowed when executing a group-by query with one field.
func (argb *AuthRequestGroupBy) Float64s(ctx context.Context) ([]float64, error) {
if len(argb.fields) > 1 {
return nil, errors.New("db: AuthRequestGroupBy.Float64s is not achievable when grouping more than 1 field")
}
var v []float64
if err := argb.Scan(ctx, &v); err != nil {
return nil, err
}
return v, nil
}
// Float64sX is like Float64s, but panics if an error occurs.
func (argb *AuthRequestGroupBy) Float64sX(ctx context.Context) []float64 {
v, err := argb.Float64s(ctx)
if err != nil {
panic(err)
}
return v
}
// Float64 returns a single float64 from a group-by query.
// It is only allowed when executing a group-by query with one field.
func (argb *AuthRequestGroupBy) Float64(ctx context.Context) (_ float64, err error) {
var v []float64
if v, err = argb.Float64s(ctx); err != nil {
return
}
switch len(v) {
case 1:
return v[0], nil
case 0:
err = &NotFoundError{authrequest.Label}
default:
err = fmt.Errorf("db: AuthRequestGroupBy.Float64s returned %d results when one was expected", len(v))
}
return
}
// Float64X is like Float64, but panics if an error occurs.
func (argb *AuthRequestGroupBy) Float64X(ctx context.Context) float64 {
v, err := argb.Float64(ctx)
if err != nil {
panic(err)
}
return v
}
// Bools returns list of bools from group-by.
// It is only allowed when executing a group-by query with one field.
func (argb *AuthRequestGroupBy) Bools(ctx context.Context) ([]bool, error) {
if len(argb.fields) > 1 {
return nil, errors.New("db: AuthRequestGroupBy.Bools is not achievable when grouping more than 1 field")
}
var v []bool
if err := argb.Scan(ctx, &v); err != nil {
return nil, err
}
return v, nil
}
// BoolsX is like Bools, but panics if an error occurs.
func (argb *AuthRequestGroupBy) BoolsX(ctx context.Context) []bool {
v, err := argb.Bools(ctx)
if err != nil {
panic(err)
}
return v
}
// Bool returns a single bool from a group-by query.
// It is only allowed when executing a group-by query with one field.
func (argb *AuthRequestGroupBy) Bool(ctx context.Context) (_ bool, err error) {
var v []bool
if v, err = argb.Bools(ctx); err != nil {
return
}
switch len(v) {
case 1:
return v[0], nil
case 0:
err = &NotFoundError{authrequest.Label}
default:
err = fmt.Errorf("db: AuthRequestGroupBy.Bools returned %d results when one was expected", len(v))
}
return
}
// BoolX is like Bool, but panics if an error occurs.
func (argb *AuthRequestGroupBy) BoolX(ctx context.Context) bool {
v, err := argb.Bool(ctx)
if err != nil {
panic(err)
}
return v
}
func (argb *AuthRequestGroupBy) sqlScan(ctx context.Context, v interface{}) error {
for _, f := range argb.fields {
if !authrequest.ValidColumn(f) {
@@ -702,6 +503,7 @@ func (argb *AuthRequestGroupBy) sqlQuery() *sql.Selector {
// AuthRequestSelect is the builder for selecting fields of AuthRequest entities.
type AuthRequestSelect struct {
*AuthRequestQuery
selector
// intermediate query (i.e. traversal path).
sql *sql.Selector
}
@@ -715,201 +517,6 @@ func (ars *AuthRequestSelect) Scan(ctx context.Context, v interface{}) error {
return ars.sqlScan(ctx, v)
}
// ScanX is like Scan, but panics if an error occurs.
func (ars *AuthRequestSelect) ScanX(ctx context.Context, v interface{}) {
if err := ars.Scan(ctx, v); err != nil {
panic(err)
}
}
// Strings returns list of strings from a selector. It is only allowed when selecting one field.
func (ars *AuthRequestSelect) Strings(ctx context.Context) ([]string, error) {
if len(ars.fields) > 1 {
return nil, errors.New("db: AuthRequestSelect.Strings is not achievable when selecting more than 1 field")
}
var v []string
if err := ars.Scan(ctx, &v); err != nil {
return nil, err
}
return v, nil
}
// StringsX is like Strings, but panics if an error occurs.
func (ars *AuthRequestSelect) StringsX(ctx context.Context) []string {
v, err := ars.Strings(ctx)
if err != nil {
panic(err)
}
return v
}
// String returns a single string from a selector. It is only allowed when selecting one field.
func (ars *AuthRequestSelect) String(ctx context.Context) (_ string, err error) {
var v []string
if v, err = ars.Strings(ctx); err != nil {
return
}
switch len(v) {
case 1:
return v[0], nil
case 0:
err = &NotFoundError{authrequest.Label}
default:
err = fmt.Errorf("db: AuthRequestSelect.Strings returned %d results when one was expected", len(v))
}
return
}
// StringX is like String, but panics if an error occurs.
func (ars *AuthRequestSelect) StringX(ctx context.Context) string {
v, err := ars.String(ctx)
if err != nil {
panic(err)
}
return v
}
// Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (ars *AuthRequestSelect) Ints(ctx context.Context) ([]int, error) {
if len(ars.fields) > 1 {
return nil, errors.New("db: AuthRequestSelect.Ints is not achievable when selecting more than 1 field")
}
var v []int
if err := ars.Scan(ctx, &v); err != nil {
return nil, err
}
return v, nil
}
// IntsX is like Ints, but panics if an error occurs.
func (ars *AuthRequestSelect) IntsX(ctx context.Context) []int {
v, err := ars.Ints(ctx)
if err != nil {
panic(err)
}
return v
}
// Int returns a single int from a selector. It is only allowed when selecting one field.
func (ars *AuthRequestSelect) Int(ctx context.Context) (_ int, err error) {
var v []int
if v, err = ars.Ints(ctx); err != nil {
return
}
switch len(v) {
case 1:
return v[0], nil
case 0:
err = &NotFoundError{authrequest.Label}
default:
err = fmt.Errorf("db: AuthRequestSelect.Ints returned %d results when one was expected", len(v))
}
return
}
// IntX is like Int, but panics if an error occurs.
func (ars *AuthRequestSelect) IntX(ctx context.Context) int {
v, err := ars.Int(ctx)
if err != nil {
panic(err)
}
return v
}
// Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (ars *AuthRequestSelect) Float64s(ctx context.Context) ([]float64, error) {
if len(ars.fields) > 1 {
return nil, errors.New("db: AuthRequestSelect.Float64s is not achievable when selecting more than 1 field")
}
var v []float64
if err := ars.Scan(ctx, &v); err != nil {
return nil, err
}
return v, nil
}
// Float64sX is like Float64s, but panics if an error occurs.
func (ars *AuthRequestSelect) Float64sX(ctx context.Context) []float64 {
v, err := ars.Float64s(ctx)
if err != nil {
panic(err)
}
return v
}
// Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (ars *AuthRequestSelect) Float64(ctx context.Context) (_ float64, err error) {
var v []float64
if v, err = ars.Float64s(ctx); err != nil {
return
}
switch len(v) {
case 1:
return v[0], nil
case 0:
err = &NotFoundError{authrequest.Label}
default:
err = fmt.Errorf("db: AuthRequestSelect.Float64s returned %d results when one was expected", len(v))
}
return
}
// Float64X is like Float64, but panics if an error occurs.
func (ars *AuthRequestSelect) Float64X(ctx context.Context) float64 {
v, err := ars.Float64(ctx)
if err != nil {
panic(err)
}
return v
}
// Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (ars *AuthRequestSelect) Bools(ctx context.Context) ([]bool, error) {
if len(ars.fields) > 1 {
return nil, errors.New("db: AuthRequestSelect.Bools is not achievable when selecting more than 1 field")
}
var v []bool
if err := ars.Scan(ctx, &v); err != nil {
return nil, err
}
return v, nil
}
// BoolsX is like Bools, but panics if an error occurs.
func (ars *AuthRequestSelect) BoolsX(ctx context.Context) []bool {
v, err := ars.Bools(ctx)
if err != nil {
panic(err)
}
return v
}
// Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (ars *AuthRequestSelect) Bool(ctx context.Context) (_ bool, err error) {
var v []bool
if v, err = ars.Bools(ctx); err != nil {
return
}
switch len(v) {
case 1:
return v[0], nil
case 0:
err = &NotFoundError{authrequest.Label}
default:
err = fmt.Errorf("db: AuthRequestSelect.Bools returned %d results when one was expected", len(v))
}
return
}
// BoolX is like Bool, but panics if an error occurs.
func (ars *AuthRequestSelect) BoolX(ctx context.Context) bool {
v, err := ars.Bool(ctx)
if err != nil {
panic(err)
}
return v
}
func (ars *AuthRequestSelect) sqlScan(ctx context.Context, v interface{}) error {
rows := &sql.Rows{}
query, args := ars.sql.Query()
+10 -4
View File
@@ -1,4 +1,4 @@
// Code generated by entc, DO NOT EDIT.
// Code generated by ent, DO NOT EDIT.
package db
@@ -428,7 +428,7 @@ func (aru *AuthRequestUpdate) sqlSave(ctx context.Context) (n int, err error) {
if _, ok := err.(*sqlgraph.NotFoundError); ok {
err = &NotFoundError{authrequest.Label}
} else if sqlgraph.IsConstraintError(err) {
err = &ConstraintError{err.Error(), err}
err = &ConstraintError{msg: err.Error(), wrap: err}
}
return 0, err
}
@@ -642,9 +642,15 @@ func (aruo *AuthRequestUpdateOne) Save(ctx context.Context) (*AuthRequest, error
}
mut = aruo.hooks[i](mut)
}
if _, err := mut.Mutate(ctx, aruo.mutation); err != nil {
v, err := mut.Mutate(ctx, aruo.mutation)
if err != nil {
return nil, err
}
nv, ok := v.(*AuthRequest)
if !ok {
return nil, fmt.Errorf("unexpected node type %T returned from AuthRequestMutation", v)
}
node = nv
}
return node, err
}
@@ -870,7 +876,7 @@ func (aruo *AuthRequestUpdateOne) sqlSave(ctx context.Context) (_node *AuthReque
if _, ok := err.(*sqlgraph.NotFoundError); ok {
err = &NotFoundError{authrequest.Label}
} else if sqlgraph.IsConstraintError(err) {
err = &ConstraintError{err.Error(), err}
err = &ConstraintError{msg: err.Error(), wrap: err}
}
return nil, err
}
+34 -33
View File
@@ -1,9 +1,10 @@
// Code generated by entc, DO NOT EDIT.
// Code generated by ent, DO NOT EDIT.
package db
import (
"context"
"errors"
"fmt"
"log"
@@ -94,7 +95,7 @@ func Open(driverName, dataSourceName string, options ...Option) (*Client, error)
// is used until the transaction is committed or rolled back.
func (c *Client) Tx(ctx context.Context) (*Tx, error) {
if _, ok := c.driver.(*txDriver); ok {
return nil, fmt.Errorf("db: cannot start a transaction within a transaction")
return nil, errors.New("db: cannot start a transaction within a transaction")
}
tx, err := newTx(ctx, c.driver)
if err != nil {
@@ -121,7 +122,7 @@ func (c *Client) Tx(ctx context.Context) (*Tx, error) {
// BeginTx returns a transactional client with specified options.
func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error) {
if _, ok := c.driver.(*txDriver); ok {
return nil, fmt.Errorf("ent: cannot start a transaction within a transaction")
return nil, errors.New("ent: cannot start a transaction within a transaction")
}
tx, err := c.driver.(interface {
BeginTx(context.Context, *sql.TxOptions) (dialect.Tx, error)
@@ -201,7 +202,7 @@ func (c *AuthCodeClient) Use(hooks ...Hook) {
c.hooks.AuthCode = append(c.hooks.AuthCode, hooks...)
}
// Create returns a create builder for AuthCode.
// Create returns a builder for creating a AuthCode entity.
func (c *AuthCodeClient) Create() *AuthCodeCreate {
mutation := newAuthCodeMutation(c.config, OpCreate)
return &AuthCodeCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
@@ -236,12 +237,12 @@ func (c *AuthCodeClient) Delete() *AuthCodeDelete {
return &AuthCodeDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
// DeleteOne returns a delete builder for the given entity.
// DeleteOne returns a builder for deleting the given entity.
func (c *AuthCodeClient) DeleteOne(ac *AuthCode) *AuthCodeDeleteOne {
return c.DeleteOneID(ac.ID)
}
// DeleteOneID returns a delete builder for the given id.
// DeleteOne returns a builder for deleting the given entity by its id.
func (c *AuthCodeClient) DeleteOneID(id string) *AuthCodeDeleteOne {
builder := c.Delete().Where(authcode.ID(id))
builder.mutation.id = &id
@@ -291,7 +292,7 @@ func (c *AuthRequestClient) Use(hooks ...Hook) {
c.hooks.AuthRequest = append(c.hooks.AuthRequest, hooks...)
}
// Create returns a create builder for AuthRequest.
// Create returns a builder for creating a AuthRequest entity.
func (c *AuthRequestClient) Create() *AuthRequestCreate {
mutation := newAuthRequestMutation(c.config, OpCreate)
return &AuthRequestCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
@@ -326,12 +327,12 @@ func (c *AuthRequestClient) Delete() *AuthRequestDelete {
return &AuthRequestDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
// DeleteOne returns a delete builder for the given entity.
// DeleteOne returns a builder for deleting the given entity.
func (c *AuthRequestClient) DeleteOne(ar *AuthRequest) *AuthRequestDeleteOne {
return c.DeleteOneID(ar.ID)
}
// DeleteOneID returns a delete builder for the given id.
// DeleteOne returns a builder for deleting the given entity by its id.
func (c *AuthRequestClient) DeleteOneID(id string) *AuthRequestDeleteOne {
builder := c.Delete().Where(authrequest.ID(id))
builder.mutation.id = &id
@@ -381,7 +382,7 @@ func (c *ConnectorClient) Use(hooks ...Hook) {
c.hooks.Connector = append(c.hooks.Connector, hooks...)
}
// Create returns a create builder for Connector.
// Create returns a builder for creating a Connector entity.
func (c *ConnectorClient) Create() *ConnectorCreate {
mutation := newConnectorMutation(c.config, OpCreate)
return &ConnectorCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
@@ -416,12 +417,12 @@ func (c *ConnectorClient) Delete() *ConnectorDelete {
return &ConnectorDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
// DeleteOne returns a delete builder for the given entity.
// DeleteOne returns a builder for deleting the given entity.
func (c *ConnectorClient) DeleteOne(co *Connector) *ConnectorDeleteOne {
return c.DeleteOneID(co.ID)
}
// DeleteOneID returns a delete builder for the given id.
// DeleteOne returns a builder for deleting the given entity by its id.
func (c *ConnectorClient) DeleteOneID(id string) *ConnectorDeleteOne {
builder := c.Delete().Where(connector.ID(id))
builder.mutation.id = &id
@@ -471,7 +472,7 @@ func (c *DeviceRequestClient) Use(hooks ...Hook) {
c.hooks.DeviceRequest = append(c.hooks.DeviceRequest, hooks...)
}
// Create returns a create builder for DeviceRequest.
// Create returns a builder for creating a DeviceRequest entity.
func (c *DeviceRequestClient) Create() *DeviceRequestCreate {
mutation := newDeviceRequestMutation(c.config, OpCreate)
return &DeviceRequestCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
@@ -506,12 +507,12 @@ func (c *DeviceRequestClient) Delete() *DeviceRequestDelete {
return &DeviceRequestDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
// DeleteOne returns a delete builder for the given entity.
// DeleteOne returns a builder for deleting the given entity.
func (c *DeviceRequestClient) DeleteOne(dr *DeviceRequest) *DeviceRequestDeleteOne {
return c.DeleteOneID(dr.ID)
}
// DeleteOneID returns a delete builder for the given id.
// DeleteOne returns a builder for deleting the given entity by its id.
func (c *DeviceRequestClient) DeleteOneID(id int) *DeviceRequestDeleteOne {
builder := c.Delete().Where(devicerequest.ID(id))
builder.mutation.id = &id
@@ -561,7 +562,7 @@ func (c *DeviceTokenClient) Use(hooks ...Hook) {
c.hooks.DeviceToken = append(c.hooks.DeviceToken, hooks...)
}
// Create returns a create builder for DeviceToken.
// Create returns a builder for creating a DeviceToken entity.
func (c *DeviceTokenClient) Create() *DeviceTokenCreate {
mutation := newDeviceTokenMutation(c.config, OpCreate)
return &DeviceTokenCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
@@ -596,12 +597,12 @@ func (c *DeviceTokenClient) Delete() *DeviceTokenDelete {
return &DeviceTokenDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
// DeleteOne returns a delete builder for the given entity.
// DeleteOne returns a builder for deleting the given entity.
func (c *DeviceTokenClient) DeleteOne(dt *DeviceToken) *DeviceTokenDeleteOne {
return c.DeleteOneID(dt.ID)
}
// DeleteOneID returns a delete builder for the given id.
// DeleteOne returns a builder for deleting the given entity by its id.
func (c *DeviceTokenClient) DeleteOneID(id int) *DeviceTokenDeleteOne {
builder := c.Delete().Where(devicetoken.ID(id))
builder.mutation.id = &id
@@ -651,7 +652,7 @@ func (c *KeysClient) Use(hooks ...Hook) {
c.hooks.Keys = append(c.hooks.Keys, hooks...)
}
// Create returns a create builder for Keys.
// Create returns a builder for creating a Keys entity.
func (c *KeysClient) Create() *KeysCreate {
mutation := newKeysMutation(c.config, OpCreate)
return &KeysCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
@@ -686,12 +687,12 @@ func (c *KeysClient) Delete() *KeysDelete {
return &KeysDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
// DeleteOne returns a delete builder for the given entity.
// DeleteOne returns a builder for deleting the given entity.
func (c *KeysClient) DeleteOne(k *Keys) *KeysDeleteOne {
return c.DeleteOneID(k.ID)
}
// DeleteOneID returns a delete builder for the given id.
// DeleteOne returns a builder for deleting the given entity by its id.
func (c *KeysClient) DeleteOneID(id string) *KeysDeleteOne {
builder := c.Delete().Where(keys.ID(id))
builder.mutation.id = &id
@@ -741,7 +742,7 @@ func (c *OAuth2ClientClient) Use(hooks ...Hook) {
c.hooks.OAuth2Client = append(c.hooks.OAuth2Client, hooks...)
}
// Create returns a create builder for OAuth2Client.
// Create returns a builder for creating a OAuth2Client entity.
func (c *OAuth2ClientClient) Create() *OAuth2ClientCreate {
mutation := newOAuth2ClientMutation(c.config, OpCreate)
return &OAuth2ClientCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
@@ -776,12 +777,12 @@ func (c *OAuth2ClientClient) Delete() *OAuth2ClientDelete {
return &OAuth2ClientDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
// DeleteOne returns a delete builder for the given entity.
// DeleteOne returns a builder for deleting the given entity.
func (c *OAuth2ClientClient) DeleteOne(o *OAuth2Client) *OAuth2ClientDeleteOne {
return c.DeleteOneID(o.ID)
}
// DeleteOneID returns a delete builder for the given id.
// DeleteOne returns a builder for deleting the given entity by its id.
func (c *OAuth2ClientClient) DeleteOneID(id string) *OAuth2ClientDeleteOne {
builder := c.Delete().Where(oauth2client.ID(id))
builder.mutation.id = &id
@@ -831,7 +832,7 @@ func (c *OfflineSessionClient) Use(hooks ...Hook) {
c.hooks.OfflineSession = append(c.hooks.OfflineSession, hooks...)
}
// Create returns a create builder for OfflineSession.
// Create returns a builder for creating a OfflineSession entity.
func (c *OfflineSessionClient) Create() *OfflineSessionCreate {
mutation := newOfflineSessionMutation(c.config, OpCreate)
return &OfflineSessionCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
@@ -866,12 +867,12 @@ func (c *OfflineSessionClient) Delete() *OfflineSessionDelete {
return &OfflineSessionDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
// DeleteOne returns a delete builder for the given entity.
// DeleteOne returns a builder for deleting the given entity.
func (c *OfflineSessionClient) DeleteOne(os *OfflineSession) *OfflineSessionDeleteOne {
return c.DeleteOneID(os.ID)
}
// DeleteOneID returns a delete builder for the given id.
// DeleteOne returns a builder for deleting the given entity by its id.
func (c *OfflineSessionClient) DeleteOneID(id string) *OfflineSessionDeleteOne {
builder := c.Delete().Where(offlinesession.ID(id))
builder.mutation.id = &id
@@ -921,7 +922,7 @@ func (c *PasswordClient) Use(hooks ...Hook) {
c.hooks.Password = append(c.hooks.Password, hooks...)
}
// Create returns a create builder for Password.
// Create returns a builder for creating a Password entity.
func (c *PasswordClient) Create() *PasswordCreate {
mutation := newPasswordMutation(c.config, OpCreate)
return &PasswordCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
@@ -956,12 +957,12 @@ func (c *PasswordClient) Delete() *PasswordDelete {
return &PasswordDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
// DeleteOne returns a delete builder for the given entity.
// DeleteOne returns a builder for deleting the given entity.
func (c *PasswordClient) DeleteOne(pa *Password) *PasswordDeleteOne {
return c.DeleteOneID(pa.ID)
}
// DeleteOneID returns a delete builder for the given id.
// DeleteOne returns a builder for deleting the given entity by its id.
func (c *PasswordClient) DeleteOneID(id int) *PasswordDeleteOne {
builder := c.Delete().Where(password.ID(id))
builder.mutation.id = &id
@@ -1011,7 +1012,7 @@ func (c *RefreshTokenClient) Use(hooks ...Hook) {
c.hooks.RefreshToken = append(c.hooks.RefreshToken, hooks...)
}
// Create returns a create builder for RefreshToken.
// Create returns a builder for creating a RefreshToken entity.
func (c *RefreshTokenClient) Create() *RefreshTokenCreate {
mutation := newRefreshTokenMutation(c.config, OpCreate)
return &RefreshTokenCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
@@ -1046,12 +1047,12 @@ func (c *RefreshTokenClient) Delete() *RefreshTokenDelete {
return &RefreshTokenDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
}
// DeleteOne returns a delete builder for the given entity.
// DeleteOne returns a builder for deleting the given entity.
func (c *RefreshTokenClient) DeleteOne(rt *RefreshToken) *RefreshTokenDeleteOne {
return c.DeleteOneID(rt.ID)
}
// DeleteOneID returns a delete builder for the given id.
// DeleteOne returns a builder for deleting the given entity by its id.
func (c *RefreshTokenClient) DeleteOneID(id string) *RefreshTokenDeleteOne {
builder := c.Delete().Where(refreshtoken.ID(id))
builder.mutation.id = &id
+1 -1
View File
@@ -1,4 +1,4 @@
// Code generated by entc, DO NOT EDIT.
// Code generated by ent, DO NOT EDIT.
package db
+11 -8
View File
@@ -1,4 +1,4 @@
// Code generated by entc, DO NOT EDIT.
// Code generated by ent, DO NOT EDIT.
package db
@@ -94,11 +94,11 @@ func (c *Connector) Update() *ConnectorUpdateOne {
// Unwrap unwraps the Connector entity that was returned from a transaction after it was closed,
// so that all future queries will be executed through the driver which created the transaction.
func (c *Connector) Unwrap() *Connector {
tx, ok := c.config.driver.(*txDriver)
_tx, ok := c.config.driver.(*txDriver)
if !ok {
panic("db: Connector is not a transactional entity")
}
c.config.driver = tx.drv
c.config.driver = _tx.drv
return c
}
@@ -106,14 +106,17 @@ func (c *Connector) Unwrap() *Connector {
func (c *Connector) String() string {
var builder strings.Builder
builder.WriteString("Connector(")
builder.WriteString(fmt.Sprintf("id=%v", c.ID))
builder.WriteString(", type=")
builder.WriteString(fmt.Sprintf("id=%v, ", c.ID))
builder.WriteString("type=")
builder.WriteString(c.Type)
builder.WriteString(", name=")
builder.WriteString(", ")
builder.WriteString("name=")
builder.WriteString(c.Name)
builder.WriteString(", resource_version=")
builder.WriteString(", ")
builder.WriteString("resource_version=")
builder.WriteString(c.ResourceVersion)
builder.WriteString(", config=")
builder.WriteString(", ")
builder.WriteString("config=")
builder.WriteString(fmt.Sprintf("%v", c.Config))
builder.WriteByte(')')
return builder.String()
+1 -1
View File
@@ -1,4 +1,4 @@
// Code generated by entc, DO NOT EDIT.
// Code generated by ent, DO NOT EDIT.
package connector

Some files were not shown because too many files have changed in this diff Show More