sql

package
v0.3.23 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PgSqlWireSet = wire.NewSet(
	GetConfig,
	NewDbConnection,
)

Functions

func NewDbConnection

func NewDbConnection(cfg *Config, logger *zap.SugaredLogger) (*pg.DB, error)

Types

type AuditLog

type AuditLog struct {
	CreatedOn time.Time `sql:"created_on"`
	CreatedBy int32     `sql:"created_by"`
	UpdatedOn time.Time `sql:"updated_on"`
	UpdatedBy int32     `sql:"updated_by"`
}

type Config

type Config struct {
	Addr            string `env:"PG_ADDR" envDefault:"127.0.0.1"`
	Port            string `env:"PG_PORT" envDefault:"5432"`
	User            string `env:"PG_USER" envDefault:""`
	Password        string `env:"PG_PASSWORD" envDefault:""`
	Database        string `env:"PG_DATABASE" envDefault:"orchestrator"`
	ApplicationName string `env:"APP" envDefault:"orchestrator"`
	LogQuery        bool   `env:"PG_LOG_QUERY" envDefault:"true"`
}

func GetConfig

func GetConfig() (*Config, error)

Jump to

Keyboard shortcuts

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