Documentation
¶
Index ¶
- Constants
- func CamelCaseConvert(strIn string) (strOut string)
- func CreateOutputFile(cmd *Commander, table *TableSchema, strFileSuffix string, append bool) (file *os.File, err error)
- func GetDatabaseName(strPath string) (strName string)
- func IsInSlice(in string, s []string) bool
- func MakeGetter(strStructName, strColName, strColType string) (strGetter string)
- func MakeSetter(strStructName, strColName, strColType string) (strSetter string)
- func MakeTags(strColName, strColType, strTagValue, strComment string, strAppends string) string
- func ReplaceCRLF(strIn string) (strOut string)
- func TrimSpaceSlice(s []string) (ts []string)
- type Commander
- type TableColumn
- type TableSchema
Constants ¶
View Source
const ( IMPORT_GOGO_PROTO = `import "github.com/gogo/protobuf/gogoproto/gogo.proto";` IMPORT_SQLCA = `import "github.com/civet148/sqlca"` )
Variables ¶
This section is empty.
Functions ¶
func CamelCaseConvert ¶ added in v1.1.13
func CreateOutputFile ¶ added in v1.1.13
func GetDatabaseName ¶ added in v1.1.13
func MakeGetter ¶ added in v1.1.6
func MakeSetter ¶ added in v1.1.6
func ReplaceCRLF ¶ added in v1.1.6
func TrimSpaceSlice ¶ added in v1.1.13
Types ¶
type Commander ¶ added in v1.1.6
type Commander struct {
ConnUrl string
Database string
Tables []string
Without []string
ReadOnly []string
Tags []string
Scheme string
Host string
User string
Password string
Charset string
OutDir string
Prefix string
Suffix string
PackageName string
Protobuf bool
DisableDecimal bool
OneFile bool
GogoOptions []string
}
type TableColumn ¶ added in v1.1.6
type TableColumn struct {
Name string `json:"COLUMN_NAME" db:"COLUMN_NAME"`
DataType string `json:"DATA_TYPE" db:"DATA_TYPE"`
Key string `json:"COLUMN_KEY" db:"COLUMN_KEY"`
Extra string `json:"EXTRA" db:"EXTRA"`
Comment string `json:"COLUMN_COMMENT" db:"COLUMN_COMMENT"`
IsPrimaryKey bool // is primary key
IsDecimal bool // is decimal type
IsReadOnly bool // is read only
GoName string //column name in golang
GoType string //column type in golang
}
type TableSchema ¶ added in v1.1.6
type TableSchema struct {
SchemeName string `json:"TABLE_SCHEMA" db:"TABLE_SCHEMA"` //database name
TableName string `json:"TABLE_NAME" db:"TABLE_NAME"` //table name
TableEngine string `json:"ENGINE" db:"ENGINE"` //database engine
TableComment string `json:"TABLE_COMMENT" db:"TABLE_COMMENT"` //comment of table schema
SchemeDir string `json:"SCHEMA_DIR" db:"SCHEMA_DIR"` //output path
PkName string `json:"PK_NAME" db:"PK_NAME"` //primary key column name
StructName string `json:"STRUCT_NAME" db:"STRUCT_NAME"` //struct name
OutDir string `json:"OUT_DIR" db:"OUT_DIR"` //output directory
FileName string `json:"FILE_NAME" db:"FILE_NAME"` //output directory
Columns []TableColumn `json:"TABLE_COLUMNS" db:"TABLE_COLUMNS"` //columns with database and golang
}
Click to show internal directories.
Click to hide internal directories.