23 lines
470 B
Go
23 lines
470 B
Go
package main
|
|
|
|
import (
|
|
"Crimson-Gatekeeper/internal/database"
|
|
"Crimson-Gatekeeper/internal/utils"
|
|
|
|
"gorm.io/gen"
|
|
)
|
|
|
|
func main() {
|
|
client, err := database.GetDataBaseClient()
|
|
utils.PaincEro(err, "数据库链接失败")
|
|
g := gen.NewGenerator(gen.Config{
|
|
OutPath: "./internal/query",
|
|
ModelPkgPath: "./internal/model",
|
|
Mode: gen.WithDefaultQuery,
|
|
FieldNullable: true,
|
|
})
|
|
g.UseDB(client)
|
|
g.ApplyBasic(g.GenerateAllTable()...)
|
|
g.Execute()
|
|
}
|