connection

package
v0.0.0-...-2a1851d Latest Latest
Warning

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

Go to latest
Published: Sep 14, 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 Pool

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

Pool struct

func GetPool

func GetPool() *Pool

GetPool of connection

Jump to

Keyboard shortcuts

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