database

package
v0.0.0-...-7a61ab1 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *sql.DB

DB global variable

Functions

func Connect

func Connect(cfg Config)

Connect initializes a connnection to the database thanks to a config object

func MakeMigrations

func MakeMigrations()

MakeMigrations executes the sql migration files

Types

type Config

type Config struct {
	DbUser     string `env:"DB_USER"`
	DbPassword string `env:"DB_PASSWORD"`
	DbHost     string `env:"DB_HOST"`
	DbPort     int    `env:"DB_PORT" envDefault:"5432"`
	DbName     string `env:"DB_NAME"`
}

Config represents the database configuration

Jump to

Keyboard shortcuts

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