orm

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Module is default connection to PostgreSQL
	Module = module.Module{
		{Constructor: NewDefaultConfig},
		{Constructor: NewConnection},
	}

	// InSlice alias
	InSlice = types.InSlice
	// ErrNoRows alias
	ErrNoRows = pg.ErrNoRows
	// ErrEmptyConfig when given empty options
	ErrEmptyConfig = errors.New("database empty config")
	// ErrEmptyLogger when logger not initialized
	ErrEmptyLogger = errors.New("database empty logger")
)

Functions

func NewConnection added in v0.5.0

func NewConnection(opts *Config) (db *pg.DB, err error)

New database connection

Types

type Config

type Config = struct {
	Addr     string
	User     string
	Password string
	Database string
	Debug    bool
	PoolSize int
	Logger   *zap.SugaredLogger
}

Config alias

func NewDefaultConfig added in v0.5.0

func NewDefaultConfig(v *viper.Viper, l *zap.Logger) *Config

Jump to

Keyboard shortcuts

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