Versions in this module Expand all Collapse all v0 v0.1.1 Oct 11, 2026 v0.1.0 Oct 11, 2026 Changes in this version + var ErrCycle = errors.New("schema: foreign keys form a cycle, so no creation order exists") + var ErrDuplicateTable = errors.New("schema: two packages declare the same table") + var ErrMissingTable = errors.New("schema: foreign key references a table no package contributed") + var ErrTypeMismatch = errors.New("schema: Go type does not match the declared column type") + var TypeValues = []Type + func Col[T any](t Table, name string) (expr.Expr[T], error) + func EngineNames() []string + func EngineType(engine string, t Type) (string, bool) + func GoTypes(t Type) []string + func MustCol[T any](t Table, name string) expr.Expr[T] + type Action string + const Cascade + const NoAction + const Restrict + const SetDefault + const SetNull + type Column struct + Comment string + Default string + Name string + Nullable bool + Raw string + Type Type + type ForeignKey struct + Columns []string + Name string + OnDelete Action + OnUpdate Action + RefColumns []string + RefTable string + type Index struct + Columns []string + Name string + Unique bool + type Set struct + func New(owner string, tables ...Table) (*Set, error) + func (s *Set) Add(owner string, tables ...Table) error + func (s Set) Owner(qualifiedName string) (string, bool) + func (s Set) Sorted() ([]Table, error) + func (s Set) Tables() []Table + func (s Set) Validate() error + type Table struct + Alias string + Columns []Column + Comment string + ForeignKeys []ForeignKey + Indexes []Index + Name string + PrimaryKey []string + Schema string + func (t Table) Column(name string) (Column, bool) + func (t Table) ColumnNames() []string + func (t Table) Ref() expr.Table + func (t Table) Validate() error + type Type string + const TypeBigInt + const TypeBool + const TypeBytes + const TypeDate + const TypeDecimal + const TypeFloat + const TypeInt + const TypeJSON + const TypeText + const TypeTimestamp + const TypeUUID