func support

支持 函数导出。支持外键关联
This commit is contained in:
谢小军
2020-01-11 22:23:59 +08:00
parent 1ff17da96f
commit f8daa91659
9 changed files with 169 additions and 29 deletions

View File

@@ -18,6 +18,7 @@ var mysqlInfo config.MysqlDbInfo
var outDir string
var singularTable bool
var foreignKey bool
var funcKey bool
var rootCmd = &cobra.Command{
Use: "main",
@@ -60,6 +61,9 @@ func init() {
rootCmd.PersistentFlags().BoolVarP(&foreignKey, "foreign", "f", false, "是否导出外键关联")
rootCmd.MarkFlagRequired("foreign key")
rootCmd.PersistentFlags().BoolVarP(&funcKey, "fun", "F", false, "是否导出函数")
rootCmd.MarkFlagRequired("func export")
rootCmd.Flags().IntVar(&mysqlInfo.Port, "port", 3306, "端口号")
}
@@ -110,4 +114,8 @@ func MergeMysqlDbInfo() {
if foreignKey {
config.SetForeignKey(foreignKey)
}
if funcKey {
config.SetIsOutFunc(funcKey)
}
}