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 Field ¶
type Field struct { NameOriginal string UpperName string LowerName string DataType string Comment string SeqInIndex int OrdinalPosition int }
Field describes a table field
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.
Click to show internal directories.
Click to hide internal directories.