Add custom pagination template

This commit is contained in:
Achim Rohn
2025-09-12 01:54:21 +02:00
parent 941aea49a8
commit cd1d85b1a9
4 changed files with 114 additions and 33 deletions
+10 -1
View File
@@ -9,7 +9,16 @@ import (
func main() {
log.Println("ersteller start")
must(entc.Generate("./schema/ent/example/ent/schema", &gen.Config{}))
// Parse our custom pagination template (per-entity Query methods).
paginationPath := "schema/ent/pagination_query.tmpl"
//paginationTmpl := gen.MustParse(gen.NewTemplate("pagination_query").
// ParseFiles(paginationPath))
must(entc.Generate(
"./schema/ent/example/ent/schema",
&gen.Config{},
entc.TemplateFiles(paginationPath),
))
}
func must(err error) {