Documentation
¶
Index ¶
- Constants
- Variables
- func ForeignKeyCheck(turnOn bool) string
- func Quote(name string) string
- func QuoteMulti(names []string) []string
- func QuoteString(name string) string
- type Chunk
- func (m *Chunk) GetColumnIndexBy(columnName string) (int, error)
- func (m *Chunk) GetFormatedTableName() string
- func (m *Chunk) GetSeedGroupBy(columnName string) (map[interface{}]Seed, error)
- func (m *Chunk) ToDeleteSQL(colIdx int) []string
- func (m *Chunk) ToInsertSQL() []string
- func (m *Chunk) ToReplaceSQL() []string
- func (m *Chunk) ToTrancateSQL() string
- type Column
- func (m *Column) AppendPos(all Columns) string
- func (m *Column) CompareCharacterSet(col *Column) bool
- func (m *Column) FormatDefault() string
- func (m *Column) FormatExtra() string
- func (m *Column) HasCharacterSetName() bool
- func (m *Column) HasComment() bool
- func (m *Column) HasDefault() bool
- func (m *Column) HasExtra() bool
- func (m *Column) IsMul() bool
- func (m *Column) IsNullable() bool
- func (m *Column) IsPrimary() bool
- func (m *Column) IsUnique() bool
- func (m *Column) ToAddSQL(pos string) string
- func (m *Column) ToDropSQL() string
- func (m *Column) ToModifyCharsetSQL() string
- func (m *Column) ToModifySQL() string
- func (m *Column) ToSQL() string
- type Columns
- func (m Columns) Contains(c *Column) bool
- func (m Columns) GetBeforeColumn(col *Column) *Column
- func (m Columns) GetSortedColumnNames() []string
- func (m Columns) GroupByColumnName() map[string]*Column
- func (m Columns) ToAddSQL(all Columns) []string
- func (m Columns) ToDropSQL() []string
- func (m Columns) ToSQL() []string
- type Index
- type IndexColumn
- type Indices
- type JsonNullInt64
- type JsonNullString
- type Partition
- type Partitions
- type Seed
- type Seeds
- type Table
- func (m *Table) GetCharset() string
- func (m *Table) GetFormatedTableName() string
- func (m *Table) IsPartitioned() bool
- func (m *Table) ToAlterSQL(sqls []string, partitionSql string) string
- func (m *Table) ToConvertCharsetSQL() string
- func (m *Table) ToCreateSQL() string
- func (m *Table) ToDropSQL() string
- type Tables
Constants ¶
View Source
const ( PartitionMethodLinearKey = "LINEAR KEY" PartitionMethodLinearHash = "LINEAR HASH" PartitionMethodRange = "RANGE COLUMNS" )
Variables ¶
View Source
var (
TimeFmt string = "2006-01-02 15:04:05"
)
Functions ¶
func ForeignKeyCheck ¶ added in v0.5.4
ForeignKeyCheck returns `"SET FOREIGN_KEY_CHECKS = %s"`
func QuoteMulti ¶
func QuoteString ¶
Types ¶
type Chunk ¶
func (*Chunk) GetFormatedTableName ¶
func (*Chunk) GetSeedGroupBy ¶
func (*Chunk) ToDeleteSQL ¶
func (*Chunk) ToInsertSQL ¶
func (*Chunk) ToReplaceSQL ¶
func (*Chunk) ToTrancateSQL ¶
type Column ¶
type Column struct {
TableCatalog string
TableSchema string
TableName string
ColumnName string
OrdinalPosition int32
ColumnDefault JsonNullString
Nullable string
DataType string
CharacterMaximumLength JsonNullInt64
CharacterOctetLength JsonNullInt64
NumericPrecision JsonNullInt64
NumericScale JsonNullInt64
CharacterSetName JsonNullString
CollationName JsonNullString
ColumnType string
ColumnKey string
Extra JsonNullString
Privileges string
ColumnComment string
}
func (*Column) CompareCharacterSet ¶ added in v0.4.1
func (*Column) FormatDefault ¶
func (*Column) FormatExtra ¶ added in v0.4.7
func (*Column) HasCharacterSetName ¶ added in v0.4.1
func (*Column) HasComment ¶
func (*Column) HasDefault ¶
func (*Column) IsNullable ¶
func (*Column) ToModifyCharsetSQL ¶ added in v0.4.1
func (*Column) ToModifySQL ¶
type Columns ¶
type Columns []*Column
func (Columns) GetBeforeColumn ¶ added in v0.5.0
func (Columns) GetSortedColumnNames ¶
func (Columns) GroupByColumnName ¶
type Index ¶
type Index []IndexColumn
func (Index) ColumnNames ¶
func (Index) GetKeyName ¶
func (Index) IsPrimaryKey ¶
func (Index) IsUniqueKey ¶
func (Index) KeyNamesWithSubPart ¶
type IndexColumn ¶
type JsonNullInt64 ¶
func (JsonNullInt64) MarshalJSON ¶
func (v JsonNullInt64) MarshalJSON() ([]byte, error)
func (*JsonNullInt64) UnmarshalJSON ¶
func (v *JsonNullInt64) UnmarshalJSON(data []byte) error
type JsonNullString ¶
type JsonNullString struct {
sql.NullString
}
func (JsonNullString) MarshalJSON ¶
func (v JsonNullString) MarshalJSON() ([]byte, error)
func (*JsonNullString) UnmarshalJSON ¶
func (v *JsonNullString) UnmarshalJSON(data []byte) error
type Partition ¶ added in v0.4.3
type Partition struct {
TableCatalog string
TableSchema string
TableName string
PartitionName string
SubpartitionName JsonNullString
PartitionOrdinalPosition string
SubpartitionOrdinalPosition JsonNullString
PartitionMethod string
SubpartitionMethod JsonNullString
PartitionExpression string
SubpartitionExpression JsonNullString
PartitionDescription JsonNullString
PartitionComment string
Nodegroup string
TablespaceName JsonNullString
}
type Partitions ¶ added in v0.4.3
type Partitions []*Partition
func GetPartitions ¶ added in v0.4.3
func (Partitions) ToSQL ¶ added in v0.4.3
func (m Partitions) ToSQL() string
type Seed ¶
type Seed struct {
ColumnData []interface{}
}
func (Seed) ToColumnValue ¶
func (Seed) ToValueSQL ¶
func (Seed) ValueEqual ¶
type Table ¶
type Table struct {
TableCatalog string
TableSchema string
TableName string
TableType string
Engine string
Version int
RowFormat string
TableCollation string
CheckSum JsonNullString
CreateOptions string
TableComment string
Columns Columns
Indices Indices
Partitions Partitions
}
func (*Table) GetCharset ¶
func (*Table) GetFormatedTableName ¶
func (*Table) IsPartitioned ¶ added in v0.4.3
func (*Table) ToConvertCharsetSQL ¶ added in v0.4.1
func (*Table) ToCreateSQL ¶
type Tables ¶
type Tables []*Table
func (Tables) GetFormatedTableNames ¶
func (Tables) GetSortedTableNames ¶
func (Tables) GroupByTableName ¶
Click to show internal directories.
Click to hide internal directories.