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
CheckConstraint represents a CHECK constraint.
type Column ¶
type Column struct {
Name string
Type string // raw SQL type name, e.g. "UUID", "VARCHAR(255)", "TIMESTAMP"
FullType string // full SQL type with modifiers, e.g. "character varying(255)", "uuid"
NotNull bool
IsArray bool
ArrayDims int
Comment string
Length *int
IsUnsigned bool
Default string // raw SQL expression, e.g. "uuid_generate_v4()", "CURRENT_TIMESTAMP"
IsPrimary bool
}
Column represents a column in a database table.
type ForeignKey ¶ added in v0.5.0
type ForeignKey struct {
Name string
Columns []string
RefTable string
RefSchema string
RefColumns []string
OnDelete string
OnUpdate string
}
ForeignKey represents a FOREIGN KEY constraint.
type Index ¶ added in v0.5.0
type Index struct {
Name string
Columns []string
IsUnique bool
Where string // partial index predicate, raw SQL
IfNotExists bool
}
Index represents a database index.
type PrimaryKey ¶ added in v0.5.0
PrimaryKey represents a PRIMARY KEY constraint.
type Table ¶
type Table struct {
Name string
Schema string
Columns []*Column
Comment string
PrimaryKey *PrimaryKey
Indexes []*Index
ForeignKeys []*ForeignKey
Uniques []*UniqueConstraint
Checks []*CheckConstraint
}
Table represents a database table.
type UniqueConstraint ¶ added in v0.5.0
UniqueConstraint represents a UNIQUE constraint.
Click to show internal directories.
Click to hide internal directories.