added a check for skipping generation of table SQL builder code

This commit is contained in:
Jay 2022-12-01 15:15:35 +05:30
parent a792fe6e0a
commit 882d5562f3
3 changed files with 41 additions and 5 deletions

View file

@ -71,16 +71,20 @@ func processTableSQLBuilderSetSchema(dirPath string, schemaMetadata metadata.Sch
return
}
fmt.Println("Generating global `SetSchema` method...")
err := utils.EnsureDirPath(dirPath)
throw.OnError(err)
var builders []TableSQLBuilder
for _, tm := range schemaMetadata.TablesMetaData {
builders = append(builders, builderTemplate.Table(tm))
table := builderTemplate.Table(tm)
builders = append(builders, table)
if table.Skip {
return
}
}
fmt.Println("Generating global `SetSchema` method...")
schemaIdentifier := utils.ToGoIdentifier(schemaMetadata.Name)
funcPath := path.Join(dirPath, builders[0].Path)