sqldb

package
v0.0.0-...-f67571d Latest Latest
Warning

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

Go to latest
Published: May 10, 2020 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(ctx context.Context, driver, dataSourceName string, conOpts *ConnectionOptions) (*sqlx.DB, error)

Connect to a database

func Wrap

func Wrap(ctx context.Context, leader, follower *sqlx.DB) (database.Database, error)

Wrap leader and follower sqlx object to one db object this is for easier usage, so user doesn't have to specify leader or follower all exec is going to leader, all query is going to follower

Types

type ConnectionOptions

type ConnectionOptions struct {
	Retry                 int
	MaxOpenConnections    int
	MaxIdleConnections    int
	ConnectionMaxLifetime time.Duration
}

ConnectionOptions list of option to connect to database

Jump to

Keyboard shortcuts

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