db

package
v0.0.0-...-bf8aa72 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Postgres

type Postgres struct {
	*sqlx.DB
}

Postgres is the primary database for the application.

func Setup

func Setup(lc fx.Lifecycle, config Settings, log *zap.Logger) (Postgres, error)

Setup attempts configure and connect to the database

type Settings

type Settings struct {
	DBName             string
	SSLMode            string
	User               string
	Password           string
	Host               string
	Port               string
	MaxConnections     int
	MaxIdleConnections int
	MaxConnLifetime    time.Duration
}

Config is used to configure a postgres sql server connection

func (*Settings) String

func (c *Settings) String() string

ConnStr returns a postgres connection string

type Tester

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

func NewTester

func NewTester() Tester

func (Tester) GetDB

func (t Tester) GetDB() Postgres

func (Tester) Reset

func (t Tester) Reset() error

func (Tester) Seed

func (t Tester) Seed(r io.Reader) error

Jump to

Keyboard shortcuts

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