xogen is a code generator that can convert models from the "github.com/go-xorm" project into dao code. This makes it easy to generate dao crud code that corresponds to the model.
- Converts models from "github.com/go-xorm" into dao code
- Generates dao crud code easily
- Go 1.16 or later
go get github.com/carsonfeng/xogen
cd $GOPATH/src/github.com/carsonfeng/xogen
go build
make tag t=v0.0.X m="release_log"
v0.0.X
is tag name
make tag t=v1.2.1 m='new_feature'
First release of xogen.
xogen [options]
-model_path
specifies the path of model. For Example:testcases/models/models.go
-models
specifies the xorm model struct names, separated by comma ',' . For Example:DemoTeamModel1,DemoUserModel2
-output_dao
specifies the path of dao output. For Example:testcases/daos/demo_daos.go
-model_import
specifies imported package of model. For Example:xogen/testcases/models
Step 1: Build a tools project. Follow the examples of main.go
and ./testcases/templated.go
in this project.