Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDefaultGenerator ¶
NewDefaultGenerator creates an instance for defaultGenerator
func RevertTemplate ¶
RevertTemplate reverts the deleted template files
Types ¶
type Key ¶
type Key struct { // VarLeft describes the variable of cache key expression which likes cacheUserIdPrefix VarLeft string // VarRight describes the value of cache key expression which likes "cache:user:id:" VarRight string // VarExpression describes the cache key expression which likes cacheUserIdPrefix = "cache:user:id:" VarExpression string // KeyLeft describes the variable of key definition expression which likes userKey KeyLeft string // KeyRight describes the value of key definition expression which likes fmt.Sprintf("%s%v", cacheUserPrefix, user) KeyRight string // DataKeyRight describes data key likes fmt.Sprintf("%s%v", cacheUserPrefix, data.User) DataKeyRight string // KeyExpression describes key expression likes userKey := fmt.Sprintf("%s%v", cacheUserPrefix, user) KeyExpression string // DataKeyExpression describes data key expression likes userKey := fmt.Sprintf("%s%v", cacheUserPrefix, data.User) DataKeyExpression string // FieldNameJoin describes the filed slice of table FieldNameJoin Join // Fields describes the fields of table Fields []*parser.Field }
Key describes cache key
type Option ¶
type Option func(generator *defaultGenerator)
Option defines a function with argument defaultGenerator
func WithConsoleOption ¶
WithConsoleOption creates a console option.
func WithIgnoreColumns ¶
WithIgnoreColumns ignores the columns while insert or update rows.
func WithPostgreSql ¶
func WithPostgreSql() Option
WithPostgreSql marks defaultGenerator.isPostgreSql true.
Source Files
¶
- batch_save.go
- count.go
- count_unscoped.go
- delete_by_id.go
- delete_by_ids.go
- field.go
- find_by_id.go
- find_by_id_unscoped.go
- find_by_id_unscoped_with_field.go
- find_by_id_with_field.go
- find_by_ids.go
- find_by_ids_unscoped.go
- find_by_ids_unscoped_with_field.go
- find_by_ids_with_field.go
- gen.go
- imports.go
- keys.go
- list.go
- list_unscoped.go
- list_unscoped_with_field.go
- list_with_field.go
- new.go
- page.go
- page_unscoped.go
- page_unscoped_with_field.go
- page_with_field.go
- save.go
- tablename.go
- tag.go
- template.go
- types.go
Click to show internal directories.
Click to hide internal directories.