datasource

package
v0.0.0-...-70cb23a Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppName = "datasource"
)

Variables

This section is empty.

Functions

func DB

func DB(context.Context) *gorm.DB

transaction is nil 此处已经断言成db了,可以直接使用

func GetTransactionFromCtx

func GetTransactionFromCtx(ctx context.Context) *gorm.DB

从上下文中获取数据库事务

Types

type TransactionCtxKey

type TransactionCtxKey struct{}

上下文键的类型,用于在上下文中存储事务对象

Jump to

Keyboard shortcuts

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