add console & example

This commit is contained in:
anqiansong
2020-08-15 18:38:55 +08:00
parent c519345924
commit 790b29b8eb
18 changed files with 522 additions and 59 deletions

View File

@@ -0,0 +1,17 @@
package main
import (
"github.com/tal-tech/go-zero/core/lang"
"github.com/tal-tech/go-zero/tools/goctl/model/sql/gen"
)
// go run .
func main() {
// generating with cache
withCacheGenerator := gen.NewDefaultGenerator("./test.sql", "./withcachemodel")
lang.Must(withCacheGenerator.Start(true))
// generating without cache
withoutGenerator := gen.NewDefaultGenerator("./test.sql", "./withoutcachemodel")
lang.Must(withoutGenerator.Start(false))
}