postgres

package
v0.0.0-...-dcd212b Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(url string, cfg DBCfg) (*sql.DB, error)

func Tx

func Tx(ctx context.Context, db *sql.DB, do func(tx *sql.Tx) error) error

Types

type DBCfg

type DBCfg struct {
	MaxIdleConns    null.Int
	MaxOpenConns    null.Int
	ConnMaxLifetime null.Int
}

type GormDB

type GormDB struct {
	DB *gorm.DB
}

func NewGormDB

func NewGormDB() *GormDB

func (*GormDB) Close

func (g *GormDB) Close() error

func (*GormDB) Open

func (g *GormDB) Open(uri string, cfg *gorm.Config) error

Jump to

Keyboard shortcuts

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