corrected 'skip table generation' check
This commit is contained in:
parent
bda94469ea
commit
199bb2a20a
2 changed files with 10 additions and 10 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -21,4 +21,6 @@ gen
|
||||||
.tests/testdata/
|
.tests/testdata/
|
||||||
.gen
|
.gen
|
||||||
.docker
|
.docker
|
||||||
.env
|
.env
|
||||||
|
.tempTestDir
|
||||||
|
.gentestdata3
|
||||||
|
|
@ -67,28 +67,26 @@ func processSQLBuilder(dirPath string, dialect jet.Dialect, schemaMetaData metad
|
||||||
}
|
}
|
||||||
|
|
||||||
func processTableSQLBuilderSetSchema(dirPath string, schemaMetadata metadata.Schema, builderTemplate SQLBuilder) {
|
func processTableSQLBuilderSetSchema(dirPath string, schemaMetadata metadata.Schema, builderTemplate SQLBuilder) {
|
||||||
if schemaMetadata.IsEmpty() {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
err := utils.EnsureDirPath(dirPath)
|
|
||||||
throw.OnError(err)
|
|
||||||
|
|
||||||
var builders []TableSQLBuilder
|
var builders []TableSQLBuilder
|
||||||
for _, tm := range schemaMetadata.TablesMetaData {
|
for _, tm := range schemaMetadata.TablesMetaData {
|
||||||
table := builderTemplate.Table(tm)
|
|
||||||
builders = append(builders, table)
|
|
||||||
|
|
||||||
|
table := builderTemplate.Table(tm)
|
||||||
if table.Skip {
|
if table.Skip {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
builders = append(builders, table)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(builders) == 0 {
|
if len(builders) == 0 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println("Generating global `SetSchema` method...")
|
err := utils.EnsureDirPath(dirPath)
|
||||||
|
throw.OnError(err)
|
||||||
|
|
||||||
|
fmt.Println("Generating global `SetSchema` method")
|
||||||
schemaIdentifier := utils.ToGoIdentifier(schemaMetadata.Name)
|
schemaIdentifier := utils.ToGoIdentifier(schemaMetadata.Name)
|
||||||
|
|
||||||
funcPath := path.Join(dirPath, builders[0].Path)
|
funcPath := path.Join(dirPath, builders[0].Path)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue