Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColumnData ¶
ColumnData describes the columns of table
type DbColumn ¶
type DbColumn struct { Name string `db:"COLUMN_NAME"` DataType string `db:"DATA_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 InforPgmationSchemaModel ¶
type InforPgmationSchemaModel struct {
// contains filtered or unexported fields
}
func NewPGInformationSchemaModel ¶
func NewPGInformationSchemaModel(conn *gorm.DB) *InforPgmationSchemaModel
NewInformationSchemaModel creates an instance for InformationSchemaModel
func (*InforPgmationSchemaModel) FindColumns ¶
func (m *InforPgmationSchemaModel) FindColumns(db, table string) (*PgColumnData, error)
FindColumns return columns in specified database and table
func (*InforPgmationSchemaModel) FindIndex ¶
func (m *InforPgmationSchemaModel) FindIndex(db, table, column string) ([]*DbIndex, error)
FindIndex finds index with given db, table and column.
func (*InforPgmationSchemaModel) SGetAllTables ¶
func (m *InforPgmationSchemaModel) SGetAllTables(database string) ([]*PgClass, error)
GetAllTables selects all tables from TABLE_SCHEMA
type InformationSchemaModel ¶
type InformationSchemaModel struct {
// contains filtered or unexported fields
}
InformationSchemaModel defines information schema model
func NewInformationSchemaModel ¶
func NewInformationSchemaModel(conn sqlx.SqlConn) *InformationSchemaModel
NewInformationSchemaModel creates an instance for InformationSchemaModel
func (*InformationSchemaModel) GetAllTables ¶
func (m *InformationSchemaModel) GetAllTables(database string) ([]*DBTable, error)
GetAllTables selects all tables from TABLE_SCHEMA
type PgColumn ¶
type PgColumn struct { *PgDbColumn Index *DbIndex }
type PgColumnData ¶
func (*PgColumnData) Convert ¶
func (c *PgColumnData) Convert() (*PgTable, error)
Convert converts column data into PgTable
type PgDbColumn ¶
type PgDbColumn struct { Name string `gorm:"column:column_name"` DataType string `gorm:"column:data_type"` Extra string `db:"EXTRA"` Comment string `db:"COLUMN_COMMENT"` ColumnDefault interface{} `gorm:"column:column_default"` IsNullAble string `gorm:"column:is_nullable"` OrdinalPosition int `gorm:"column:ordinal_position"` }
Click to show internal directories.
Click to hide internal directories.