Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectionManager ¶
type ConnectionManager struct {
// contains filtered or unexported fields
}
func CreateConnectionManager ¶
func CreateConnectionManager( dsnManager DSNManager, ctx context.Context, ) (*ConnectionManager, error)
func (*ConnectionManager) Destroy ¶
func (connManager *ConnectionManager) Destroy()
func (*ConnectionManager) GetConnection ¶
func (connManager *ConnectionManager) GetConnection() (*sqlx.Conn, error)
We try to use a single connection, instantiated when DBClient is instantiated This will either return that existing connection, or create a new one if that got dropped
func (*ConnectionManager) GetFlavor ¶
func (connManager *ConnectionManager) GetFlavor() DBFlavor
func (*ConnectionManager) UseDatabase ¶
func (connManager *ConnectionManager) UseDatabase(databaseName string) error
type DSNManager ¶
type DSNOptions ¶
type DSNOptions struct {
Flavor DBFlavor
Host string
DatabaseName string
User string
Password string
Port uint
// Only works in MySQL
SafeMode bool
AdditionalOptions map[string]string
}
func (*DSNOptions) GetDSN ¶
func (connOptions *DSNOptions) GetDSN() (string, error)
func (*DSNOptions) GetFlavor ¶
func (connOptions *DSNOptions) GetFlavor() DBFlavor
func (*DSNOptions) IsSafeMode ¶
func (connOptions *DSNOptions) IsSafeMode() bool
func (*DSNOptions) SetDatabase ¶
func (connOptions *DSNOptions) SetDatabase(databaseName string)
func (*DSNOptions) Validate ¶
func (connOptions *DSNOptions) Validate() error
Click to show internal directories.
Click to hide internal directories.