Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConnectionPool ¶
func NewConnectionPool(config *ConnectionPoolConfiguration) (*sql.DB, error)
NewConnectionPool initializes a connection pool based on the provided configuration.
Types ¶
type ConnectionPoolConfiguration ¶
type ConnectionPoolConfiguration struct { // Database name DatabaseName string // Database username DatabaseUsername string // Database password DatabasePassword string // TCP hostname. If set, the connection pool will use TCP. Otherwise, it // will use Unix sockets. TcpHost string // Instance connection name. If TcpHost is set, this value will be ignored. InstanceConnectionName string // Maximum number of connections in idle connection pool MaxIdleConns int // Maximum number of open connections to the database MaxOpenConns int // Maximum time that a connection can remain open ConnMaxLifetime time.Duration }
Click to show internal directories.
Click to hide internal directories.