database

package
v0.0.0-...-771f04f Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2022 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

func Register

func Register(config *config.Config) *Database

func (*Database) AutoMigrate

func (db *Database) AutoMigrate(tables ...interface{}) error

func (*Database) NewDatabase

func (db *Database) NewDatabase(name ...string) *gorm.DB

NewDatabase 单独获取数据库连接

type IDatabase

type IDatabase interface {
	// NewDatabase 获取 DB 实例
	NewDatabase(name ...string) *gorm.DB
	// AutoMigrate 注册数据模型
	AutoMigrate(tables ...interface{}) error
}

Jump to

Keyboard shortcuts

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