pg

package
v0.0.0-...-9bdc4e9 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host            string
	Port            string
	User            string
	Password        string
	Dbname          string
	MaxOpenConns    int
	MaxIdleConns    int
	ConnMaxLifetime time.Duration
}

func (*Config) GetPsqlInfo

func (c *Config) GetPsqlInfo() string

type Connector

type Connector struct {
	// contains filtered or unexported fields
}

Connector is exposed to make the db connection more easier By abstracting the db & config property

func New

func New(config *Config) (*Connector, error)

Open New Connection Initialize New Connector

func (*Connector) GetDB

func (c *Connector) GetDB() (*sqlx.DB, error)

GetDB returns an existing or returns new Connector

Jump to

Keyboard shortcuts

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