gorm

package
v0.7.7 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrConnectionNotFound = errors.New("connection not found")
)

Functions

This section is empty.

Types

type Config

type Config interface {
	// SetConnMaxIdleTime configures the sql.DB setting of the same name
	// (default: 0 - no expiration)
	SetConnMaxIdleTime(maxIdle time.Duration) Config
	// SetConnMaxLifetime configures the sql.DB setting of the same name
	// (default: 0 - no expiration)
	SetConnMaxLifetime(maxLifetime time.Duration) Config
	// SetMaxIdleConns configures the sql.DB setting of the same name
	// (default: 2)
	SetMaxIdleConns(maxIdle int) Config
	// SetMaxOpenConns configures the sql.DB setting of the same name
	// (default: 0 - unlimited)
	SetMaxOpenConns(maxOpen int) Config
	// SetSlowThreshold specifies the corresponding logger.Config setting
	SetSlowThreshold(threshold time.Duration) Config
	// SetIgnoreRecordNotFoundError specifies the corresponding logger.Config setting
	SetIgnoreRecordNotFoundError(ignore bool) Config
	// SetParameterizedQueries specifies the corresponding logger.Config setting
	SetParameterizedQueries(parameterized bool) Config
	// SetLogLevel specifies the corresponding logger.Config setting
	SetLogLevel(level logger.LogLevel) Config
	// contains filtered or unexported methods
}

Config is a buildable interface for configuring the sql.DB and logger.Config settings used by Gorm and SQL drivers

func NewConfig

func NewConfig() Config

NewConfig constructs a new buildable Config instance

Jump to

Keyboard shortcuts

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