Skip to content

Commit 897e995

Browse files
authored
fix: ignore tabel (#1288)
* fix: ignore table * feat: field filter
1 parent 4bf9d89 commit 897e995

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

field_options.go

+6
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ var (
2727
}
2828
}
2929

30+
FieldFilter = func(opt func(Field) Field) model.FilterFieldOpt {
31+
return func(f *model.Field) *model.Field {
32+
return opt(f)
33+
}
34+
}
35+
3036
// WithDataTypesNullType configures the types of fields to use their datatypes nullable counterparts.
3137
/**
3238
*

internal/model/config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func (cfg *Config) GetNames() (tableName, structName, fileName string) {
7676
if cfg.TableNameNS != nil {
7777
tableName = cfg.TableNameNS(tableName)
7878
}
79-
if !strings.HasPrefix(tableName, cfg.TablePrefix) {
79+
if tableName != "" && !strings.HasPrefix(tableName, cfg.TablePrefix) {
8080
tableName = cfg.TablePrefix + tableName
8181
}
8282

0 commit comments

Comments
 (0)