Documentation
¶
Index ¶
- Constants
- Variables
- 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) HasCharacterSetName() bool
- func (m *Column) HasComment() bool
- func (m *Column) HasDefault() bool
- func (m *Column) IsAutoIncrement() 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
- type Index
- type IndexColumn
- type Indices
- type JsonNullInt64
- type JsonNullString
- type Partition
- type Partitions
- type Seed
- type Seeds
- type Table
- 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 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 string
Privileges string
ColumnComment string
}
func (*Column) CompareCharacterSet ¶ added in v0.4.1
func (*Column) FormatDefault ¶
func (*Column) HasCharacterSetName ¶ added in v0.4.1
func (*Column) HasComment ¶
func (*Column) HasDefault ¶
func (*Column) IsAutoIncrement ¶
func (*Column) IsNullable ¶
func (*Column) ToModifyCharsetSQL ¶ added in v0.4.1
func (*Column) ToModifySQL ¶
type Columns ¶
type Columns []*Column
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 IndexColumn struct {
Table string
NonUniue int8
KeyName string
SeqInIndex int32
ColumnName string
Collation string
Cardinality JsonNullInt64
SubPart JsonNullString
Packed JsonNullString
Null string
IndexType string
Comment string
IndexComment string
}
type Indices ¶
type Indices []Index
func (Indices) GetSortedKeys ¶
func (Indices) GroupByKeyName ¶
func (*Indices) ResetCardinality ¶
func (m *Indices) ResetCardinality()
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
TableRows int
AvgRowLength int
DataLength int
MaxDataLength JsonNullInt64
IndexLength int
DataFree int
Checksum 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
TableRows int
AvgRowLength int
DataLength int
MaxDataLength int
IndexLength int
DataFree int
AutoIncrement JsonNullInt64
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) ToAlterSQL ¶
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.