db

package
v0.0.0-...-4f50f5e Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Down

func Down(ctx context.Context, cfg *Config, logger *zap.Logger) error

Down to run the down migrations

func Setup

func Setup(cfg *Config, logger *zap.Logger) error

Setup runs the database migrations upto the current version

Types

type Config

type Config struct {
	Host     string
	Port     int
	User     string
	Password string
	Name     string
	ForceTLS bool
}

type DB

type DB struct {
	*pgx.Conn
}

func GetConnection

func GetConnection(ctx context.Context, cfg *Config, logger *zap.Logger) (*DB, error)

GetConnection creates a new connection if not available or else returns the current connection

func NewConnection

func NewConnection(ctx context.Context, cfg *Config, logger *zap.Logger) (*DB, error)

NewConnection creates and returns a new DB connection

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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