Documentation
¶
Overview ¶
Package schemalock owns the deterministic, backend-independent database schema artifact consumed by compiler integrations and command-line tools.
Index ¶
Constants ¶
View Source
const FormatVersion = 1
Variables ¶
This section is empty.
Functions ¶
func ConstraintKey ¶
func ForeignKeyKey ¶
Types ¶
type Column ¶
type Column struct {
// DatabaseType is used while parsing SQL but is intentionally omitted from
// the lock. The lock records the portable type contract, while sqldef owns
// database-specific details such as varchar lengths and storage aliases.
DatabaseType string `json:"-"`
Type string `json:"type"`
Nullable bool `json:"nullable"`
PrimaryKey bool `json:"primaryKey,omitempty"`
HasDefault bool `json:"hasDefault,omitempty"`
Generated bool `json:"generated,omitempty"`
}
type ForeignKey ¶
type Lock ¶
type Lock struct {
FormatVersion int `json:"formatVersion"`
Adapter string `json:"adapter"`
Tables map[string]Table `json:"tables"`
}
func (*Lock) ValidateAdapter ¶
type Table ¶
type Table struct {
Columns map[string]Column `json:"columns"`
ForeignKeys map[string]ForeignKey `json:"foreignKeys,omitempty"`
UniqueConstraints map[string]UniqueConstraint `json:"uniqueConstraints,omitempty"`
}
type UniqueConstraint ¶
Click to show internal directories.
Click to hide internal directories.