datasource

package
v0.0.0-...-89c19b0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Migrate bool
)

Functions

func CreateTableData

func CreateTableData(db *gorm.DB) error

Types

type Db

type Db struct {
	Conn *gorm.DB
}

Db gormDB

func (*Db) Connect

func (d *Db) Connect() error

Connect 初始化数据库配置

func (*Db) DB

func (d *Db) DB() *gorm.DB

DB 返回DB

func (*Db) DropAndCreateSingleTb

func (d *Db) DropAndCreateSingleTb(Tb interface{})

func (*Db) DropAndCreateTb

func (d *Db) DropAndCreateTb()

type IDb

type IDb interface {
	//Connect 初始化数据库配置
	Connect() error
	//DB 返回DB
	DB() *gorm.DB
}

IDb 数据库接口定义

Jump to

Keyboard shortcuts

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