dao

package
v0.0.0-...-add256a Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Discard = New(log.New(ioutil.Discard, "", log.LstdFlags), serverConfig{})
	Default = New(log.New(os.Stdout, "\r\n", log.LstdFlags), serverConfig{
		SlowThreshold: 200 * time.Millisecond,
		LogLevel:      logger.Warn,
		Colorful:      true,
	})
	Recorder = traceRecorder{Interface: Default, BeginAt: time.Now()}
)

Functions

func DBFile

func DBFile() string

func GetDB

func GetDB(dbname consts.TenantId) *gorm.DB

GetDB 数据库单例

func GetDBResolver

func GetDBResolver() *SaasDBresolver.DBResolver

func GetSaasDB

func GetSaasDB(dbName consts.TenantId) *gorm.DB

func GormMySQL

func GormMySQL(m config.Mysql) *gorm.DB

GormMySQL 初始化Mysql数据库

func GormSQLLite

func GormSQLLite() *gorm.DB

func InitSaasDBHandler

func InitSaasDBHandler(dbName consts.TenantId) (db *gorm.DB, err error)

func MysqlTables

func MysqlTables(db *gorm.DB)

MysqlTables 注册数据库表专用

func New

func New(writer writer, config serverConfig) logger.Interface

func PaginateScope

func PaginateScope(page, pageSize int, sort, orderBy string) func(db *gorm.DB) *gorm.DB

PaginateScope 分页方法 page 页码 pageSize 每页数量 sort 排序方式 orderBy 排序字段

Types

This section is empty.

Jump to

Keyboard shortcuts

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