database

package
v0.0.0-...-7c51b95 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2021 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Default     string `json:"default" yaml:"default"`
	Connections map[string]struct {
		Host     string `json:"host" yaml:"host"`
		Database string `json:"database" yaml:"database"`
		Username string `json:"username" yaml:"username"`
		Password string `json:"password" yaml:"password"`
		Charset  string `json:"charset" yaml:"charset"`
	} `json:"connections" yaml:"connections"`
	Pool struct {
		MaxIdle       int `json:"max_idle" yaml:"max_idle"`
		MaxConnection int `json:"max_connection" yaml:"max_connection"`
		MaxLifetime   int `json:"max_lifetime" yaml:"max_lifetime"`
	}
	Debug     bool `json:"debug" yaml:"debug"`
	Migration struct {
		Path string `json:"path" yaml:"path"`
	} `json:"migration" yaml:"migration"`
}

type DB

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

func New

func New(config *Configuration) *DB

func (*DB) Close

func (db *DB) Close(connection string)

func (*DB) Connection

func (db *DB) Connection(conn string) *connection

数据库连接

func (*DB) ConnectionDB

func (db *DB) ConnectionDB(conn string) *gorm.DB

func (*DB) ConnectionNewDB

func (db *DB) ConnectionNewDB(conn string) *gorm.DB

type MigrateCommand

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

func NewMigration

func NewMigration(config *Configuration) *MigrateCommand

func (*MigrateCommand) CobraCmd

func (m *MigrateCommand) CobraCmd() *cobra.Command

func (*MigrateCommand) Run

func (m *MigrateCommand) Run(root contract.BaseCommand, cmd *cobra.Command, args []string)

type Provider

type Provider struct {
	kernel.BaseProvider
}

func (*Provider) Boot

func (p *Provider) Boot()

func (*Provider) Name

func (p *Provider) Name() string

func (*Provider) Register

func (p *Provider) Register()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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