Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMissingColumn = errors.New("")
Functions ¶
This section is empty.
Types ¶
type Column ¶
type Column struct {
Name string // the original name of the column in the DB
Type string // the original type of the column in the DB
Nullable bool // true if the column is not NON-NULL
HasDefault bool // true if the column has a default
IsPrimaryKey bool // true if the column is a primary key
Ordinal int16 // the column's ordinal position
Comment string // the comment attached to the column
Table *Table `json:"-"`
ForeignKey *ForeignKey // foreign key database definition
}
Column contains data about a column in a table.
type Columns ¶
type Columns []*Column
func (Columns) Filter ¶
func (cc Columns) Filter(filters stringlist.Strings) Columns
Filter applies the regexes specified and filter out all matching schema objects.
func (Columns) Names ¶
func (cc Columns) Names() stringlist.Strings
func (Columns) Paths ¶
func (cc Columns) Paths() stringlist.Strings
func (Columns) Types ¶
func (cc Columns) Types() stringlist.Strings
type DB ¶
type Enum ¶
type Enum struct {
ID int64
Name string // the original name of the enum in the DB
Values stringlist.Strings // the list of possible values for this enum
Comment string
Schema *Schema `json:"-"`
}
Enum represents a type that has a set of allowed values.
type ForeignKey ¶
type ForeignKey struct {
Name string // the original name of the foreign key constraint in the db
Comment string // the comment attached to the ForeignKey
Columns Columns `json:"-"` // Schema and Table can be retrieved from the source Column
ForeignColumns Columns `json:"-"` //
}
ForeignKey contains the definition of a foreign key.
func (ForeignKey) ForeignTable ¶
func (f ForeignKey) ForeignTable() *Table
func (ForeignKey) Path ¶
func (f ForeignKey) Path() string
func (ForeignKey) Table ¶
func (f ForeignKey) Table() *Table
type ForeignKeys ¶
type ForeignKeys []*ForeignKey
func (ForeignKeys) Filter ¶
func (ff ForeignKeys) Filter(filters stringlist.Strings) ForeignKeys
Filter applies the regexes specified and filter out all matching schema objects.
type Index ¶
type Index struct {
Name string // name of the index in the database
IsUnique bool // true if the index is unique
IsPrimary bool // true if the index is for the PK
Comment string // the comment attached to the index
Columns Columns `json:"-"` // list of columns in this index
}
Index contains the definition of an index.
type Table ¶
type Table struct {
ID int64
Name string // the original name of the table in the DB
Type string // the table type (e.g. VIEW or BASE TABLE)
Comment string // the comment attached to the table
Schema *Schema // reference to schema `json:"-"`
Columns Columns // ordered list of columns in this table
ReadOnly bool // table allows insert/update/delete
Indexes Indexes // list of indexes in this table
ForeignKeys ForeignKeys // list of Foreign Keys from the table
References ForeignKeys // list of Foreign Keys to the table
PrimaryKeys Columns // list of columns that are flagged as Primary Keys
}
Table contains the definition of a table.
func (Table) GetColumnByName ¶
func (Table) HasPrimaryKey ¶
Click to show internal directories.
Click to hide internal directories.