Documentation
¶
Index ¶
- Variables
- func Quote(name string) string
- func QuoteMulti(names []string) []string
- func QuoteString(name string) string
- func Unescape(s 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) FormatDefault() string
- 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) ToModifySQL() string
- func (m *Column) ToSQL() string
- type Columns
- type Index
- type IndexColumn
- type Indices
- type JsonNullInt64
- type JsonNullString
- type Seed
- type Seeds
- type Table
- type Tables
Constants ¶
This section is empty.
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) FormatDefault ¶
func (*Column) HasComment ¶
func (*Column) HasDefault ¶
func (*Column) IsAutoIncrement ¶
func (*Column) IsNullable ¶
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 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
}
func (*Table) GetCharset ¶
func (*Table) GetFormatedTableName ¶
func (*Table) ToAlterSQL ¶
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.