Documentation ¶
Index ¶
- Variables
- func InitMigrator() interfaces.Migrator
- func NewBlueprint() interfaces.Blueprint
- func NewDriver() (*driver, error)
- func NewSeeder(table string, err error) interfaces.Seeder
- func NewTestSeeder(driver mysql_interfaces.Driver, table string, err error) interfaces.Seeder
- type Blueprint
- func (bp *Blueprint) BigInt(name string, length int) interfaces.Blueprint
- func (bp *Blueprint) Boolean(name string) interfaces.Blueprint
- func (bp *Blueprint) Collate(collate string) interfaces.Blueprint
- func (bp *Blueprint) Comment(value string) interfaces.Blueprint
- func (bp *Blueprint) CustomSql(sql string) interfaces.Blueprint
- func (bp *Blueprint) Date(name string) interfaces.Blueprint
- func (bp *Blueprint) DateTime(name string) interfaces.Blueprint
- func (bp *Blueprint) Decimal(name string, length, decimals int) interfaces.Blueprint
- func (bp *Blueprint) Default(value interface{}) interfaces.Blueprint
- func (bp *Blueprint) DeletedAt(b bool)
- func (bp *Blueprint) DropColumn(column string)
- func (bp *Blueprint) DropForeign(name string)
- func (bp *Blueprint) DropIndex(name string)
- func (bp *Blueprint) DropPrimary()
- func (bp *Blueprint) DropUnique(name string)
- func (bp *Blueprint) Foreign(name string) interfaces.ForeignBlueprint
- func (bp *Blueprint) GetSqls(table string, operation operation) []string
- func (bp *Blueprint) Id(name string, length int) interfaces.Blueprint
- func (bp *Blueprint) Index(column ...string) interfaces.Blueprint
- func (bp *Blueprint) IndexName(name string) interfaces.Blueprint
- func (bp *Blueprint) Integer(name string, length int) interfaces.Blueprint
- func (bp *Blueprint) LongText(name string) interfaces.Blueprint
- func (bp *Blueprint) MediumText(name string) interfaces.Blueprint
- func (bp *Blueprint) Modify() interfaces.Blueprint
- func (bp *Blueprint) Nullable() interfaces.Blueprint
- func (bp *Blueprint) Primary(name ...string) interfaces.Blueprint
- func (bp *Blueprint) String(name string, length int) interfaces.Blueprint
- func (bp *Blueprint) TableComment(value string) interfaces.Blueprint
- func (bp *Blueprint) Text(name string) interfaces.Blueprint
- func (bp *Blueprint) Timestamps()
- func (bp *Blueprint) Unique(column ...string) interfaces.Blueprint
- func (bp *Blueprint) Unsigned() interfaces.Blueprint
- type MockDriver
- func (d *MockDriver) Close() error
- func (d *MockDriver) Debug() *sqlx.DB
- func (d *MockDriver) Execute(sql string) (sql.Result, error)
- func (d *MockDriver) GetSqls() []string
- func (d *MockDriver) IsClose() bool
- func (d *MockDriver) Query(sql string) (*sql.Rows, error)
- func (d *MockDriver) Select(dest interface{}, sql string) error
- type Schema_test
- type Seeder_test
Constants ¶
This section is empty.
Variables ¶
View Source
var Schema = newSchema()
Functions ¶
func InitMigrator ¶
func InitMigrator() interfaces.Migrator
func NewBlueprint ¶
func NewBlueprint() interfaces.Blueprint
func NewTestSeeder ¶
func NewTestSeeder(driver mysql_interfaces.Driver, table string, err error) interfaces.Seeder
Types ¶
type Blueprint ¶
type Blueprint struct {
// contains filtered or unexported fields
}
func (*Blueprint) BigInt ¶ added in v1.2.8
func (bp *Blueprint) BigInt(name string, length int) interfaces.Blueprint
func (*Blueprint) Collate ¶ added in v1.2.8
func (bp *Blueprint) Collate(collate string) interfaces.Blueprint
func (*Blueprint) CustomSql ¶ added in v1.3.5
func (bp *Blueprint) CustomSql(sql string) interfaces.Blueprint
func (*Blueprint) Decimal ¶ added in v1.2.8
func (bp *Blueprint) Decimal(name string, length, decimals int) interfaces.Blueprint
func (*Blueprint) Default ¶
func (bp *Blueprint) Default(value interface{}) interfaces.Blueprint
func (*Blueprint) DropColumn ¶
func (*Blueprint) DropForeign ¶
func (*Blueprint) DropPrimary ¶
func (bp *Blueprint) DropPrimary()
func (*Blueprint) DropUnique ¶
func (*Blueprint) Foreign ¶
func (bp *Blueprint) Foreign(name string) interfaces.ForeignBlueprint
func (*Blueprint) IndexName ¶ added in v1.3.6
func (bp *Blueprint) IndexName(name string) interfaces.Blueprint
func (*Blueprint) Integer ¶
func (bp *Blueprint) Integer(name string, length int) interfaces.Blueprint
func (*Blueprint) LongText ¶ added in v1.2.8
func (bp *Blueprint) LongText(name string) interfaces.Blueprint
func (*Blueprint) MediumText ¶ added in v1.3.5
func (bp *Blueprint) MediumText(name string) interfaces.Blueprint
func (*Blueprint) Modify ¶ added in v1.3.6
func (bp *Blueprint) Modify() interfaces.Blueprint
func (*Blueprint) Nullable ¶
func (bp *Blueprint) Nullable() interfaces.Blueprint
func (*Blueprint) String ¶
func (bp *Blueprint) String(name string, length int) interfaces.Blueprint
func (*Blueprint) TableComment ¶ added in v1.2.4
func (bp *Blueprint) TableComment(value string) interfaces.Blueprint
func (*Blueprint) Timestamps ¶
func (bp *Blueprint) Timestamps()
func (*Blueprint) Unsigned ¶ added in v1.2.8
func (bp *Blueprint) Unsigned() interfaces.Blueprint
type MockDriver ¶
type MockDriver struct {
// contains filtered or unexported fields
}
func NewMockDriver ¶
func NewMockDriver() (*MockDriver, error)
func (*MockDriver) Close ¶
func (d *MockDriver) Close() error
func (*MockDriver) Debug ¶
func (d *MockDriver) Debug() *sqlx.DB
func (*MockDriver) GetSqls ¶
func (d *MockDriver) GetSqls() []string
func (*MockDriver) IsClose ¶
func (d *MockDriver) IsClose() bool
func (*MockDriver) Select ¶
func (d *MockDriver) Select(dest interface{}, sql string) error
type Schema_test ¶
type Schema_test struct{}
func (*Schema_test) Create ¶
func (s *Schema_test) Create(driver mysql_interfaces.Driver, table string, schemaFunc func(interfaces.Blueprint)) interfaces.Seeder
func (*Schema_test) DropIfExists ¶
func (s *Schema_test) DropIfExists(driver mysql_interfaces.Driver, table string) error
func (*Schema_test) Table ¶
func (s *Schema_test) Table(driver mysql_interfaces.Driver, table string, schemaFunc func(interfaces.Blueprint)) error
type Seeder_test ¶
func (*Seeder_test) Seed ¶
func (s *Seeder_test) Seed(data ...map[string]interface{}) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.