Skip to content

ch3nnn/gen-table

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gen-table

English | 简体中文

基于 gorm-gen 生成 model、query、dao 代码

一、相关命令

Usage of ./gen-table:
  -createTimeField string
        auto create time field name
  -daoFile string
        specify dao filename (default "dao")
  -db string
        input mysql or postgres or sqlite or sqlserver. consult[https://gorm.io/docs/connecting_to_the_database.html] (default "mysql")
  -deleteField string
        delete time field name
  -dsn string
        consult[https://gorm.io/docs/connecting_to_the_database.html]
  -isgendao
        generate curd func dao
  -outPath string
        specify a directory for output (default "./dal")
  -tables string
        enter the required data table or leave it blank
  -updateTimeField string
        auto update time field name

二、示例

注意: 需要在 go.mod 文件同级目录下执行

./gen-table \
	-dsn "example/test.db?_busy_timeout=5000" \
	-tables "site" \
	-db "sqlite" \
	-outPath "example/dal" \
	-isgendao

About

Generate model, query, and dao codes based on gorm-gen

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages