Documentation
¶
Index ¶
- Variables
- func GenerateMapRouterKey(schema string, table string) string
- func GenerateMapRouterVersionKey(schema string, table string, version uint) string
- func SplitMapRouterKey(key string) (schema string, table string)
- func SplitMapRouterVersionKey(key string) (schema string, table string, version uint)
- func TableDdlHandle(tab *Table, sql string) error
- func TableRestore(astNode interface{}) (rawSql string, err error)
- type Column
- type ColumnType
- type ColumnsMapper
- type DdlStatement
- type Router
- type Routers
- type Table
Constants ¶
This section is empty.
Variables ¶
View Source
var MapRouterKeyDelimiter = ":"
Functions ¶
func GenerateMapRouterKey ¶
func GenerateMapRouterVersionKey ¶ added in v0.0.2
func SplitMapRouterKey ¶
func SplitMapRouterVersionKey ¶ added in v0.0.2
func TableDdlHandle ¶ added in v0.1.0
func TableRestore ¶ added in v0.1.0
Types ¶
type Column ¶
type Column struct {
Name string
Type ColumnType
RawType string
Comment string
IsPrimaryKey bool
}
type ColumnType ¶
type ColumnType = int
const ( TypeNumber ColumnType = iota + 1 // tinyint, smallint, mediumint, int, bigint, year TypeFloat // float, double TypeEnum // enum TypeSet // set TypeString // other TypeDatetime // datetime TypeTimestamp // timestamp TypeDate // date TypeTime // time TypeBit // bit TypeJson // json TypeDecimal // decimal TypeBinary // binary )
type ColumnsMapper ¶
type DdlStatement ¶
type DdlStatement struct {
Schema string
Name string
RawSql string
IsAlterTable bool
IsCreateTable bool
CreateTable struct {
IsLikeCreateTable bool
ReferTable struct {
Schema string
Name string
}
IsSelectCreateTable bool
SelectRawSql string
}
IsDropTable bool
IsRenameTable bool
IsTruncateTable bool
}
func TableDdlParser ¶ added in v0.1.0
func TableDdlParser(sql string, schema string) ([]*DdlStatement, error)
type Routers ¶
func (*Routers) InitRouters ¶
Click to show internal directories.
Click to hide internal directories.