Documentation
¶
Overview ¶
Package schema contains types to describe a database schema.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Column ¶
type Column struct {
// Name specifies the column name.
Name string
// GoType specifies the type in Go and should be set to a specific Go type.
GoType interface{}
// SqlType specifies the type in SQL and can be set to a string describing the SQL type.
SqlType string
}
Column describes a database column.
type Index ¶
type Index struct {
// Name specifies the index name.
Name string
// Columns contains the columns in the index.
Columns []Column
// IsPrimary is true if the index represents a primary key; if IsPrimary is true then
// IsUnique is also true.
IsPrimary bool
// IsUnique is true if the index represents a unique key.
IsUnique bool
}
Index describes a database index.
type Table ¶
type Table struct {
// Name specifies the database table name.
Name string
// Columns represents the table columns.
Columns []Column
// PrimaryKey is the index describing the table's primary key if it has one.
// A primary key - by definition - is a unique index; however it is not also
// stored in the Unique field.
PrimaryKey Index
// Unique is a slice of unique indexes on the table.
Unique []Index
}
Table describes a database table.
Click to show internal directories.
Click to hide internal directories.