Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultMaxIdleConnections = 10 DefaultMaxOpenConnections = 100 )
Functions ¶
Types ¶
type Option ¶ added in v0.6.0
type Option func(*Options)
func WithEnableAutoMigrate ¶ added in v0.6.0
WithEnableAutoMigrate sets the flag to enable auto migrate.
func WithMaxIdleConns ¶ added in v0.6.0
WithMaxIdleConns sets the maximum number of connections in the idle connection pool.
func WithMaxOpenConns ¶ added in v0.6.0
WithMaxOpenConns sets the maximum number of open connections to the database.
func WithSource ¶ added in v0.6.0
WithSource sets the database connection string.
type Options ¶
type Options struct {
// Source is the database connection string.
Source string
// MaxIdleConns is the maximum number of connections in the idle connection pool.
MaxIdleConnections int
// MaxOpenConns is the maximum number of open connections to the database.
MaxOpenConnections int
// EnableAutoMigrate is the flag to enable auto migrate.
EnableAutoMigrate bool
}
Click to show internal directories.
Click to hide internal directories.