Documentation ¶
Index ¶
- Constants
- Variables
- type Check
- type Column
- type Definition
- type Field
- type File
- type ForeignKey
- type Index
- type Migrator
- func (m *Migrator) AddCheck(t *Table, checks []Check)
- func (m *Migrator) AddColumn(t *Table, columns map[string]Column)
- func (m *Migrator) AddForeignKey(keys map[string]ForeignKey)
- func (m *Migrator) AddIndex(t *Table, indexes []Index)
- func (m *Migrator) GetTabel(name string) *Table
- func (m *Migrator) Schema(path string) error
- func (m *Migrator) Sql(path string) error
- func (m *Migrator) Tabel(row *Row) *Table
- type Relation
- type Row
- type Structur
- type Table
- func (t *Table) AddCheck(check Check)
- func (t *Table) AddColumn(column Column, sqlString string)
- func (t *Table) AddIndex(index Index)
- func (t *Table) AddRelation(relation Relation)
- func (t *Table) DropCheck(name string)
- func (t *Table) DropColumn(name string)
- func (t *Table) DropIndex(indexName string)
- func (t *Table) DropRelation(name string)
- type Version
Constants ¶
View Source
const (
SCHEMASKELLETON = `` /* 4697-byte string literal not displayed */
)
Variables ¶
View Source
var (
TOUPPER = map[string]string{
"_a": "A",
"_b": "B",
"_c": "C",
"_d": "D",
"_e": "E",
"_f": "F",
"_g": "G",
"_h": "H",
"_i": "I",
"_j": "J",
"_k": "K",
"_l": "L",
"_m": "M",
"_n": "N",
"_o": "O",
"_p": "P",
"_q": "Q",
"_r": "R",
"_s": "S",
"_t": "T",
"_u": "U",
"_v": "V",
"_w": "W",
"_x": "X",
"_y": "Y",
"_z": "Z",
"_0": "0",
"_1": "1",
"_2": "2",
"_3": "3",
"_4": "4",
"_5": "5",
"_6": "6",
"_7": "7",
"_8": "8",
"_9": "9",
}
)
Functions ¶
This section is empty.
Types ¶
type Column ¶
type Column struct { Name string `json:"name"` Type string `json:"type"` Unsigned bool `json:"unsigned"` Autoincrement bool `json:"autoincrement"` Primary bool `json:"primary"` Nullable bool `json:"nullable"` Length int `json:"length,omitempty"` Default string `json:"default,omitempty"` MappedType string `json:"mappedType"` GormTag string `json:"-"` }
type Definition ¶
type Definition struct { Namespaces []string `json:"namespaces"` Name string `json:"name"` Tables []Row `json:"tables"` }
func NewDefinition ¶
func NewDefinition(filename string) (*Definition, error)
type File ¶
type File struct { Data []byte Dir string Version string FileName string Ext string Print bool CreatedAt time.Time // contains filtered or unexported fields }
func (*File) CreateFile ¶
func (*File) TimeVersion ¶
type ForeignKey ¶
type ForeignKey struct { ConstraintName string `json:"constraintName"` ColumnNames []string `json:"columnNames"` LocalTableName string `json:"localTableName"` ReferencedColumnNames []string `json:"referencedColumnNames"` ReferencedTableName string `json:"referencedTableName"` DeleteRule string `json:"deleteRule"` UpdateRule string `json:"updateRule"` }
type Migrator ¶
func NewMigrator ¶
func NewMigrator() *Migrator
func (*Migrator) AddForeignKey ¶
func (m *Migrator) AddForeignKey(keys map[string]ForeignKey)
type Row ¶
type Table ¶
type Table struct { Name string Fields []*Field SqlFields int ForeignKeys map[string]ForeignKey Sql string CreatedAt time.Time // contains filtered or unexported fields }
func (*Table) AddRelation ¶
func (*Table) DropColumn ¶
func (*Table) DropRelation ¶
Click to show internal directories.
Click to hide internal directories.