From ed49792d42204d2f3a7e8c644ec445efb051c82b Mon Sep 17 00:00:00 2001 From: XuShuo Date: Tue, 30 Sep 2025 15:32:35 +0800 Subject: [PATCH] feat: add WithoutQuery mode --- config.go | 3 +++ generator.go | 4 ++++ 2 files changed, 7 insertions(+) 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) }