gormKit

package
v3.1.112 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigurePool

func ConfigurePool(db *gorm.DB, maxIdleConns, maxOpenConns int, connMaxLifetime time.Duration) error

ConfigurePool 连接池

func ConfigurePoolWithSqlDB

func ConfigurePoolWithSqlDB(sqlDB *sql.DB, maxIdleConns, maxOpenConns int, connMaxLifetime time.Duration)

ConfigurePoolWithSqlDB 连接池

func GetDefaultLogger

func GetDefaultLogger() logger.Interface

GetDefaultLogger 默认的Logger.

PS: 参考了 logger.Default.

func NewDB

func NewDB(dialector gorm.Dialector, opts ...gorm.Option) (*gorm.DB, error)

NewDB

@param dialector 方言(针对不同的数据库; 不能为nil!)

Types

This section is empty.

Jump to

Keyboard shortcuts

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