database

package
v0.0.0-...-714bc2e Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultMaxIdleConns default of db.MaxIdleConns
	DefaultMaxIdleConns = 200
	// DefaultConnMaxIdleTime default of db.ConnMaxIdleTime
	DefaultConnMaxIdleTime = 3 * time.Second
)

Variables

View Source
var (
	// ErrorInvaildDsn invalid addrs
	ErrorInvaildDsn = errors.New("invalid dsn of database")
	// ErrorDatabaseNil db is not initialized or closed
	ErrorDatabaseNil = errors.New("database is not ready")
)

Functions

This section is empty.

Types

type Options

type Options struct {
	// Address 连接地址
	Address string
	// MaxIdleConns 连接池空闲连接数。default: DefaultMaxIdleConns
	MaxIdleConns int
	// ConnMaxIdleTime 连接最大空闲时间,超时则清理。default: DefaultConnMaxIdleTime
	ConnMaxIdleTime time.Duration
	// MaxOpenConns 连接池最大连接数
	// <= 0 means unlimited
	MaxOpenConns int
}

Options .

Directories

Path Synopsis
orm

Jump to

Keyboard shortcuts

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