Documentation ¶
Index ¶
- Constants
- func NewAllowedStmtLinter(allowedDDLs, allowedDMLs uint64) rules.Ruler
- func NewBooleanFieldLinter(script script.Script) rules.Rule
- func NewCharsetLinter(script script.Script) rules.Rule
- func NewColumnCommentLinter(script script.Script) rules.Rule
- func NewColumnNameLinter(script script.Script) rules.Rule
- func NewCompleteInsertLinter(script script.Script) rules.Rule
- func NewCreatedAtDefaultValueLinter(script script.Script) rules.Rule
- func NewCreatedAtExistsLinter(script script.Script) rules.Rule
- func NewCreatedAtTypeLinter(script script.Script) rules.Rule
- func NewDDLDMLLinter(script script.Script) rules.Rule
- func NewDestructLinter(script script.Script) rules.Rule
- func NewFloatDoubleLinter(script script.Script) rules.Rule
- func NewForeignKeyLinter(script script.Script) rules.Rule
- func NewIDExistsLinter(script script.Script) rules.Rule
- func NewIDIsPrimaryLinter(script script.Script) rules.Rule
- func NewIDTypeLinter(script script.Script) rules.Rule
- func NewIndexLengthLinter(script script.Script) rules.Rule
- func NewIndexNameLinter(script script.Script) rules.Rule
- func NewKeywordsLinter(script script.Script) rules.Rule
- func NewManualTimeSetterLinter(script script.Script) rules.Rule
- func NewNotNullLinter(script script.Script) rules.Rule
- func NewTableCommentLinter(script script.Script) rules.Rule
- func NewTableNameLinter(script script.Script) rules.Rule
- func NewUpdatedAtDefaultValueLinter(script script.Script) rules.Rule
- func NewUpdatedAtExistsLinter(script script.Script) rules.Rule
- func NewUpdatedAtOnUpdateLinter(script script.Script) rules.Rule
- func NewUpdatedAtTypeLinter(script script.Script) rules.Rule
- func NewVarcharLengthLinter(script script.Script) rules.Rule
- type AllowedStmt
- type BooleanFieldLinter
- type CharsetLinter
- type ColumnCommentLinter
- type ColumnNameLinter
- type CompleteInsertLinter
- type CreatedAtDefaultValueLinter
- type CreatedAtExistsLinter
- type CreatedAtTypeLinter
- type DDLDMLLinter
- type DestructLinter
- type FloatDoubleLinter
- type ForeignKeyLinter
- type IDExistsLinter
- type IDIsPrimaryLinter
- type IDTypeLinter
- type IndexLengthLinter
- type IndexNameLinter
- type KeywordsLinter
- type ManualTimeSetterLinter
- type NotNullLinter
- type TableCommentLinter
- type TableNameLinter
- type UpdatedAtDefaultValueLinter
- type UpdatedAtExistsLinter
- type UpdatedAtOnUpdateLinter
- type UpdatedAtTypeLinter
- type VarcharLengthLinter
Constants ¶
View Source
const ( CreateDatabaseStmt uint64 = 1 << iota AlterDatabaseStmt DropDatabaseStmt CreateTableStmt DropTableStmt DropSequenceStmt RenameTableStmt CreateViewStmt CreateSequenceStmt CreateIndexStmt DropIndexStmt LockTablesStmt UnlockTablesStmt CleanupTableLockStmt RepairTableStmt TruncateTableStmt RecoverTableStmt FlashBackTableStmt AlterTableOption AlterTableAddColumns AlterTableAddConstraint AlterTableDropColumn AlterTableDropPrimaryKey AlterTableDropIndex AlterTableDropForeignKey AlterTableModifyColumn AlterTableChangeColumn AlterTableRenameColumn AlterTableRenameTable AlterTableAlterColumn AlterTableLock AlterTableAlgorithm AlterTableRenameIndex AlterTableForce AlterTableAddPartitions AlterTableCoalescePartitions AlterTableDropPartition AlterTableTruncatePartition AlterTablePartition AlterTableEnableKeys AlterTableDisableKeys AlterTableRemovePartitioning AlterTableWithValidation AlterTableWithoutValidation AlterTableSecondaryLoad AlterTableSecondaryUnload AlterTableRebuildPartition AlterTableReorganizePartition AlterTableCheckPartitions AlterTableExchangePartition AlterTableOptimizePartition AlterTableRepairPartition AlterTableImportPartitionTablespace AlterTableDiscardPartitionTablespace AlterTableAlterCheck AlterTableDropCheck AlterTableImportTablespace AlterTableDiscardTablespace AlterTableIndexInvisible AlterTableOrderByColumns AlterTableSetTiFlashReplica )
View Source
const ( SelectStmt uint64 = 1 << iota UnionStmt LoadDataStmt InsertStmt DeleteStmt UpdateStmt ShowStmt SplitRegionStmt )
View Source
const ( AlterTableStmt = AlterTableOption | AlterTableAddColumns | AlterTableAddConstraint | AlterTableDropColumn | AlterTableDropPrimaryKey | AlterTableDropIndex | AlterTableDropForeignKey | AlterTableModifyColumn | AlterTableChangeColumn | AlterTableRenameColumn | AlterTableRenameTable | AlterTableAlterColumn | AlterTableLock | AlterTableAlgorithm | AlterTableRenameIndex | AlterTableForce | AlterTableAddPartitions | AlterTableCoalescePartitions | AlterTableDropPartition | AlterTableTruncatePartition | AlterTablePartition | AlterTableEnableKeys | AlterTableDisableKeys | AlterTableRemovePartitioning | AlterTableWithValidation | AlterTableWithoutValidation | AlterTableSecondaryLoad | AlterTableSecondaryUnload | AlterTableRebuildPartition | AlterTableReorganizePartition | AlterTableCheckPartitions | AlterTableExchangePartition | AlterTableOptimizePartition | AlterTableRepairPartition | AlterTableImportPartitionTablespace | AlterTableDiscardPartitionTablespace | AlterTableAlterCheck | AlterTableDropCheck | AlterTableImportTablespace | AlterTableDiscardTablespace | AlterTableIndexInvisible | AlterTableOrderByColumns | AlterTableSetTiFlashReplica DDLStmt = CreateDatabaseStmt | AlterDatabaseStmt | DropDatabaseStmt | CreateTableStmt | DropTableStmt | DropSequenceStmt | RenameTableStmt | CreateViewStmt | CreateSequenceStmt | CreateIndexStmt | DropIndexStmt | LockTablesStmt | UnlockTablesStmt | CleanupTableLockStmt | RepairTableStmt | TruncateTableStmt | RecoverTableStmt | FlashBackTableStmt | AlterTableStmt DMLStmt = SelectStmt | UnionStmt | LoadDataStmt | InsertStmt | DeleteStmt | UpdateStmt | ShowStmt | SplitRegionStmt )
View Source
const UTF8MB4 = "utf8mb4"
Variables ¶
This section is empty.
Functions ¶
func NewAllowedStmtLinter ¶
func NewCompleteInsertLinter ¶
NewCompleteInsertLinter returns a CompleteInsertLinter CompleteInsertLinter lint if the INSERT statement is complete-insert.
e.g. NOT OK: INSERT INTO table_name VALUES (value1,value2,value3,...);
OK: INSERT INTO table_name (column1,column2,column3,...) VALUES (value1,value2,value3,...);
func NewManualTimeSetterLinter ¶
NewManualTimeSetterLinter returns a ManualTimeSetterLinter ManualTimeSetterLinter lints if the user manually set the column created_at, updated_at
Types ¶
type AllowedStmt ¶
type AllowedStmt struct {
// contains filtered or unexported fields
}
func (*AllowedStmt) Error ¶
func (l *AllowedStmt) Error() error
type BooleanFieldLinter ¶
type BooleanFieldLinter struct {
// contains filtered or unexported fields
}
func (*BooleanFieldLinter) Error ¶
func (l *BooleanFieldLinter) Error() error
type CharsetLinter ¶
type CharsetLinter struct {
// contains filtered or unexported fields
}
func (*CharsetLinter) Error ¶
func (l *CharsetLinter) Error() error
type ColumnCommentLinter ¶
type ColumnCommentLinter struct {
// contains filtered or unexported fields
}
func (*ColumnCommentLinter) Error ¶
func (l *ColumnCommentLinter) Error() error
type ColumnNameLinter ¶
type ColumnNameLinter struct {
// contains filtered or unexported fields
}
func (*ColumnNameLinter) Error ¶
func (l *ColumnNameLinter) Error() error
type CompleteInsertLinter ¶
type CompleteInsertLinter struct {
// contains filtered or unexported fields
}
CompleteInsertLinter lints if the INSERT statement is complete
type CreatedAtDefaultValueLinter ¶
type CreatedAtDefaultValueLinter struct {
// contains filtered or unexported fields
}
func (*CreatedAtDefaultValueLinter) Error ¶
func (l *CreatedAtDefaultValueLinter) Error() error
type CreatedAtExistsLinter ¶
type CreatedAtExistsLinter struct {
// contains filtered or unexported fields
}
func (*CreatedAtExistsLinter) Error ¶
func (l *CreatedAtExistsLinter) Error() error
type CreatedAtTypeLinter ¶
type CreatedAtTypeLinter struct {
// contains filtered or unexported fields
}
func (*CreatedAtTypeLinter) Error ¶
func (l *CreatedAtTypeLinter) Error() error
type DDLDMLLinter ¶
type DDLDMLLinter struct {
// contains filtered or unexported fields
}
func (*DDLDMLLinter) Error ¶
func (l *DDLDMLLinter) Error() error
type DestructLinter ¶
type DestructLinter struct {
// contains filtered or unexported fields
}
func (*DestructLinter) Error ¶
func (l *DestructLinter) Error() error
type FloatDoubleLinter ¶
type FloatDoubleLinter struct {
// contains filtered or unexported fields
}
func (*FloatDoubleLinter) Error ¶
func (l *FloatDoubleLinter) Error() error
type ForeignKeyLinter ¶
type ForeignKeyLinter struct {
// contains filtered or unexported fields
}
func (*ForeignKeyLinter) Error ¶
func (l *ForeignKeyLinter) Error() error
type IDExistsLinter ¶
type IDExistsLinter struct {
// contains filtered or unexported fields
}
func (*IDExistsLinter) Error ¶
func (l *IDExistsLinter) Error() error
type IDIsPrimaryLinter ¶
type IDIsPrimaryLinter struct {
// contains filtered or unexported fields
}
func (*IDIsPrimaryLinter) Error ¶
func (l *IDIsPrimaryLinter) Error() error
type IDTypeLinter ¶
type IDTypeLinter struct {
// contains filtered or unexported fields
}
func (*IDTypeLinter) Error ¶
func (l *IDTypeLinter) Error() error
type IndexLengthLinter ¶
type IndexLengthLinter struct {
// contains filtered or unexported fields
}
func (*IndexLengthLinter) Error ¶
func (l *IndexLengthLinter) Error() error
type IndexNameLinter ¶
type IndexNameLinter struct {
// contains filtered or unexported fields
}
func (*IndexNameLinter) Error ¶
func (l *IndexNameLinter) Error() error
type KeywordsLinter ¶
type KeywordsLinter struct {
// contains filtered or unexported fields
}
func (*KeywordsLinter) Error ¶
func (l *KeywordsLinter) Error() error
type ManualTimeSetterLinter ¶
type ManualTimeSetterLinter struct {
// contains filtered or unexported fields
}
ManualTimeSetterLinter lints if the user manually set the column created_at, updated_at
type NotNullLinter ¶
type NotNullLinter struct {
// contains filtered or unexported fields
}
func (*NotNullLinter) Error ¶
func (l *NotNullLinter) Error() error
type TableCommentLinter ¶
type TableCommentLinter struct {
// contains filtered or unexported fields
}
func (*TableCommentLinter) Error ¶
func (l *TableCommentLinter) Error() error
type TableNameLinter ¶
type TableNameLinter struct {
// contains filtered or unexported fields
}
func (*TableNameLinter) Error ¶
func (l *TableNameLinter) Error() error
type UpdatedAtDefaultValueLinter ¶
type UpdatedAtDefaultValueLinter struct {
// contains filtered or unexported fields
}
func (*UpdatedAtDefaultValueLinter) Error ¶
func (l *UpdatedAtDefaultValueLinter) Error() error
type UpdatedAtExistsLinter ¶
type UpdatedAtExistsLinter struct {
// contains filtered or unexported fields
}
func (*UpdatedAtExistsLinter) Error ¶
func (l *UpdatedAtExistsLinter) Error() error
type UpdatedAtOnUpdateLinter ¶
type UpdatedAtOnUpdateLinter struct {
// contains filtered or unexported fields
}
func (*UpdatedAtOnUpdateLinter) Error ¶
func (l *UpdatedAtOnUpdateLinter) Error() error
type UpdatedAtTypeLinter ¶
type UpdatedAtTypeLinter struct {
// contains filtered or unexported fields
}
func (*UpdatedAtTypeLinter) Error ¶
func (l *UpdatedAtTypeLinter) Error() error
type VarcharLengthLinter ¶
type VarcharLengthLinter struct {
// contains filtered or unexported fields
}
func (*VarcharLengthLinter) Error ¶
func (l *VarcharLengthLinter) Error() error
Source Files ¶
- allowed_stmt_linter.go
- base.go
- boolean_field_linter.go
- charset_linter.go
- column_comment_linter.go
- column_name_linter.go
- complete_insert_linter.go
- created_at_linter.go
- ddl_dml_linter.go
- destruct_linter.go
- float_linter.go
- foreignkey_linter.go
- id_linter.go
- index_length_linter.go
- index_name_linter.go
- keywords_linter.go
- manual_time_setter_linter.go
- not_null_linter.go
- table_comment_linter.go
- tablename_linter.go
- updated_at_linter.go
- varchar_length_linter.go
Click to show internal directories.
Click to hide internal directories.