Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckConstraint ¶ added in v0.5.0
type ForeignKey ¶ added in v0.5.0
type ForeignKey struct {
// Name is the name of the foreign key in postgres
Name string `json:"name"`
// The columns that the foreign key is defined on
Columns []string `json:"columns"`
// The table that the foreign key references
ReferencedTable string `json:"referencedTable"`
// The columns in the referenced table that the foreign key references
ReferencedColumns []string `json:"referencedColumns"`
}
type Schema ¶
type Schema struct {
// Name is the name of the schema
Name string `json:"name"`
// Tables is a map of virtual table name -> table mapping
Tables map[string]Table `json:"tables"`
}
func (*Schema) RemoveTable ¶
func (*Schema) RenameTable ¶
type Table ¶
type Table struct {
// OID for the table
OID string `json:"oid"`
// Name is the actual name in postgres
Name string `json:"name"`
// Optional comment for the table
Comment string `json:"comment"`
// Columns is a map of virtual column name -> column mapping
Columns map[string]Column `json:"columns"`
// Indexes is a map of the indexes defined on the table
Indexes map[string]Index `json:"indexes"`
// The columns that make up the primary key
PrimaryKey []string `json:"primaryKey"`
// ForeignKeys is a map of all foreign keys defined on the table
ForeignKeys map[string]ForeignKey `json:"foreignKeys"`
// CheckConstraints is a map of all check constraints defined on the table
CheckConstraints map[string]CheckConstraint `json:"checkConstraints"`
// UniqueConstraints is a map of all unique constraints defined on the table
UniqueConstraints map[string]UniqueConstraint `json:"uniqueConstraints"`
}
func (*Table) ConstraintExists ¶ added in v0.5.0
func (*Table) GetPrimaryKey ¶ added in v0.2.0
func (*Table) RemoveColumn ¶
func (*Table) RenameColumn ¶
type UniqueConstraint ¶ added in v0.5.0
Click to show internal directories.
Click to hide internal directories.