Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateOne ¶
GenerateOne 根据sql生成gorm代码,sql可以从参数、文件、db三种方式获取,优先从高到低
Types ¶
type Args ¶
type Args struct { SQL string // DDL sql DDLFile string // 读取文件的DDL sql DBDsn string // 从db获取表的DDL sql DBTable string Package string // 生成字段的包名(只有model类型有效) GormType bool // 是否显示gorm type名称(只有model类型代码有效) JSONTag bool // 是否包括json tag JSONNamedType int // json命名类型,0:和列名一致,其他值表示驼峰 IsEmbed bool // 是否嵌入gorm.Model CodeType string // 指定生成代码用途,支持4中类型,分别是 model(默认), json, dao, handler ForceTableName bool Charset string Collation string TablePrefix string ColumnPrefix string NoNullType bool NullStyle string }
Args 参数
Click to show internal directories.
Click to hide internal directories.