setup

package
v1.0.240 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultQueryTimeout = 30 * time.Second

Functions

func DefaultGormConfig

func DefaultGormConfig() *gorm.Config

func InitDB

func InitDB(connection string, migrateOpts *migrate.MigrateOptions) (*dutyContext.Context, error)

func Migrate

func Migrate(connection string, opts *migrate.MigrateOptions) error

func NewDB

func NewDB(connection string) (*sql.DB, error)

func NewGorm

func NewGorm(connection string, config *gorm.Config) (*gorm.DB, error)

creates a new Gorm DB connection using the global pgx connection pool, must be called after NewPgxPool

func NewPgxPool

func NewPgxPool(connection string) (*pgxpool.Pool, error)

func SetupDB

func SetupDB(connection string, migrateOpts *migrate.MigrateOptions) (gormDB *gorm.DB, pgxpool *pgxpool.Pool, err error)

SetupDB runs migrations for the connection and returns a gorm.DB and a pgxpool.Pool

Types

This section is empty.

Jump to

Keyboard shortcuts

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