mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-25 23:58:21 +08:00
add console & example
This commit is contained in:
17
tools/goctl/model/sql/example/main.go
Normal file
17
tools/goctl/model/sql/example/main.go
Normal 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))
|
||||
}
|
||||
Reference in New Issue
Block a user