mysqldb

package
v0.0.0-...-4215923 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDBlog

func GetDBlog(ignoreRecordNotFoundError bool) logger.Interface

GetDBlog 获取默认logger

Types

type DbLog

type DbLog struct {
}

DbLog ...

func (DbLog) Write

func (lg DbLog) Write(p []byte) (n int, err error)

Write ...

type MySqlDB

type MySqlDB struct {
	*gorm.DB
}

MySqlDB ...

func OnInitDBOrm

func OnInitDBOrm(dataSourceName string, ignoreRecordNotFoundError bool) (orm *MySqlDB)

OnInitDBOrm init MySqlDB

func (*MySqlDB) Commit

func (i *MySqlDB) Commit(db *gorm.DB)

Commit 自动提交(如果有错,Rollback)

func (*MySqlDB) IsNotFound

func (i *MySqlDB) IsNotFound(errs ...error) bool

IsNotFound 判断错误是否未找到

func (*MySqlDB) OnDestoryDB

func (i *MySqlDB) OnDestoryDB()

OnDestoryDB destorydb

func (*MySqlDB) OnGetDBOrm

func (i *MySqlDB) OnGetDBOrm(dataSourceName string, ignoreRecordNotFoundError bool) *gorm.DB

OnGetDBOrm get gorm.db

func (*MySqlDB) RecordNotFound

func (i *MySqlDB) RecordNotFound() bool

RecordNotFound check if returning ErrRecordNotFound error

Jump to

Keyboard shortcuts

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