Documentation
¶
Index ¶
- Constants
- Variables
- func CreateBootGoFile(env *Env, boot_tpl string, fillVarsFunc func(map[string]interface{})) error
- func FmtGoFile(gofile string) error
- func RenderByTplFile(tplfile string, data interface{}) ([]byte, error)
- func RenderDMgo(DMTemplateFilePath string, MmPackage string, m *ModelSQLGen) ([]byte, error)
- func RenderTpl(tplname string, tplcontent string, data interface{}) ([]byte, error)
- type Col
- type DataType
- type Env
- type ModelSQLGen
- func (m *ModelSQLGen) ColsSQL() string
- func (m *ModelSQLGen) CreateTableSQL() string
- func (m *ModelSQLGen) DeleteByPK_SQL() string
- func (m *ModelSQLGen) HasCreateTime() bool
- func (m *ModelSQLGen) HasModifiedTime() bool
- func (m *ModelSQLGen) InsertCode() string
- func (m *ModelSQLGen) JoinCols(alias string, hasPK, hasTimes bool) string
- func (m *ModelSQLGen) PlaceholdSQL() string
- func (m *ModelSQLGen) QueryByPK_SQL() string
- func (m *ModelSQLGen) UpdateColsSQL() string
Constants ¶
Variables ¶
View Source
var IGNORE_UPDATE_COLNAMES = []string{"CreateTime", "ModifiedTime"}
Functions ¶
func CreateBootGoFile ¶
func RenderByTplFile ¶
func RenderDMgo ¶
func RenderDMgo(DMTemplateFilePath string, MmPackage string, m *ModelSQLGen) ([]byte, error)
Types ¶
type Col ¶
type Env ¶
func (*Env) PrintDebug ¶
func (m *Env) PrintDebug()
type ModelSQLGen ¶
type ModelSQLGen struct { Struct reflect.Type TableName string PKCol *Col Cols []*Col UpdateCols []*Col //no PK, createtime, modifiedtime // contains filtered or unexported fields }
func CreateSQLGenByObj ¶
func CreateSQLGenByObj(obj interface{}, tableName string, pk_col_name string) *ModelSQLGen
func (*ModelSQLGen) ColsSQL ¶
func (m *ModelSQLGen) ColsSQL() string
func (*ModelSQLGen) CreateTableSQL ¶
func (m *ModelSQLGen) CreateTableSQL() string
func (*ModelSQLGen) DeleteByPK_SQL ¶
func (m *ModelSQLGen) DeleteByPK_SQL() string
func (*ModelSQLGen) HasCreateTime ¶
func (m *ModelSQLGen) HasCreateTime() bool
func (*ModelSQLGen) HasModifiedTime ¶
func (m *ModelSQLGen) HasModifiedTime() bool
func (*ModelSQLGen) InsertCode ¶
func (m *ModelSQLGen) InsertCode() string
func (*ModelSQLGen) JoinCols ¶
func (m *ModelSQLGen) JoinCols(alias string, hasPK, hasTimes bool) string
func (*ModelSQLGen) PlaceholdSQL ¶
func (m *ModelSQLGen) PlaceholdSQL() string
func (*ModelSQLGen) QueryByPK_SQL ¶
func (m *ModelSQLGen) QueryByPK_SQL() string
func (*ModelSQLGen) UpdateColsSQL ¶
func (m *ModelSQLGen) UpdateColsSQL() string
Click to show internal directories.
Click to hide internal directories.