Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ColumnFields = []string{"COLUMN_NAME", "COLUMN_TYPE", "COLUMN_KEY", "COLUMN_COMMENT", "DATA_TYPE"}
ColumnFields lists the database columns queried from Column (mysql, omits SIZE).
View Source
var TableFields = []string{"TABLE_NAME", "TABLE_COMMENT"}
TableFields lists the database columns queried from Table.
Functions ¶
Types ¶
type Column ¶
type Column struct {
Name string `db:"COLUMN_NAME" json:"name" yaml:"name"`
Type string `db:"COLUMN_TYPE" json:"type,omitempty" yaml:"type,omitempty"`
Key string `db:"COLUMN_KEY" json:"key,omitempty" yaml:"key,omitempty"`
Comment string `db:"COLUMN_COMMENT" json:"comment,omitempty" yaml:"comment,omitempty"`
DataType string `db:"DATA_TYPE" json:"datatype,omitempty" yaml:"datatype,omitempty"`
Size int `db:"SIZE" json:"size,omitempty" yaml:"size,omitempty"`
Values []string `json:"values,omitempty" yaml:"values,omitempty"`
}
Column represents a database column with its metadata. SIZE is filled from sql query on postgres.
type Index ¶ added in v0.0.2
type Index struct {
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Columns []string `json:"columns" yaml:"columns"`
Primary bool `json:"primary,omitempty" yaml:"primary,omitempty"`
Unique bool `json:"unique,omitempty" yaml:"unique,omitempty"`
}
Index represents a database index on a table.
type Table ¶
type Table struct {
Name string `db:"TABLE_NAME" json:"name" yaml:"name"`
Comment string `db:"TABLE_COMMENT" json:"comment,omitempty" yaml:"comment,omitempty"`
Columns []*Column `json:"columns" yaml:"columns"`
Indexes []*Index `json:"indexes,omitempty" yaml:"indexes,omitempty"`
}
Table represents a database table with its columns and indexes.
Click to show internal directories.
Click to hide internal directories.