gendao

package
v0.0.0-...-c03e756 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2024 License: MIT Imports: 18 Imported by: 0

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 = `` /* 703-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 ','`
	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`
	CGenDaoBriefDTOPath         = `directory path for storing generated dto 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`
	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}"`
	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"`
	DTOPath            string                 `name:"dtoPath"             short:"dto"  brief:"{CGenDaoBriefDTOPath}" d:"model/dto"`
	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[string]TypeMapping `name:"typeMapping"         short:"y"  brief:"{CGenDaoBriefTypeMapping}" orphan:"true"`
}

type CGenDaoInternalInput

type CGenDaoInternalInput struct {
	CGenDaoInput
	DB            gdb.DB
	TableNames    []string
	NewTableNames []string
}

type CGenDaoOutput

type CGenDaoOutput struct{}

type TypeMapping

type TypeMapping struct {
	Type   string `brief:"custom attribute type name"`
	Import string `brief:"custom import for this type"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL