Documentation ¶
Index ¶
Constants ¶
View Source
const ( CGenDaoConfig = `gfcli.gen.dao` CGenDaoUsage = `gf gen dao [OPTION]` CGenDaoBrief = `automatically generate go files for dao/do/entity` CGenDaoEg = `` /* 161-byte string literal not displayed */ CGenDaoAd = `` /* 819-byte string literal not displayed */ CGenDaoBriefPath = `directory path for generated files` CGenDaoBriefLink = `database configuration, the same as the ORM configuration of GoFrame` CGenDaoBriefTables = `generate models only for given tables, multiple table names separated with ','` CGenDaoBriefTablesEx = `generate models excluding given tables, multiple table names separated with ','` CGenDaoBriefPrefix = `add prefix for all table of specified link/database tables` CGenDaoBriefRemovePrefix = `remove specified prefix of the table, multiple prefix separated with ','` CGenDaoBriefRemoveFieldPrefix = `remove specified prefix of the field, multiple prefix separated with ','` CGenDaoBriefStdTime = `use time.Time from stdlib instead of gtime.Time for generated time/date fields of tables` CGenDaoBriefWithTime = `add created time for auto produced go files` CGenDaoBriefGJsonSupport = `use gJsonSupport to use *gjson.Json instead of string for generated json fields of tables` CGenDaoBriefImportPrefix = `custom import prefix for generated go files` CGenDaoBriefDaoPath = `directory path for storing generated dao files under path` CGenDaoBriefDoPath = `directory path for storing generated do files under path` CGenDaoBriefEntityPath = `directory path for storing generated entity files under path` CGenDaoBriefOverwriteDao = `overwrite all dao files both inside/outside internal folder` CGenDaoBriefModelFile = `custom file name for storing generated model content` CGenDaoBriefModelFileForDao = `custom file name generating model for DAO operations like Where/Data. It's empty in default` CGenDaoBriefDescriptionTag = `add comment to description tag for each field` CGenDaoBriefNoJsonTag = `no json tag will be added for each field` CGenDaoBriefNoModelComment = `no model comment will be added for each field` CGenDaoBriefClear = `delete all generated go files that do not exist in database` CGenDaoBriefTypeMapping = `custom local type mapping for generated struct attributes relevant to fields of table` CGenDaoBriefFieldMapping = `custom local type mapping for generated struct attributes relevant to specific fields of table` CGenDaoBriefGroup = `` /* 135-byte string literal not displayed */ CGenDaoBriefJsonCase = `` /* 442-byte string literal not displayed */ CGenDaoBriefTplDaoIndexPath = `template file path for dao index file` CGenDaoBriefTplDaoInternalPath = `template file path for dao internal file` CGenDaoBriefTplDaoDoPathPath = `template file path for dao do file` CGenDaoBriefTplDaoEntityPath = `template file path for dao entity file` )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CGenDao ¶
type CGenDao struct{}
func (CGenDao) Dao ¶
func (c CGenDao) Dao(ctx context.Context, in CGenDaoInput) (out *CGenDaoOutput, err error)
type CGenDaoInput ¶
type CGenDaoInput struct { g.Meta `name:"dao" config:"{CGenDaoConfig}" usage:"{CGenDaoUsage}" brief:"{CGenDaoBrief}" eg:"{CGenDaoEg}" ad:"{CGenDaoAd}"` Path string `name:"path" short:"p" brief:"{CGenDaoBriefPath}" d:"internal"` Link string `name:"link" short:"l" brief:"{CGenDaoBriefLink}"` Tables string `name:"tables" short:"t" brief:"{CGenDaoBriefTables}"` TablesEx string `name:"tablesEx" short:"x" brief:"{CGenDaoBriefTablesEx}"` Group string `name:"group" short:"g" brief:"{CGenDaoBriefGroup}" d:"default"` Prefix string `name:"prefix" short:"f" brief:"{CGenDaoBriefPrefix}"` RemovePrefix string `name:"removePrefix" short:"r" brief:"{CGenDaoBriefRemovePrefix}"` RemoveFieldPrefix string `name:"removeFieldPrefix" short:"rf" brief:"{CGenDaoBriefRemoveFieldPrefix}"` JsonCase string `name:"jsonCase" short:"j" brief:"{CGenDaoBriefJsonCase}" d:"CamelLower"` ImportPrefix string `name:"importPrefix" short:"i" brief:"{CGenDaoBriefImportPrefix}"` DaoPath string `name:"daoPath" short:"d" brief:"{CGenDaoBriefDaoPath}" d:"dao"` DoPath string `name:"doPath" short:"o" brief:"{CGenDaoBriefDoPath}" d:"model/do"` EntityPath string `name:"entityPath" short:"e" brief:"{CGenDaoBriefEntityPath}" d:"model/entity"` TplDaoIndexPath string `name:"tplDaoIndexPath" short:"t1" brief:"{CGenDaoBriefTplDaoIndexPath}"` TplDaoInternalPath string `name:"tplDaoInternalPath" short:"t2" brief:"{CGenDaoBriefTplDaoInternalPath}"` TplDaoDoPath string `name:"tplDaoDoPath" short:"t3" brief:"{CGenDaoBriefTplDaoDoPathPath}"` TplDaoEntityPath string `name:"tplDaoEntityPath" short:"t4" brief:"{CGenDaoBriefTplDaoEntityPath}"` StdTime bool `name:"stdTime" short:"s" brief:"{CGenDaoBriefStdTime}" orphan:"true"` WithTime bool `name:"withTime" short:"w" brief:"{CGenDaoBriefWithTime}" orphan:"true"` GJsonSupport bool `name:"gJsonSupport" short:"n" brief:"{CGenDaoBriefGJsonSupport}" orphan:"true"` OverwriteDao bool `name:"overwriteDao" short:"v" brief:"{CGenDaoBriefOverwriteDao}" orphan:"true"` DescriptionTag bool `name:"descriptionTag" short:"c" brief:"{CGenDaoBriefDescriptionTag}" orphan:"true"` NoJsonTag bool `name:"noJsonTag" short:"k" brief:"{CGenDaoBriefNoJsonTag}" orphan:"true"` NoModelComment bool `name:"noModelComment" short:"m" brief:"{CGenDaoBriefNoModelComment}" orphan:"true"` Clear bool `name:"clear" short:"a" brief:"{CGenDaoBriefClear}" orphan:"true"` TypeMapping map[DBFieldTypeName]CustomAttributeType `name:"typeMapping" short:"y" brief:"{CGenDaoBriefTypeMapping}" orphan:"true"` FieldMapping map[DBTableFieldName]CustomAttributeType `name:"fieldMapping" short:"fm" brief:"{CGenDaoBriefFieldMapping}" orphan:"true"` // contains filtered or unexported fields }
type CGenDaoInternalGenItem ¶
type CGenDaoInternalGenItems ¶
type CGenDaoInternalGenItems struct { Items []CGenDaoInternalGenItem // contains filtered or unexported fields }
func (CGenDaoInternalGenItems) AppendDirPath ¶
func (i CGenDaoInternalGenItems) AppendDirPath(storageDirPath string)
func (CGenDaoInternalGenItems) AppendGeneratedFilePath ¶
func (i CGenDaoInternalGenItems) AppendGeneratedFilePath(generatedFilePath string)
func (*CGenDaoInternalGenItems) Scale ¶
func (i *CGenDaoInternalGenItems) Scale()
func (*CGenDaoInternalGenItems) SetClear ¶
func (i *CGenDaoInternalGenItems) SetClear(clear bool)
type CGenDaoInternalInput ¶
type CGenDaoInternalInput struct { CGenDaoInput DB gdb.DB TableNames []string NewTableNames []string }
type CGenDaoOutput ¶
type CGenDaoOutput struct{}
type CustomAttributeType ¶
type DBFieldTypeName ¶
type DBFieldTypeName = string
type DBTableFieldName ¶
type DBTableFieldName = string
type FieldNameCase ¶
type FieldNameCase string
const ( FieldNameCaseCamel FieldNameCase = "CaseCamel" FieldNameCaseCamelLower FieldNameCase = "CaseCamelLower" )
Click to show internal directories.
Click to hide internal directories.