用于生成Go的Model文件,数据库操作太过于麻烦,依靠工具可以直接生成model对象,默认使用的是xorm映射。 需要支持Go mod ,所以版本最好1.11以上 下载: go get -u github.com/anthony-dong/orm-generator 执行 ./build.sh 或者 release里下载压缩版 ~/Downloads/orm-generator-1.0 % ls LICENSE README.md bin build.sh cmd generator go.mod go.sum utils ~/Downloads/orm-generator-1.0 % ./build.sh GOPATH: /Users/sgcx015/go GOBIN: /Users/sgcx015/Downloads/orm-generator-1.0/bin/ CURDIR: /Users/sgcx015/Downloads/orm-generator-1.0 WORK=/var/folders/cs/_wm77lv95j5d88s_q9vr959w0000gn/T/go-build403299929 build finished sgcx015@SGCX015deMacBook-Pro:~/Downloads/orm-generator-1.0 % bin/orm-generator 快速开始 ~/go/code/orm-generator (master*) % bin/orm-generator -u=root -p=123456 -d=xorm -t=users -tag=xorm generate template finished ~/go/code/orm-generator/tmp (master*) % cat tmp/users.go package model import ( "time" ) type Users struct { ID uint32 `xorm:"id"` Name string `xorm:"name"` Age uint32 `xorm:"age"` Date time.Time `xorm:"date"` ClassID uint32 `xorm:"class_id"` } func (u Users) TableName() string { return "users"mixcloud.com/ycaeowmu/?mode=desktop&ref_=m_ft_tfp
mixcloud.com/909nhqny/?mode=desktop&ref_=m_ft_zzv
mixcloud.com/m79ikt9w/?mode=desktop&ref_=m_ft_vlj
mixcloud.com/9mjxh5eu/?mode=desktop&ref_=m_ft_dhb
mixcloud.com/eqrxeqyk/?mode=desktop&ref_=m_ft_vtr
mixcloud.com/z3v2maa6/?mode=desktop&ref_=m_ft_dpz
mixcloud.com/mguyga40/?mode=desktop&ref_=m_ft_xvr
mixcloud.com/deyjcp6a/?mode=desktop&ref_=m_ft_vzn
mixcloud.com/40o8buvz/?mode=desktop&ref_=m_ft_hrz
mixcloud.com/8sg8mao0/?mode=desktop&ref_=m_ft_jhv
mixcloud.com/yrgl49j2/?mode=desktop&ref_=m_ft_vrz
mixcloud.com/omnrp2um/?mode=desktop&ref_=m_ft_npp
mixcloud.com/kwyg1abf/?mode=desktop&ref_=m_ft_jvd
mixcloud.com/cx6pbg00/?mode=desktop&ref_=m_ft_npp
mixcloud.com/flal9jxk/?mode=desktop&ref_=m_ft_bdn
mixcloud.com/ky4albj0/?mode=desktop&ref_=m_ft_lzt
mixcloud.com/ekuga888/?mode=desktop&ref_=m_ft_znr
mixcloud.com/mgmc7edc/?mode=desktop&ref_=m_ft_rtd
mixcloud.com/5h1hqo7i/?mode=desktop&ref_=m_ft_pvf
mixcloud.com/t1k50fq9/?mode=desktop&ref_=m_ft_trj
mixcloud.com/sd5jcza8/?mode=desktop&ref_=m_ft_hfb
mixcloud.com/55xrj75n/?mode=desktop&ref_=m_ft_plh
mixcloud.com/b0w41cij/?mode=desktop&ref_=m_ft_rfv
mixcloud.com/9h0zjw3f/?mode=desktop&ref_=m_ft_dnt
mixcloud.com/9zceoxjm/?mode=desktop&ref_=m_ft_jxx
mixcloud.com/i9c2na62/?mode=desktop&ref_=m_ft_xxx
mixcloud.com/h811f6b0/?mode=desktop&ref_=m_ft_zlf
mixcloud.com/1wa43qqb/?mode=desktop&ref_=m_ft_rdx
mixcloud.com/69lnn0ub/?mode=desktop&ref_=m_ft_lxf
mixcloud.com/mei6ywmq/?mode=desktop&ref_=m_ft_lnj
mixcloud.com/omvbftgr/?mode=desktop&ref_=m_ft_xvf
mixcloud.com/019865hi/?mode=desktop&ref_=m_ft_nzt
mixcloud.com/g6m78ggy/?mode=desktop&ref_=m_ft_dnv
mixcloud.com/5gwk756b/?mode=desktop&ref_=m_ft_jhv
mixcloud.com/lvf8px8k/?mode=desktop&ref_=m_ft_zxh
mixcloud.com/ca2bs9hr/?mode=desktop&ref_=m_ft_pnv
mixcloud.com/1ssmkbgi/?mode=desktop&ref_=m_ft_zxh
mixcloud.com/n291s9v4/?mode=desktop&ref_=m_ft_dnn
mixcloud.com/cbc345yz/?mode=desktop&ref_=m_ft_jtr
mixcloud.com/euqnh8by/?mode=desktop&ref_=m_ft_hfn
mixcloud.com/xintm8pt/?mode=desktop&ref_=m_ft_hrn
mixcloud.com/mj5yc7hb/?mode=desktop&ref_=m_ft_hhd
mixcloud.com/g89s6wqc/?mode=desktop&ref_=m_ft_ppj
mixcloud.com/364fsz5c/?mode=desktop&ref_=m_ft_jvj
mixcloud.com/a84y4wzh/?mode=desktop&ref_=m_ft_ddn
mixcloud.com/mikw28ug/?mode=desktop&ref_=m_ft_nzt
mixcloud.com/4nxuejvh/?mode=desktop&ref_=m_ft_rpx
mixcloud.com/20aq0iei/?mode=desktop&ref_=m_ft_rpn
mixcloud.com/5n9sd23l/?mode=desktop&ref_=m_ft_nzp
mixcloud.com/06g06mms/?mode=desktop&ref_=m_ft_frb
mixcloud.com/13yru7qj/?mode=desktop&ref_=m_ft_vxd
mixcloud.com/6mvvnjdy/?mode=desktop&ref_=m_ft_dlj
mixcloud.com/c8ru6ikg/?mode=desktop&ref_=m_ft_vjl
mixcloud.com/8f493djw/?mode=desktop&ref_=m_ft_hvp
mixcloud.com/4ve8gyyx/?mode=desktop&ref_=m_ft_zvx
mixcloud.com/edq9bbsy/?mode=desktop&ref_=m_ft_ddx
mixcloud.com/9iro0qgy/?mode=desktop&ref_=m_ft_bzv
mixcloud.com/r2t65cph/?mode=desktop&ref_=m_ft_jdp
mixcloud.com/7bu0fmwx/?mode=desktop&ref_=m_ft_pzv
mixcloud.com/w9qci54h/?mode=desktop&ref_=m_ft_bzv
mixcloud.com/8dv7ysxp/?mode=desktop&ref_=m_ft_zbr
mixcloud.com/nmei8vq5/?mode=desktop&ref_=m_ft_bfb
mixcloud.com/sdkly98v/?mode=desktop&ref_=m_ft_vvb
mixcloud.com/yxhby7ri/?mode=desktop&ref_=m_ft_xtr
mixcloud.com/whyoe3pn/?mode=desktop&ref_=m_ft_nfb
mixcloud.com/d9n3qe64/?mode=desktop&ref_=m_ft_lzf
mixcloud.com/a52wnuua/?mode=desktop&ref_=m_ft_tfp
mixcloud.com/kftamrvy/?mode=desktop&ref_=m_ft_vhz
mixcloud.com/k2yrx55r/?mode=desktop&ref_=m_ft_tvr
mixcloud.com/6xigb7jb/?mode=desktop&ref_=m_ft_ltz
mixcloud.com/4aifcduh/?mode=desktop&ref_=m_ft_hhp
mixcloud.com/g9f5gd7b/?mode=desktop&ref_=m_ft_jfn
mixcloud.com/l59zb93n/?mode=desktop&ref_=m_ft_xlf
mixcloud.com/90rv1km0/?mode=desktop&ref_=m_ft_hlv
mixcloud.com/geme2owg/?mode=desktop&ref_=m_ft_zxf
mixcloud.com/7p782nu2/?mode=desktop&ref_=m_ft_njf
mixcloud.com/2e5d4y17/?mode=desktop&ref_=m_ft_hfn
mixcloud.com/8zvxfsfn/?mode=desktop&ref_=m_ft_zjh
mixcloud.com/b7w3it50/?mode=desktop&ref_=m_ft_rpl
mixcloud.com/r7hr97tv/?mode=desktop&ref_=m_ft_ljx
mixcloud.com/bsj7hrq4/?mode=desktop&ref_=m_ft_nxh
mixcloud.com/a6g6czg9/?mode=desktop&ref_=m_ft_bth
mixcloud.com/fmfcmey3/?mode=desktop&ref_=m_ft_tfb
来源:oschina
链接:https://my.oschina.net/u/4539494/blog/4305606