connection

package
v0.0.0-...-e446189 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDatabaseToPool

func AddDatabaseToPool(name string, DB *sqlx.DB)

AddDatabaseToPool add connection to pool

func Get

func Get() (*sqlx.DB, error)

Get get postgres connection

func GetDatabase

func GetDatabase() string

GetDatabase get current database in use

func GetURI

func GetURI(DBName string) string

GetURI postgres connection URI

func MustGet

func MustGet() *sqlx.DB

MustGet get postgres connection

func SetDatabase

func SetDatabase(name string)

SetDatabase set current database in use

Types

type ConnectionPool

type ConnectionPool struct {
	Mtx *sync.Mutex
	DB  map[string]*sqlx.DB
}

ConnectionPool struct

func GetPool

func GetPool() *ConnectionPool

GetPool of connection

Jump to

Keyboard shortcuts

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