Documentation ¶
Index ¶
- Constants
- type ColumnProfileData
- type CustomColumnDefition
- type ProfileDefinition
- type ProfileRecord
- type ProfileStore
- func (p *ProfileStore) NewProfile() (int, error)
- func (p *ProfileStore) RecordTableProfile(tableNameID int, rowCount int, tableSize int64, profileID int) (int, error)
- func (p *ProfileStore) RegisterTable(tableName string) (int, error)
- func (p *ProfileStore) RegisterTableColumn(tableNameID int, columnTypeID int, columnName string) (int, error)
- func (p *ProfileStore) RegisterTableColumnType(columnDataType string) (int, error)
- func (p *ProfileStore) RegisterTableCustomColumn(tableNameID int, columnTypeID int, columnName string, columnDefinition string) (int, error)
- func (p *ProfileStore) ScaffoldProfileStore() error
- func (p *ProfileStore) StoreColumnProfileData(columnNamesID int, columnType string, profileID int, ...) error
- func (p *ProfileStore) StoreCustomColumnProfileData(columnNamesID int, columnType *sql.ColumnType, profileID int, ...) error
- type Profiler
- type ProfilerOptions
- type TableColumnName
- type TableColumnType
- type TableCustomColumnName
- type TableDefinition
- type TableName
- type TableProfile
Constants ¶
const PROFILE_RECORD_ID = `profile_record_id`
const TABLE_COLUMN_NAME_ID = `table_column_name_id`
const TABLE_COLUMN_PROFILE_PREFIX = `table_column_profiles_`
const TABLE_CUSTOM_COLUMN_NAMES = `table_custom_column_names`
const TABLE_CUSTOM_COLUMN_NAME_ID = `table_column_name_id`
const TABLE_CUSTOM_COLUMN_PROFILE_PREFIX = `table_custom_column_profiles_`
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColumnProfileData ¶
type ColumnProfileData struct {
// contains filtered or unexported fields
}
type CustomColumnDefition ¶
type ProfileDefinition ¶
type ProfileDefinition struct { FullProfileTables []string `json:"FullProfileTables"` CustomProfileTables []TableDefinition `json:"CustomProfileTables"` }
type ProfileRecord ¶
type ProfileStore ¶
type ProfileStore struct { UsePascalCase bool // contains filtered or unexported fields }
ProfileStore is used to store all the profile data that the profiler generates. This is a db wrapper essentially
func NewProfileStore ¶
func NewProfileStore(dbConn db.DBConn) *ProfileStore
func (*ProfileStore) NewProfile ¶
func (p *ProfileStore) NewProfile() (int, error)
Creates a new profile entry and returns the profile id
func (*ProfileStore) RecordTableProfile ¶
func (*ProfileStore) RegisterTable ¶
func (p *ProfileStore) RegisterTable(tableName string) (int, error)
func (*ProfileStore) RegisterTableColumn ¶
func (*ProfileStore) RegisterTableColumnType ¶
func (p *ProfileStore) RegisterTableColumnType(columnDataType string) (int, error)
func (*ProfileStore) RegisterTableCustomColumn ¶
func (*ProfileStore) ScaffoldProfileStore ¶
func (p *ProfileStore) ScaffoldProfileStore() error
Ensures the core profile db data stores are built
func (*ProfileStore) StoreColumnProfileData ¶
func (p *ProfileStore) StoreColumnProfileData(columnNamesID int, columnType string, profileID int, profileResults []ColumnProfileData) error
TODO - make this function not horrible
func (*ProfileStore) StoreCustomColumnProfileData ¶
func (p *ProfileStore) StoreCustomColumnProfileData(columnNamesID int, columnType *sql.ColumnType, profileID int, profileValue interface{}) error
Stores the custom column profile data, scaffolds the custom profile table for the value type if needed
type Profiler ¶
type Profiler struct {
// contains filtered or unexported fields
}
func NewProfiler ¶
NewProfiler returns a new profiler with default options for the specified databases targetDBConn is the database to be profiled profileDBConn is the database to store the profile data
func NewProfilerWithOptions ¶
func NewProfilerWithOptions(targetDBConn db.DBConn, profileDBConn db.DBConn, options ProfilerOptions) *Profiler
NewProfilerWithOptions returns a new profiler with the specified options
func (*Profiler) ProfileTablesByName ¶
Run profiles on all provided tables and store
func (*Profiler) RunProfile ¶
func (p *Profiler) RunProfile(profile ProfileDefinition) error
Run profiles on all provided tables and store
type ProfilerOptions ¶
type ProfilerOptions struct {
UsePascalCase bool
}
type TableColumnName ¶
type TableColumnType ¶
type TableCustomColumnName ¶
type TableCustomColumnName struct { ID int `db:"id" table:"table_custom_column_names" primaryKey:"true"` TableNameID int `db:"table_name_id"` TableColumnName string `db:"table_column_name"` TableColumnTypeID int `db:"table_column_type_id"` CustomColumnDefinition string `db:"table_custom_column_definition"` }
type TableDefinition ¶
type TableDefinition struct { TableName string `json:"TableName"` Columns []string `json:"Columns"` CustomColumns []CustomColumnDefition `json:"CustomColumns"` }