You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
694 B
30 lines
694 B
//go:build ignore
|
|
|
|
package main
|
|
|
|
import (
|
|
"log"
|
|
|
|
"entgo.io/ent/entc"
|
|
"entgo.io/ent/entc/gen"
|
|
)
|
|
|
|
func main() {
|
|
if err := entc.Generate("./schema", &gen.Config{
|
|
Features: []gen.Feature{
|
|
gen.FeatureIntercept,
|
|
gen.FeatureSnapshot,
|
|
gen.FeatureUpsert,
|
|
gen.FeatureUpsert,
|
|
gen.FeatureExecQuery,
|
|
},
|
|
Templates: []*gen.Template{
|
|
gen.MustParse(gen.NewTemplate("edge_helper").ParseFiles("templates/edgehelper.tmpl")),
|
|
gen.MustParse(gen.NewTemplate("mutation_helper").ParseFiles("templates/mutationhelper.tmpl")),
|
|
gen.MustParse(gen.NewTemplate("create_helper").ParseFiles("templates/createhelper.tmpl")),
|
|
},
|
|
}); err != nil {
|
|
log.Fatal("running ent codegen:", err)
|
|
}
|
|
}
|