init commit
This commit is contained in:
31
gen.go
Normal file
31
gen.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"gorm.io/gen"
|
||||
"proxy-server/server/orm"
|
||||
)
|
||||
|
||||
const (
|
||||
Host = "localhost"
|
||||
Port = "5432"
|
||||
Username = "gorm"
|
||||
Password = "gorm"
|
||||
Database = "gorm"
|
||||
Timezone = "Asia/Shanghai"
|
||||
)
|
||||
|
||||
func main() {
|
||||
g := gen.NewGenerator(gen.Config{
|
||||
OutPath: "../../temp-out",
|
||||
Mode: gen.WithoutContext | gen.WithDefaultQuery | gen.WithQueryInterface,
|
||||
})
|
||||
|
||||
orm.Init()
|
||||
g.UseDB(orm.DB)
|
||||
|
||||
g.ApplyBasic(
|
||||
g.GenerateAllTable()...,
|
||||
)
|
||||
|
||||
g.Execute()
|
||||
}
|
||||
Reference in New Issue
Block a user