feature 1.1.5 (#411)

This commit is contained in:
anqiansong
2021-03-01 17:29:07 +08:00
committed by GitHub
parent 791e76bcf0
commit d894b88c3e
27 changed files with 1037 additions and 443 deletions

View File

@@ -121,7 +121,7 @@ func fromDataSource(url, pattern, dir string, cfg *config.Config, cache, idea bo
return err
}
matchTables := make(map[string][]*model.Column)
matchTables := make(map[string]*model.Table)
for _, item := range tables {
match, err := filepath.Match(pattern, item)
if err != nil {
@@ -131,11 +131,18 @@ func fromDataSource(url, pattern, dir string, cfg *config.Config, cache, idea bo
if !match {
continue
}
columns, err := im.FindByTableName(dsn.DBName, item)
columnData, err := im.FindColumns(dsn.DBName, item)
if err != nil {
return err
}
matchTables[item] = columns
table, err := columnData.Convert()
if err != nil {
return err
}
matchTables[item] = table
}
if len(matchTables) == 0 {
@@ -147,5 +154,5 @@ func fromDataSource(url, pattern, dir string, cfg *config.Config, cache, idea bo
return err
}
return generator.StartFromInformationSchema(dsn.DBName, matchTables, cache)
return generator.StartFromInformationSchema(matchTables, cache)
}