Add ent schema to starter
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"ersteller-lib/starter/create"
|
||||
"log"
|
||||
"path"
|
||||
|
||||
"entgo.io/ent/entc"
|
||||
"entgo.io/ent/entc/gen"
|
||||
)
|
||||
|
||||
func main() {
|
||||
log.Println("starter generate schema")
|
||||
thisDir := create.GetPathToThisDir()
|
||||
paginationPath := path.Join(thisDir, "../../schema/ent/pagination_query.tmpl")
|
||||
|
||||
must(entc.Generate(
|
||||
"./ent/schema",
|
||||
&gen.Config{},
|
||||
entc.TemplateFiles(paginationPath),
|
||||
))
|
||||
}
|
||||
|
||||
func must(err error) {
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user