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: 4 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:"data_type"`
	CharacterLength int            `db:"character_maximum_length"`
	ColumnKeysInfo  []*IndexInfo
}

func GetColumnInfo

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

func (*ColumnInfo) GetType

func (ci *ColumnInfo) GetType() string

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 {
	KeyName string `db:"constraint_name"`
	KeyType string `db:"constraint_type"`
}

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"`
	BaseTable      string `db:"base_table"`
	BaseColumn     string `db:"base_column"`
	TargetTable    string `db:"target_table"`
	TargetColumn   string `db:"target_column"`
	OnUpdate       string `db:"update_rule"`
	OnDelete       string `db:"delete_rule"`
}

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