database

package
v0.0.0-...-4b56e16 Latest Latest
Warning

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

Go to latest
Published: May 11, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandDBSeed

type CommandDBSeed struct {
	Logger *logger.Logger
}

CommandDBSeed to apply DB changes.

func (*CommandDBSeed) GetCommand

func (c *CommandDBSeed) GetCommand() cli.Command

GetCommand for the cli to register.

func (*CommandDBSeed) Handle

func (c *CommandDBSeed) Handle(args cli.Args) error

Handle command.

type CommandMakeMigration

type CommandMakeMigration struct {
	Logger *logger.Logger
	// contains filtered or unexported fields
}

CommandMakeMigration to apply DB changes.

func (*CommandMakeMigration) GetCommand

func (c *CommandMakeMigration) GetCommand() cli.Command

GetCommand for the cli to register.

func (*CommandMakeMigration) Handle

func (c *CommandMakeMigration) Handle(args cli.Args) error

Handle command.

type CommandMigrate

type CommandMigrate struct {
	DB       *gorm.DB
	Migrator *Migrator
	Logger   *logger.Logger
}

CommandMigrate to apply DB changes.

func (*CommandMigrate) GetCommand

func (c *CommandMigrate) GetCommand() cli.Command

GetCommand for the cli to register.

func (*CommandMigrate) Handle

func (c *CommandMigrate) Handle(args cli.Args) error

Handle command.

type CommandMigrateReset

type CommandMigrateReset struct {
	Migrator *Migrator
	Logger   *logger.Logger
}

CommandMigrateReset to apply DB changes.

func (*CommandMigrateReset) GetCommand

func (c *CommandMigrateReset) GetCommand() cli.Command

GetCommand for the cli to register.

func (*CommandMigrateReset) Handle

func (c *CommandMigrateReset) Handle(args cli.Args) error

Handle command.

type CommandMigrateRollback

type CommandMigrateRollback struct {
	DB       *gorm.DB
	Migrator *Migrator
	Logger   *logger.Logger
}

CommandMigrateRollback to apply DB changes.

func (*CommandMigrateRollback) GetCommand

func (c *CommandMigrateRollback) GetCommand() cli.Command

GetCommand for the cli to register.

func (*CommandMigrateRollback) Handle

func (c *CommandMigrateRollback) Handle(args cli.Args) error

Handle command.

type Manager

type Manager struct {
	Driver string `di:"Config.Database.Driver"`
	DSN    string `di:"Config.Database.DSN"`
	Debug  bool   `di:"Config.App.Debug"`
	Logger *logger.Logger
	// contains filtered or unexported fields
}

Manager to the database.

func (*Manager) Connect

func (m *Manager) Connect() error

Connect to the database.

func (*Manager) Disconnect

func (m *Manager) Disconnect()

Disconnect from the database.

func (*Manager) GetConnection

func (m *Manager) GetConnection() (*gorm.DB, error)

GetConnection to db.

type Migration

type Migration interface {
	Migrate(tx *gorm.DB) error
	Rollback(tx *gorm.DB) error
}

Migration interface.

type Migrator

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

Migrator engine to work with migrations.

func (*Migrator) Migrate

func (m *Migrator) Migrate(db *gorm.DB) error

Migrate database.

func (*Migrator) Reset

func (m *Migrator) Reset(db *gorm.DB) error

Reset all migrations.

func (*Migrator) Rollback

func (m *Migrator) Rollback(db *gorm.DB) error

Rollback last migration.

func (*Migrator) SetMigrations

func (m *Migrator) SetMigrations(migrations ...Migration)

SetMigrations to run.

type ModelNotFoundError

type ModelNotFoundError struct {
	Model interface{}
	IDs   []interface{}
}

ModelNotFoundError .

func ModelNotFound

func ModelNotFound(model interface{}, ids []interface{}) *ModelNotFoundError

ModelNotFound error constructor.

func (*ModelNotFoundError) Error

func (e *ModelNotFoundError) Error() string

Error returns error message.

type Seeder

type Seeder struct {
	Connection *gorm.DB
}

Seeder engine to populate DB with inital info.

type ServiceProvider

type ServiceProvider struct{}

ServiceProvider struct.

func (*ServiceProvider) Register

func (p *ServiceProvider) Register(application *larago.Application)

Register service.

Jump to

Keyboard shortcuts

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