Documentation ¶
Index ¶
- Constants
- func GetTableInfo(dsn, tableName string) (string, error)
- func ParseSQL(sql string, options ...Option) (map[string]string, error)
- type Codes
- type NullStyle
- type Option
- func WithCharset(charset string) Option
- func WithCollation(collation string) Option
- func WithColumnPrefix(p string) Option
- func WithEmbed() Option
- func WithForceTableName() Option
- func WithGormType() Option
- func WithJSONTag(namedType int) Option
- func WithNoNullType() Option
- func WithNullStyle(s NullStyle) Option
- func WithPackage(pkg string) Option
- func WithTablePrefix(p string) Option
Constants ¶
View Source
const ( // TableName table name TableName = "__table_name__" // CodeTypeModel model code CodeTypeModel = "model" // CodeTypeJSON json code CodeTypeJSON = "json" // CodeTypeDAO update fields code CodeTypeDAO = "dao" // CodeTypeHandler handler request and respond code CodeTypeHandler = "handler" // CodeTypeProto proto file code CodeTypeProto = "proto" // CodeTypeService grpc service code CodeTypeService = "service" )
Variables ¶
This section is empty.
Functions ¶
func GetTableInfo ¶ added in v1.4.0
GetTableInfo get table info from mysql
Types ¶
type Codes ¶
type Codes struct { Model []string // model code UpdateFields []string // update fields code ModelJSON []string // model json code HandlerStruct []string // handler request and respond code }
Codes 生成的代码
type Option ¶
type Option func(*options)
Option function
func WithJSONTag ¶ added in v1.4.0
WithJSONTag json名称命名类型,0:表示默认,其他值表示驼峰
Click to show internal directories.
Click to hide internal directories.