Documentation ¶
Index ¶
- func GetCurrentPath() string
- func GetGoType(exp ast.Expr) string
- func GetModuleName() (string, string)
- func GetRelativePath() string
- func GoCamelCase(s string) string
- func GoModFilePath() string
- func GoTypeToProtoType(g string) string
- func GoTypeToTypeScriptDefaultValue(g string) string
- func GoTypeToWhereFunc(gt, gn string) string
- func Incr(x int) int
- func IsNumber(arg string) bool
- func JSONCamelCase(s string) string
- func JSONSnakeCase(s string) string
- func MysqlToGoFieldType(dt, ct string) (string, int)
- func PostgresToGoFieldType(dt, ct string) (string, int)
- func SQLTool(t *Table, flag string) string
- func Sqlite3ToGoFieldType(dt, ct string) (string, int)
- type Column
- type Document
- type Field
- type PbField
- type PbMessage
- type Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCurrentPath ¶
func GetCurrentPath() string
func GetModuleName ¶
func GetRelativePath ¶
func GetRelativePath() string
func GoCamelCase ¶
func GoModFilePath ¶
func GoModFilePath() string
func GoTypeToProtoType ¶
func GoTypeToWhereFunc ¶ added in v1.1.0
func JSONCamelCase ¶
JSONCamelCase converts a snake_case identifier to a camelCase identifier, according to the protobuf JSON specification.
func JSONSnakeCase ¶
JSONSnakeCase converts a camelCase identifier to a snake_case identifier, according to the protobuf JSON specification.
func MysqlToGoFieldType ¶
MysqlToGoFieldType MysqlToGoFieldType
func PostgresToGoFieldType ¶ added in v1.1.0
func Sqlite3ToGoFieldType ¶ added in v1.1.0
Types ¶
type Column ¶
type Column struct { OrdinalPosition int // field_ordinal ColumnName string // column_name DataType string // data_type ColumnType string // column_type ColumnComment string // column_comment, NotNull bool // not_null IsPrimaryKey bool // is_primary_key IsAutoIncrment bool // is_auto_incrment IsDefaultCurrentTimestamp bool // is_default_currenttimestamp GoColumnName string // go field name GoColumnType string // go field type BigType int // 0 表示不生成where 1 表示比较类型 2表示比较类型+字符串 3表示比较类型,修改传入参数 GoConditionType string // 生成where 的类型参数 ProtoType string // protoType }
Column Column
func MysqlColumn ¶
func MysqlColumn(ddl *ast.CreateTableStmt, notint64 bool) ([]*Column, error)
func PostgresColumn ¶ added in v1.1.0
func PostgresColumn(ddl *pg_query.CreateStmt, notint64 bool) ([]*Column, error)
func Sqlite3Column ¶ added in v1.1.0
func Sqlite3Column(ddl *sql.CreateTableStatement, notint64 bool) ([]*Column, error)
type Document ¶
type Document struct { Package string Name string GoName string ImportTime bool Fields []*Field ObjectIDField *Field }
func ParseMongoStruct ¶
type PbMessage ¶
func ParseStruct ¶
type Table ¶
type Table struct { Database string SchemaName string // for pg TableName string // table name GoTableName string // go struct name PackageName string // package name Fields []*Column // columns GenerateWhereCol []*Column // GenerateWhereCol 生成where字段比较方法的列 PrimaryKey *Column // primary_key column ImportTime bool // is need import time RelativePath string Protopkg string Dialect string //mysql postgres sqlite3 }
Table Table
func PostgresTable ¶ added in v1.1.0
Click to show internal directories.
Click to hide internal directories.