console

package
v0.0.0-...-9be93d0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IndexPrimary = "PRI"
	IndexUnique  = "UNI"
	IndexNormal  = "MUL"
)

Variables

View Source
var ChangePatterns = []string{
	`_(to|from|in)_(\w+)_table$`,
	`_(to|from|in)_(\w+)$`,
}
View Source
var CreatePatterns = []string{
	`^create_(\w+)_table$`,
	`^create_(\w+)$`,
}
View Source
var DefaultDb string

Functions

This section is empty.

Types

type Column

type Column struct {
	ColumnName    string
	ColumnType    string
	IsNullable    string
	ColumnKey     string
	ColumnComment string
	Extra         string
}

func (Column) String

func (c Column) String() string

type MigrateCommand

type MigrateCommand struct {
	// contains filtered or unexported fields
}

func NewMigrateCommand

func NewMigrateCommand(config config.Config) *MigrateCommand

func (*MigrateCommand) Description

func (receiver *MigrateCommand) Description() string

Description The console command description.

func (*MigrateCommand) Extend

func (receiver *MigrateCommand) Extend() command.Extend

Extend The console command extend.

func (*MigrateCommand) Handle

func (receiver *MigrateCommand) Handle(ctx console.Context) error

Handle Execute the console command.

func (*MigrateCommand) Signature

func (receiver *MigrateCommand) Signature() string

Signature The name and signature of the console command.

type MigrateCreator

type MigrateCreator struct {
	// contains filtered or unexported fields
}

func NewMigrateCreator

func NewMigrateCreator(config config.Config) *MigrateCreator

func (MigrateCreator) Create

func (receiver MigrateCreator) Create(name string, table string, create bool) error

Create a new migration

type MigrateFreshCommand

type MigrateFreshCommand struct {
	// contains filtered or unexported fields
}

func NewMigrateFreshCommand

func NewMigrateFreshCommand(config config.Config, artisan console.Artisan) *MigrateFreshCommand

func (*MigrateFreshCommand) Description

func (receiver *MigrateFreshCommand) Description() string

Description The console command description.

func (*MigrateFreshCommand) Extend

func (receiver *MigrateFreshCommand) Extend() command.Extend

Extend The console command extend.

func (*MigrateFreshCommand) Handle

func (receiver *MigrateFreshCommand) Handle(ctx console.Context) error

Handle Execute the console command.

func (*MigrateFreshCommand) Signature

func (receiver *MigrateFreshCommand) Signature() string

Signature The name and signature of the console command.

type MigrateMakeCommand

type MigrateMakeCommand struct {
	// contains filtered or unexported fields
}

func NewMigrateMakeCommand

func NewMigrateMakeCommand(config config.Config) *MigrateMakeCommand

func (*MigrateMakeCommand) Description

func (receiver *MigrateMakeCommand) Description() string

Description The console command description.

func (*MigrateMakeCommand) Extend

func (receiver *MigrateMakeCommand) Extend() command.Extend

Extend The console command extend.

func (*MigrateMakeCommand) Handle

func (receiver *MigrateMakeCommand) Handle(ctx console.Context) error

Handle Execute the console command.

func (*MigrateMakeCommand) Signature

func (receiver *MigrateMakeCommand) Signature() string

Signature The name and signature of the console command.

type MigrateRefreshCommand

type MigrateRefreshCommand struct {
	// contains filtered or unexported fields
}

func NewMigrateRefreshCommand

func NewMigrateRefreshCommand(config config.Config, artisan console.Artisan) *MigrateRefreshCommand

func (*MigrateRefreshCommand) Description

func (receiver *MigrateRefreshCommand) Description() string

Description The console command description.

func (*MigrateRefreshCommand) Extend

func (receiver *MigrateRefreshCommand) Extend() command.Extend

Extend The console command extend.

func (*MigrateRefreshCommand) Handle

func (receiver *MigrateRefreshCommand) Handle(ctx console.Context) error

Handle Execute the console command.

func (*MigrateRefreshCommand) Signature

func (receiver *MigrateRefreshCommand) Signature() string

Signature The name and signature of the console command.

type MigrateResetCommand

type MigrateResetCommand struct {
	// contains filtered or unexported fields
}

func NewMigrateResetCommand

func NewMigrateResetCommand(config config.Config) *MigrateResetCommand

func (*MigrateResetCommand) Description

func (receiver *MigrateResetCommand) Description() string

Description The console command description.

func (*MigrateResetCommand) Extend

func (receiver *MigrateResetCommand) Extend() command.Extend

Extend The console command extend.

func (*MigrateResetCommand) Handle

func (receiver *MigrateResetCommand) Handle(ctx console.Context) error

Handle Execute the console command.

func (*MigrateResetCommand) Signature

func (receiver *MigrateResetCommand) Signature() string

Signature The name and signature of the console command.

type MigrateRollbackCommand

type MigrateRollbackCommand struct {
	// contains filtered or unexported fields
}

func NewMigrateRollbackCommand

func NewMigrateRollbackCommand(config config.Config) *MigrateRollbackCommand

func (*MigrateRollbackCommand) Description

func (receiver *MigrateRollbackCommand) Description() string

Description The console command description.

func (*MigrateRollbackCommand) Extend

func (receiver *MigrateRollbackCommand) Extend() command.Extend

Extend The console command extend.

func (*MigrateRollbackCommand) Handle

func (receiver *MigrateRollbackCommand) Handle(ctx console.Context) error

Handle Execute the console command.

func (*MigrateRollbackCommand) Signature

func (receiver *MigrateRollbackCommand) Signature() string

Signature The name and signature of the console command.

type MigrateStatusCommand

type MigrateStatusCommand struct {
	// contains filtered or unexported fields
}

func NewMigrateStatusCommand

func NewMigrateStatusCommand(config config.Config) *MigrateStatusCommand

func (*MigrateStatusCommand) Description

func (receiver *MigrateStatusCommand) Description() string

Description The console command description.

func (*MigrateStatusCommand) Extend

func (receiver *MigrateStatusCommand) Extend() command.Extend

Extend The console command extend.

func (*MigrateStatusCommand) Handle

func (receiver *MigrateStatusCommand) Handle(ctx console.Context) error

Handle Execute the console command.

func (*MigrateStatusCommand) Signature

func (receiver *MigrateStatusCommand) Signature() string

Signature The name and signature of the console command.

type ModelMakeCommand

type ModelMakeCommand struct {
	// contains filtered or unexported fields
}

func NewModelMakeCommand

func NewModelMakeCommand(config config.Config) *ModelMakeCommand

func (*ModelMakeCommand) Description

func (receiver *ModelMakeCommand) Description() string

Description The console command description.

func (*ModelMakeCommand) Extend

func (receiver *ModelMakeCommand) Extend() command.Extend

Extend The console command extend.

func (*ModelMakeCommand) Handle

func (receiver *ModelMakeCommand) Handle(ctx console.Context) error

Handle Execute the console command.

func (*ModelMakeCommand) Signature

func (receiver *ModelMakeCommand) Signature() string

Signature The name and signature of the console command.

type MysqlStubs

type MysqlStubs struct {
}

func (MysqlStubs) CreateDown

func (receiver MysqlStubs) CreateDown() string

CreateDown Create down migration content.

func (MysqlStubs) CreateUp

func (receiver MysqlStubs) CreateUp() string

CreateUp Create up migration content.

func (MysqlStubs) UpdateDown

func (receiver MysqlStubs) UpdateDown() string

UpdateDown Update down migration content.

func (MysqlStubs) UpdateUp

func (receiver MysqlStubs) UpdateUp() string

UpdateUp Update up migration content.

type ObserverMakeCommand

type ObserverMakeCommand struct {
	// contains filtered or unexported fields
}

func NewObserverMakeCommand

func NewObserverMakeCommand(config config.Config) *ObserverMakeCommand

func (*ObserverMakeCommand) Description

func (receiver *ObserverMakeCommand) Description() string

Description The console command description.

func (*ObserverMakeCommand) Extend

func (receiver *ObserverMakeCommand) Extend() command.Extend

Extend The console command extend.

func (*ObserverMakeCommand) Handle

func (receiver *ObserverMakeCommand) Handle(ctx console.Context) error

Handle Execute the console command.

func (*ObserverMakeCommand) Signature

func (receiver *ObserverMakeCommand) Signature() string

Signature The name and signature of the console command.

type PostgresqlStubs

type PostgresqlStubs struct {
}

func (PostgresqlStubs) CreateDown

func (receiver PostgresqlStubs) CreateDown() string

CreateDown Create down migration content.

func (PostgresqlStubs) CreateUp

func (receiver PostgresqlStubs) CreateUp() string

CreateUp Create up migration content.

func (PostgresqlStubs) UpdateDown

func (receiver PostgresqlStubs) UpdateDown() string

UpdateDown Update down migration content.

func (PostgresqlStubs) UpdateUp

func (receiver PostgresqlStubs) UpdateUp() string

UpdateUp Update up migration content.

type SeedCommand

type SeedCommand struct {
	// contains filtered or unexported fields
}

func NewSeedCommand

func NewSeedCommand(config config.Config, seeder seeder.Facade) *SeedCommand

func (*SeedCommand) ConfirmToProceed

func (receiver *SeedCommand) ConfirmToProceed(force bool) error

ConfirmToProceed determines if the command should proceed based on user confirmation.

func (*SeedCommand) Description

func (receiver *SeedCommand) Description() string

Description The console command description.

func (*SeedCommand) Extend

func (receiver *SeedCommand) Extend() command.Extend

Extend The console command extend.

func (*SeedCommand) GetSeeders

func (receiver *SeedCommand) GetSeeders(names []string) ([]seeder.Seeder, error)

GetSeeders returns a seeder instances

func (*SeedCommand) Handle

func (receiver *SeedCommand) Handle(ctx console.Context) error

Handle executes the console command.

func (*SeedCommand) Signature

func (receiver *SeedCommand) Signature() string

Signature The name and signature of the console command.

type SeederMakeCommand

type SeederMakeCommand struct {
	// contains filtered or unexported fields
}

func NewSeederMakeCommand

func NewSeederMakeCommand(config config.Config) *SeederMakeCommand

func (*SeederMakeCommand) Description

func (receiver *SeederMakeCommand) Description() string

Description The console command description.

func (*SeederMakeCommand) Extend

func (receiver *SeederMakeCommand) Extend() command.Extend

Extend The console command extend.

func (*SeederMakeCommand) Handle

func (receiver *SeederMakeCommand) Handle(ctx console.Context) error

Handle Execute the console command.

func (*SeederMakeCommand) Signature

func (receiver *SeederMakeCommand) Signature() string

Signature The name and signature of the console command.

type SqliteStubs

type SqliteStubs struct {
}

func (SqliteStubs) CreateDown

func (receiver SqliteStubs) CreateDown() string

CreateDown Create down migration content.

func (SqliteStubs) CreateUp

func (receiver SqliteStubs) CreateUp() string

CreateUp Create up migration content.

func (SqliteStubs) UpdateDown

func (receiver SqliteStubs) UpdateDown() string

UpdateDown Update down migration content.

func (SqliteStubs) UpdateUp

func (receiver SqliteStubs) UpdateUp() string

UpdateUp Update up migration content.

type SqlserverStubs

type SqlserverStubs struct {
}

func (SqlserverStubs) CreateDown

func (receiver SqlserverStubs) CreateDown() string

CreateDown Create down migration content.

func (SqlserverStubs) CreateUp

func (receiver SqlserverStubs) CreateUp() string

CreateUp Create up migration content.

func (SqlserverStubs) UpdateDown

func (receiver SqlserverStubs) UpdateDown() string

UpdateDown Update down migration content.

func (SqlserverStubs) UpdateUp

func (receiver SqlserverStubs) UpdateUp() string

UpdateUp Update up migration content.

type StructHelper

type StructHelper struct {
	StructHelperInterface
	Db        *gormio.DB
	DefaultDb string
}

func NewStructHelper

func NewStructHelper(conf config.Config) (helper *StructHelper, err error)

func (StructHelper) GetTableStruct

func (s StructHelper) GetTableStruct(database, table string) []*Column

func (StructHelper) StringColumns

func (s StructHelper) StringColumns(cols []*Column) string

type StructHelperInterface

type StructHelperInterface interface {
}

type Stubs

type Stubs struct {
}

func (Stubs) Model

func (r Stubs) Model() string

func (Stubs) Observer

func (r Stubs) Observer() string

func (Stubs) Seeder

func (r Stubs) Seeder() string

type TableGuesser

type TableGuesser struct {
}

func (TableGuesser) Guess

func (receiver TableGuesser) Guess(migration string) (string, bool)

Guess Attempt to guess the table name and "creation" status of the given migration, return table, create.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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