//go:build ignore package main import ( "log" "entgo.io/ent/entc" "entgo.io/ent/entc/gen" ) func main() { if err := entc.Generate( ".", &gen.Config{ Target: "../ent", Package: "bj_power_mes/ent", Features: []gen.Feature{ gen.FeatureExecQuery, // Allows users to execute statements using the ExecContext/QueryContext methods of the underlying driver gen.FeatureLock, // Allows users to use row-level locking in SQL using the 'FOR {UPDATE|SHARE}' clauses gen.FeatureModifier, // Allows users to attach custom modifiers to queries gen.FeatureNamedEdges, // NamedEdges provides an API for eager-loading edges with dynamic names }, }); err != nil { log.Fatal("running ent codegen:", err) } log.Println("ent code generated successfully!") }