pgsqldb

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 PgSqlDB

type PgSqlDB struct {
	*gorm.DB
}

MySqlDB ...

func OnInitDBOrm

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

OnInitDBOrm init MySqlDB

func (*PgSqlDB) Commit

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

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

func (*PgSqlDB) IsNotFound

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

IsNotFound 判断错误是否未找到

func (*PgSqlDB) OnDestoryDB

func (i *PgSqlDB) OnDestoryDB()

OnDestoryDB destorydb

func (*PgSqlDB) OnGetDBOrm

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

OnGetDBOrm get gorm.db

func (*PgSqlDB) RecordNotFound

func (i *PgSqlDB) 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