mysql

package
v1.3.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

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 NewDriver

func NewDriver() (*driver, error)

func NewSeeder

func NewSeeder(table string, err error) interfaces.Seeder

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) Boolean

func (bp *Blueprint) Boolean(name string) interfaces.Blueprint

func (*Blueprint) Collate added in v1.2.8

func (bp *Blueprint) Collate(collate string) interfaces.Blueprint

func (*Blueprint) Comment

func (bp *Blueprint) Comment(value string) interfaces.Blueprint

func (*Blueprint) CustomSql added in v1.3.5

func (bp *Blueprint) CustomSql(sql string) interfaces.Blueprint

func (*Blueprint) Date

func (bp *Blueprint) Date(name string) interfaces.Blueprint

func (*Blueprint) DateTime

func (bp *Blueprint) DateTime(name 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) DeletedAt added in v1.3.6

func (bp *Blueprint) DeletedAt(b bool)

func (*Blueprint) DropColumn

func (bp *Blueprint) DropColumn(column string)

func (*Blueprint) DropForeign

func (bp *Blueprint) DropForeign(name string)

func (*Blueprint) DropIndex

func (bp *Blueprint) DropIndex(name string)

func (*Blueprint) DropPrimary

func (bp *Blueprint) DropPrimary()

func (*Blueprint) DropUnique

func (bp *Blueprint) DropUnique(name string)

func (*Blueprint) Foreign

func (bp *Blueprint) Foreign(name string) interfaces.ForeignBlueprint

func (*Blueprint) GetSqls

func (bp *Blueprint) GetSqls(table string, operation operation) []string

func (*Blueprint) Id

func (bp *Blueprint) Id(name string, length int) interfaces.Blueprint

func (*Blueprint) Index

func (bp *Blueprint) Index(column ...string) interfaces.Blueprint

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) Primary

func (bp *Blueprint) Primary(name ...string) 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) Text

func (bp *Blueprint) Text(name string) interfaces.Blueprint

func (*Blueprint) Timestamps

func (bp *Blueprint) Timestamps()

func (*Blueprint) Unique

func (bp *Blueprint) Unique(column ...string) interfaces.Blueprint

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) Execute

func (d *MockDriver) Execute(sql string) (sql.Result, error)

func (*MockDriver) GetSqls

func (d *MockDriver) GetSqls() []string

func (*MockDriver) IsClose

func (d *MockDriver) IsClose() bool

func (*MockDriver) Query

func (d *MockDriver) Query(sql string) (*sql.Rows, error)

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

type Seeder_test struct {
	*model.Seeder
	// contains filtered or unexported fields
}

func (*Seeder_test) Seed

func (s *Seeder_test) Seed(data ...map[string]interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL