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) Boolean(name 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 int, precision int) interfaces.Blueprint
- func (bp *Blueprint) Default(value interface{}) interfaces.Blueprint
- func (bp *Blueprint) Double(name string, length int, precision int) interfaces.Blueprint
- 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) Float(name string, length int, precision int) interfaces.Blueprint
- 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)
- func (bp *Blueprint) Index(column ...string) interfaces.Blueprint
- func (bp *Blueprint) Integer(name string, length int) 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) Text(name string) interfaces.Blueprint
- func (bp *Blueprint) Timestamps()
- func (bp *Blueprint) Unique(column ...string) 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 ¶ added in v1.2.0
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) Default ¶
func (bp *Blueprint) Default(value interface{}) interfaces.Blueprint
func (*Blueprint) DropColumn ¶
func (*Blueprint) DropForeign ¶ added in v1.1.0
func (*Blueprint) DropPrimary ¶ added in v1.1.0
func (bp *Blueprint) DropPrimary()
func (*Blueprint) DropUnique ¶ added in v1.1.0
func (*Blueprint) Foreign ¶ added in v1.1.0
func (bp *Blueprint) Foreign(name string) interfaces.ForeignBlueprint
func (*Blueprint) Index ¶ added in v1.1.0
func (bp *Blueprint) Index(column ...string) interfaces.Blueprint
func (*Blueprint) Integer ¶
func (bp *Blueprint) Integer(name string, length int) interfaces.Blueprint
func (*Blueprint) Nullable ¶
func (bp *Blueprint) Nullable() interfaces.Blueprint
func (*Blueprint) Primary ¶ added in v1.1.0
func (bp *Blueprint) Primary(name ...string) interfaces.Blueprint
func (*Blueprint) String ¶
func (bp *Blueprint) String(name string, length int) interfaces.Blueprint
func (*Blueprint) Timestamps ¶
func (bp *Blueprint) Timestamps()
type MockDriver ¶ added in v1.0.3
type MockDriver struct {
// contains filtered or unexported fields
}
func NewMockDriver ¶ added in v1.0.3
func NewMockDriver() (*MockDriver, error)
func (*MockDriver) Close ¶ added in v1.0.3
func (d *MockDriver) Close() error
func (*MockDriver) Debug ¶ added in v1.0.3
func (d *MockDriver) Debug() *sqlx.DB
func (*MockDriver) Execute ¶ added in v1.0.3
func (d *MockDriver) Execute(sql string) (sql.Result, error)
func (*MockDriver) GetSqls ¶ added in v1.0.3
func (d *MockDriver) GetSqls() []string
func (*MockDriver) IsClose ¶ added in v1.0.3
func (d *MockDriver) IsClose() bool
func (*MockDriver) Query ¶ added in v1.0.3
func (d *MockDriver) Query(sql string) (*sql.Rows, error)
func (*MockDriver) Select ¶ added in v1.0.3
func (d *MockDriver) Select(dest interface{}, sql string) error
type Schema_test ¶ added in v1.0.3
type Schema_test struct{}
func (*Schema_test) Create ¶ added in v1.0.3
func (s *Schema_test) Create(driver mysql_interfaces.Driver, table string, schemaFunc func(interfaces.Blueprint)) interfaces.Seeder
func (*Schema_test) DropIfExists ¶ added in v1.0.3
func (s *Schema_test) DropIfExists(driver mysql_interfaces.Driver, table string) error
func (*Schema_test) Table ¶ added in v1.0.3
func (s *Schema_test) Table(driver mysql_interfaces.Driver, table string, schemaFunc func(interfaces.Blueprint)) error
type Seeder_test ¶ added in v1.2.0
func (*Seeder_test) Seed ¶ added in v1.2.0
func (s *Seeder_test) Seed(data ...map[string]interface{}) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.