diff --git a/ent/ent.go b/ent/ent.go index 8393750..5ecd501 100644 --- a/ent/ent.go +++ b/ent/ent.go @@ -70,7 +70,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{ diff --git a/ent/runtime/runtime.go b/ent/runtime/runtime.go index 8710747..c1e053a 100644 --- a/ent/runtime/runtime.go +++ b/ent/runtime/runtime.go @@ -6,6 +6,6 @@ package runtime // The schema-stitching logic is generated in github.com/dev-hato/misskey-abuse-user-report-notifier/ent/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. ) diff --git a/ent/userreport_query.go b/ent/userreport_query.go index fda91b0..cc68258 100644 --- a/ent/userreport_query.go +++ b/ent/userreport_query.go @@ -8,6 +8,7 @@ import ( "fmt" "math" + "entgo.io/ent" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/schema/field" @@ -61,7 +62,7 @@ func (urq *UserReportQuery) Order(o ...userreport.OrderOption) *UserReportQuery // First returns the first UserReport entity from the query. // Returns a *NotFoundError when no UserReport was found. func (urq *UserReportQuery) First(ctx context.Context) (*UserReport, error) { - nodes, err := urq.Limit(1).All(setContextOp(ctx, urq.ctx, "First")) + nodes, err := urq.Limit(1).All(setContextOp(ctx, urq.ctx, ent.OpQueryFirst)) if err != nil { return nil, err } @@ -84,7 +85,7 @@ func (urq *UserReportQuery) FirstX(ctx context.Context) *UserReport { // Returns a *NotFoundError when no UserReport ID was found. func (urq *UserReportQuery) FirstID(ctx context.Context) (id string, err error) { var ids []string - if ids, err = urq.Limit(1).IDs(setContextOp(ctx, urq.ctx, "FirstID")); err != nil { + if ids, err = urq.Limit(1).IDs(setContextOp(ctx, urq.ctx, ent.OpQueryFirstID)); err != nil { return } if len(ids) == 0 { @@ -107,7 +108,7 @@ func (urq *UserReportQuery) FirstIDX(ctx context.Context) string { // Returns a *NotSingularError when more than one UserReport entity is found. // Returns a *NotFoundError when no UserReport entities are found. func (urq *UserReportQuery) Only(ctx context.Context) (*UserReport, error) { - nodes, err := urq.Limit(2).All(setContextOp(ctx, urq.ctx, "Only")) + nodes, err := urq.Limit(2).All(setContextOp(ctx, urq.ctx, ent.OpQueryOnly)) if err != nil { return nil, err } @@ -135,7 +136,7 @@ func (urq *UserReportQuery) OnlyX(ctx context.Context) *UserReport { // Returns a *NotFoundError when no entities are found. func (urq *UserReportQuery) OnlyID(ctx context.Context) (id string, err error) { var ids []string - if ids, err = urq.Limit(2).IDs(setContextOp(ctx, urq.ctx, "OnlyID")); err != nil { + if ids, err = urq.Limit(2).IDs(setContextOp(ctx, urq.ctx, ent.OpQueryOnlyID)); err != nil { return } switch len(ids) { @@ -160,7 +161,7 @@ func (urq *UserReportQuery) OnlyIDX(ctx context.Context) string { // All executes the query and returns a list of UserReports. func (urq *UserReportQuery) All(ctx context.Context) ([]*UserReport, error) { - ctx = setContextOp(ctx, urq.ctx, "All") + ctx = setContextOp(ctx, urq.ctx, ent.OpQueryAll) if err := urq.prepareQuery(ctx); err != nil { return nil, err } @@ -182,7 +183,7 @@ func (urq *UserReportQuery) IDs(ctx context.Context) (ids []string, err error) { if urq.ctx.Unique == nil && urq.path != nil { urq.Unique(true) } - ctx = setContextOp(ctx, urq.ctx, "IDs") + ctx = setContextOp(ctx, urq.ctx, ent.OpQueryIDs) if err = urq.Select(userreport.FieldID).Scan(ctx, &ids); err != nil { return nil, err } @@ -200,7 +201,7 @@ func (urq *UserReportQuery) IDsX(ctx context.Context) []string { // Count returns the count of the given query. func (urq *UserReportQuery) Count(ctx context.Context) (int, error) { - ctx = setContextOp(ctx, urq.ctx, "Count") + ctx = setContextOp(ctx, urq.ctx, ent.OpQueryCount) if err := urq.prepareQuery(ctx); err != nil { return 0, err } @@ -218,7 +219,7 @@ func (urq *UserReportQuery) CountX(ctx context.Context) int { // Exist returns true if the query has elements in the graph. func (urq *UserReportQuery) Exist(ctx context.Context) (bool, error) { - ctx = setContextOp(ctx, urq.ctx, "Exist") + ctx = setContextOp(ctx, urq.ctx, ent.OpQueryExist) switch _, err := urq.FirstID(ctx); { case IsNotFound(err): return false, nil @@ -450,7 +451,7 @@ func (urgb *UserReportGroupBy) Aggregate(fns ...AggregateFunc) *UserReportGroupB // Scan applies the selector query and scans the result into the given value. func (urgb *UserReportGroupBy) Scan(ctx context.Context, v any) error { - ctx = setContextOp(ctx, urgb.build.ctx, "GroupBy") + ctx = setContextOp(ctx, urgb.build.ctx, ent.OpQueryGroupBy) if err := urgb.build.prepareQuery(ctx); err != nil { return err } @@ -498,7 +499,7 @@ func (urs *UserReportSelect) Aggregate(fns ...AggregateFunc) *UserReportSelect { // Scan applies the selector query and scans the result into the given value. func (urs *UserReportSelect) Scan(ctx context.Context, v any) error { - ctx = setContextOp(ctx, urs.ctx, "Select") + ctx = setContextOp(ctx, urs.ctx, ent.OpQuerySelect) if err := urs.prepareQuery(ctx); err != nil { return err } diff --git a/go.mod b/go.mod index 10db3cf..d52c5e1 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.22 toolchain go1.22.5 require ( - entgo.io/ent v0.13.1 + entgo.io/ent v0.14.0 github.com/air-verse/air v1.52.3 github.com/bwmarrin/discordgo v0.28.1 github.com/lib/pq v1.10.9 diff --git a/go.sum b/go.sum index 173d516..23c3846 100644 --- a/go.sum +++ b/go.sum @@ -3,8 +3,8 @@ ariga.io/atlas v0.19.1-0.20240203083654-5948b60a8e43/go.mod h1:uj3pm+hUTVN/X5yfd cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= -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= github.com/BurntSushi/locker v0.0.0-20171006230638-a6e239ea1c69 h1:+tu3HOoMXB7RXEINRVIpxJCT+KdYiI7LAEAUrOw3dIU= github.com/BurntSushi/locker v0.0.0-20171006230638-a6e239ea1c69/go.mod h1:L1AbZdiDllfyYH5l5OkAaZtk7VkWe89bPJFmnDBNHxg= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=