db

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PostgresDriver = "nrpgx"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	Connect() error
	Close() error
	Get() *gorm.DB
	WithTrx(ctx context.Context, callback trxCallback) (err error)
}

func Get

func Get() DB

func NewDB

func NewDB(opts *DBOpts) DB

type DBOpts

type DBOpts struct {
	URL                   string
	MaxIdleConnection     int
	MaxActiveConnection   int
	MaxConnectionLifetime time.Duration
	DriverName            string
}

Jump to

Keyboard shortcuts

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