diff --git a/config.go b/config.go index 1f4c00ee..88ac0703 100644 --- a/config.go +++ b/config.go @@ -24,6 +24,9 @@ const ( // WithQueryInterface generate code with exported interface object WithQueryInterface + + // WithoutQuery generate code with model only + WithoutQuery ) // Config generator's basic configuration diff --git a/generator.go b/generator.go index b90bbc79..c3daefc2 100644 --- a/generator.go +++ b/generator.go @@ -301,6 +301,10 @@ func (g *Generator) generateQueryFile() (err error) { return nil } + if g.judgeMode(WithoutQuery) { + return nil + } + if err = os.MkdirAll(g.OutPath, os.ModePerm); err != nil { return fmt.Errorf("make dir outpath(%s) fail: %s", g.OutPath, err) }