mysql

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllTableName

type AllTableName struct {
	TableName string `gorm:"table_name"`
}

type Context

type Context = Instance

type Instance

type Instance struct {
	Dsn  string
	Conf jcbaseGo.DbStruct
	Db   *gorm.DB

	Errors []error
	// contains filtered or unexported fields
}

func New

func New(dbConfig jcbaseGo.DbStruct) *Instance

New 获取新的数据库连接

func (*Instance) AddError

func (c *Instance) AddError(err error)

func (*Instance) Debug

func (c *Instance) Debug() *Instance

Debug 设置调试模式

func (*Instance) Error

func (c *Instance) Error() []error

func (*Instance) GetAllTableName

func (c *Instance) GetAllTableName() (tableNames []AllTableName, err error)

GetAllTableName 获取所有表名

func (*Instance) GetDb

func (c *Instance) GetDb() *gorm.DB

GetDb 获取db

func (*Instance) TableName

func (c *Instance) TableName(tableName *string, quotes ...bool) *Instance

TableName 获取表名, param tableName string 表名 param quotes bool 是否加上反单引号

Jump to

Keyboard shortcuts

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