feat: skip model and sql gen options in cli

This commit is contained in:
Josh Kaplinsky 2025-04-10 09:02:23 -04:00
parent 6c1224017d
commit 436a72ae5c
No known key found for this signature in database
GPG key ID: 5D5721AE9886811F
3 changed files with 41 additions and 20 deletions

View file

@ -2,14 +2,16 @@ package template
import (
"fmt"
"github.com/go-jet/jet/v2/generator/metadata"
"github.com/go-jet/jet/v2/internal/utils/dbidentifier"
"github.com/google/uuid"
"github.com/jackc/pgtype"
"path/filepath"
"reflect"
"strings"
"time"
"github.com/google/uuid"
"github.com/jackc/pgtype"
"github.com/go-jet/jet/v2/generator/metadata"
"github.com/go-jet/jet/v2/internal/utils/dbidentifier"
)
// Model is template for model files generation
@ -50,6 +52,12 @@ func (m Model) UseEnum(enumFunc func(enumMetaData metadata.Enum) EnumModel) Mode
return m
}
// ShouldSkip returns new Model template with new skip flag set
func (m Model) ShouldSkip(skip bool) Model {
m.Skip = skip
return m
}
// DefaultModel returns default Model template implementation
func DefaultModel() Model {
return Model{