Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Column ¶
type Column struct {
Name string `json:"name"`
Type string `json:"type"`
Nullable bool `json:"nullable"`
Default sql.NullString `json:"default"`
Comment string `json:"comment"`
ParentRelations []*Relation `json:"-"`
ChildRelations []*Relation `json:"-"`
}
Column is the struct for table column
func (Column) MarshalJSON ¶ added in v1.6.0
MarshalJSON return custom JSON byte
func (*Column) UnmarshalJSON ¶ added in v1.6.0
UnmarshalJSON ...
type Constraint ¶ added in v0.2.2
type Constraint struct {
Name string `json:"name"`
Type string `json:"type"`
Def string `json:"def"`
}
Constraint is the struct for database constraint
type Relation ¶
type Relation struct {
Table *Table `json:"table"`
Columns []*Column `json:"columns"`
ParentTable *Table `json:"parent_table"`
ParentColumns []*Column `json:"parent_columns"`
Def string `json:"def"`
IsAdditional bool `json:"is_additional"`
}
Relation is the struct for table relation
type Schema ¶
type Schema struct {
Name string `json:"name"`
Tables []*Table `json:"tables"`
Relations []*Relation `json:"relations"`
Driver *Driver `json:"driver"`
}
Schema is the struct for database schema
func (*Schema) FindTableByName ¶
FindTableByName find table by table name
type Table ¶
type Table struct {
Name string `json:"name"`
Type string `json:"type"`
Comment string `json:"comment"`
Columns []*Column `json:"columns"`
Indexes []*Index `json:"indexes"`
Constraints []*Constraint `json:"constraints"`
Triggers []*Trigger `json:"triggers"`
Def string `json:"def"`
}
Table is the struct for database table
Click to show internal directories.
Click to hide internal directories.