db

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDB

func GetDB() *gorm.DB

func Init

func Init(dbType string, configFunc func() interface{}, tables ...interface{})

Types

type AbstractDatabase

type AbstractDatabase interface {
	DB() *gorm.DB
	Connect() *gorm.DB
	AutoMigrate(dst ...interface{})
}

type Mysql

type Mysql struct {
	AutoMigrateDisable bool
	MysqlDB            *gorm.DB
	// contains filtered or unexported fields
}

func NewMysql

func NewMysql(autoMigrateDisable bool, config *config.MysqlOptions) *Mysql

func (*Mysql) AutoMigrate

func (my *Mysql) AutoMigrate(dst ...interface{})

AutoMigrate Mysql数据库自动同步结构体

func (*Mysql) Connect

func (my *Mysql) Connect() *gorm.DB

func (*Mysql) DB

func (my *Mysql) DB() *gorm.DB

Jump to

Keyboard shortcuts

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