Documentation
¶
Index ¶
- Variables
- func AFile(f *os.File, t Translator) (string, error)
- func AString(s string, t Translator) (string, error)
- type BubbleType
- type Bubbler
- type Column
- type ForeignKey
- type ForeignKeyRef
- type Index
- type Options
- type Table
- func (t *Table) Column(name string, colType string, options Options)
- func (t *Table) ColumnNames() []string
- func (t *Table) DisableTimestamps()
- func (t *Table) ForeignKey(column string, refs interface{}, options Options) error
- func (t *Table) HasColumns(args ...string) bool
- func (t *Table) Timestamp(name string)
- func (t *Table) Timestamps()
- type Translator
Constants ¶
This section is empty.
Variables ¶
View Source
var CREATED_COL = Column{Name: "created_at", ColType: "timestamp", Options: Options{}}
View Source
var INT_ID_COL = Column{ Name: "id", Primary: true, ColType: "integer", Options: Options{}, }
View Source
var UPDATED_COL = Column{Name: "updated_at", ColType: "timestamp", Options: Options{}}
View Source
var UUID_ID_COL = Column{ Name: "id", Primary: true, ColType: "uuid", Options: Options{}, }
Functions ¶
Types ¶
type BubbleType ¶
type BubbleType int
type Bubbler ¶
type Bubbler struct {
Translator
// contains filtered or unexported fields
}
func NewBubbler ¶
func NewBubbler(t Translator) *Bubbler
type ForeignKey ¶
type ForeignKey struct {
Name string
Column string
References ForeignKeyRef
Options Options
}
type ForeignKeyRef ¶
type Table ¶
type Table struct {
Name string `db:"name"`
Columns []Column
Indexes []Index
ForeignKeys []ForeignKey
Options map[string]interface{}
}
func (*Table) ColumnNames ¶
func (*Table) DisableTimestamps ¶
func (t *Table) DisableTimestamps()
func (*Table) ForeignKey ¶
func (*Table) HasColumns ¶
func (*Table) Timestamps ¶
func (t *Table) Timestamps()
type Translator ¶
type Translator interface {
CreateTable(Table) (string, error)
DropTable(Table) (string, error)
RenameTable([]Table) (string, error)
AddColumn(Table) (string, error)
ChangeColumn(Table) (string, error)
DropColumn(Table) (string, error)
RenameColumn(Table) (string, error)
AddIndex(Table) (string, error)
DropIndex(Table) (string, error)
RenameIndex(Table) (string, error)
AddForeignKey(Table) (string, error)
DropForeignKey(Table) (string, error)
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.