info

package
v1.2.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColumnInfo

type ColumnInfo struct {
	ColumnDefault  sql.NullString `db:"COLUMN_DEFAULT"`
	IsNullable     string         `db:"IS_NULLABLE"`
	ColumnType     string         `db:"COLUMN_TYPE"`
	ColumnKey      string         `db:"COLUMN_KEY"`
	ColumnKeysInfo []*IndexInfo
}

func GetColumnInfo

func GetColumnInfo(table, column string, db *sqlx.DB) *ColumnInfo

func (*ColumnInfo) GetUniqueKey

func (ci *ColumnInfo) GetUniqueKey() *IndexInfo

func (*ColumnInfo) HasDefault

func (ci *ColumnInfo) HasDefault() (bool, string)

func (*ColumnInfo) IsPrimary

func (ci *ColumnInfo) IsPrimary() bool

func (*ColumnInfo) IsUnique

func (ci *ColumnInfo) IsUnique() bool

func (*ColumnInfo) Nullable

func (ci *ColumnInfo) Nullable() bool

type IndexInfo

type IndexInfo struct {
	NonUnique int    `db:"Non_unique"`
	KeyName   string `db:"Key_name"`
}

func GetIndexInfoByColumn

func GetIndexInfoByColumn(table, column string, db *sqlx.DB) []*IndexInfo

func GetIndexInfoByTable

func GetIndexInfoByTable(table string, db *sqlx.DB) []*IndexInfo

func (*IndexInfo) IsForeign

func (ii *IndexInfo) IsForeign() bool

func (*IndexInfo) IsPrimary

func (ii *IndexInfo) IsPrimary() bool

func (*IndexInfo) IsUnique

func (ii *IndexInfo) IsUnique() bool

type KeyInfo

type KeyInfo struct {
	ConstraintName       string `db:"CONSTRAINT_NAME"`
	TableName            string `db:"TABLE_NAME"`
	ColumnName           string `db:"COLUMN_NAME"`
	ReferencedTableName  string `db:"REFERENCED_TABLE_NAME"`
	ReferencedColumnName string `db:"REFERENCED_COLUMN_NAME"`
}

func GetKeyInfo

func GetKeyInfo(name string, db *sqlx.DB) *KeyInfo

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL