Documentation
¶
Overview ¶
Package infoschema is a generated GoMock package.
Index ¶
- type Column
- type DbColumn
- type DbIndex
- type IInformationSchema
- type InformationSchemaModel
- type MockIInformationSchema
- func (m *MockIInformationSchema) EXPECT() *MockIInformationSchemaMockRecorder
- func (m *MockIInformationSchema) FindColumns(db, table string) (*Table, error)
- func (m *MockIInformationSchema) FindIndex(db, table, column string) ([]*DbIndex, error)
- func (m *MockIInformationSchema) GetAllTables(database string) ([]string, error)
- type MockIInformationSchemaMockRecorder
- type Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DbColumn ¶
type DbColumn struct { Name string `db:"COLUMN_NAME"` DataType string `db:"DATA_TYPE"` ColumnType string `db:"COLUMN_TYPE"` Extra string `db:"EXTRA"` Comment string `db:"COLUMN_COMMENT"` ColumnDefault interface{} `db:"COLUMN_DEFAULT"` IsNullAble string `db:"IS_NULLABLE"` OrdinalPosition int `db:"ORDINAL_POSITION"` }
DbColumn defines column info of columns
type DbIndex ¶
type DbIndex struct { IndexName string `db:"INDEX_NAME"` NonUnique int `db:"NON_UNIQUE"` SeqInIndex int `db:"SEQ_IN_INDEX"` }
DbIndex defines index of columns in information_schema.statistic
type IInformationSchema ¶
type IInformationSchema interface { GetAllTables(database string) ([]string, error) FindColumns(db, table string) (*Table, error) FindIndex(db, table, column string) ([]*DbIndex, error) }
IInformationSchema defines an interface for schema. Just for mock.
func NewInformationSchemaModel ¶
func NewInformationSchemaModel(conn sqlx.SqlConn) IInformationSchema
NewInformationSchemaModel creates an instance for InformationSchemaModel
type InformationSchemaModel ¶
type InformationSchemaModel struct {
// contains filtered or unexported fields
}
InformationSchemaModel defines information schema model
func (*InformationSchemaModel) FindColumns ¶
func (m *InformationSchemaModel) FindColumns(db, table string) (*Table, error)
FindColumns return columns in specified database and table
func (*InformationSchemaModel) FindIndex ¶
func (m *InformationSchemaModel) FindIndex(db, table, column string) ([]*DbIndex, error)
FindIndex finds index with given db, table and column.
func (*InformationSchemaModel) GetAllTables ¶
func (m *InformationSchemaModel) GetAllTables(database string) ([]string, error)
GetAllTables selects all tables from TABLE_SCHEMA
type MockIInformationSchema ¶
type MockIInformationSchema struct {
// contains filtered or unexported fields
}
MockIInformationSchema is a mock of IInformationSchema interface.
func NewMockIInformationSchema ¶
func NewMockIInformationSchema(ctrl *gomock.Controller) *MockIInformationSchema
NewMockIInformationSchema creates a new mock instance.
func (*MockIInformationSchema) EXPECT ¶
func (m *MockIInformationSchema) EXPECT() *MockIInformationSchemaMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockIInformationSchema) FindColumns ¶
func (m *MockIInformationSchema) FindColumns(db, table string) (*Table, error)
FindColumns mocks base method.
func (*MockIInformationSchema) FindIndex ¶
func (m *MockIInformationSchema) FindIndex(db, table, column string) ([]*DbIndex, error)
FindIndex mocks base method.
func (*MockIInformationSchema) GetAllTables ¶
func (m *MockIInformationSchema) GetAllTables(database string) ([]string, error)
GetAllTables mocks base method.
type MockIInformationSchemaMockRecorder ¶
type MockIInformationSchemaMockRecorder struct {
// contains filtered or unexported fields
}
MockIInformationSchemaMockRecorder is the mock recorder for MockIInformationSchema.
func (*MockIInformationSchemaMockRecorder) FindColumns ¶
func (mr *MockIInformationSchemaMockRecorder) FindColumns(db, table interface{}) *gomock.Call
FindColumns indicates an expected call of FindColumns.
func (*MockIInformationSchemaMockRecorder) FindIndex ¶
func (mr *MockIInformationSchemaMockRecorder) FindIndex(db, table, column interface{}) *gomock.Call
FindIndex indicates an expected call of FindIndex.
func (*MockIInformationSchemaMockRecorder) GetAllTables ¶
func (mr *MockIInformationSchemaMockRecorder) GetAllTables(database interface{}) *gomock.Call
GetAllTables indicates an expected call of GetAllTables.