database

package
v0.0.0-...-3a83f38 Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// POSTGRESQL driver
	POSTGRESQL = "postgresql"
	// MYSQL driver
	MYSQL = "mysql"
	// SQLITE driver
	SQLITE = "sqlite"
)

Variables

View Source
var (
	Config = Configuration{}
	DB     *sql.DB
)

Config stores database configuration

Functions

func Connect

func Connect()

Connect establishes connection using the chosen driver

func Down

func Down()

Down migrate down

func Up

func Up()

Up migrate up

Types

type Configuration

type Configuration struct {
	RDBMS      string       `json:"rdbms"`
	Host       string       `json:"host"`
	Port       string       `json:"port"`
	Database   string       `json:"database"`
	User       string       `json:"user"`
	Password   string       `json:"password"`
	Sslmode    string       `json:"sslmode"`
	Definition []Definition `json:"definition"`
}

type Definition

type Definition struct {
	Table Table `json:"table"`
}

type Table

type Table struct {
	Name   string `json:"name"`
	Create string `json:"create"`
	Delete string `json:"delete"`
	Flavor string `json:"driver"`
}

Jump to

Keyboard shortcuts

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