Documentation ¶
Index ¶
- Variables
- func AddJSONFormGormTag(in string) string
- func AddressCrdb() string
- func ConnectCrdb() map[string]*gorm.DB
- func ConnectSql() map[string]*gorm.DB
- func FindUpperElement(s string) []string
- func GenerateFile(filePath string, content string) error
- func GenerateModel(source string, tableName string) interface{}
- func HumpToUnderLine(s string) string
- func InfoSql() string
- func Split(s string, sub string) []string
- func Split2(s string, sub string, tmp *string, rs *[]string)
- func TableToStruct(dataSource string, tableName string) string
- func UnderLineToHump(s string) string
- type Column
- type Index
- type Table
Constants ¶
This section is empty.
Variables ¶
View Source
var CRDBInstance map[string]*gorm.DB
View Source
var DBInstance map[string]*gorm.DB
View Source
var FindColumnsSql = `
SELECT COLUMN_NAME,DATA_TYPE,IS_NULLABLE,COLUMN_DEFAULT
FROM information_schema.COLUMNS
WHERE TABLE_NAME = ?
`
Functions ¶
func AddJSONFormGormTag ¶
AddJSONFormGormTag adds json format
func AddressCrdb ¶
func AddressCrdb() string
func ConnectCrdb ¶
func ConnectSql ¶
func FindUpperElement ¶
FindUpperElement finds a list of uppercase letters in the string, attached to HumpToUnderLine
func GenerateModel ¶
func TableToStruct ¶
generate go model y specific the dataSource and table name
Types ¶
type Column ¶
type Column struct { ColumnNumber int `gorm:"column_number "` // column index ColumnName string `gorm:"column_name"` // column_name DataType string `gorm:"data_type"` // column_type ColumnDefault string `gorm:"column_default"` // column_default IsNullAble bool `gorm:"is_nullable"` // column_default Constraint Index `gorm:"indices"` // column_default }
func FindColumns ¶
find columns' property by specific dataSource and table name
Click to show internal directories.
Click to hide internal directories.