gocodb

package module
v0.0.0-...-7428514 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: MIT Imports: 6 Imported by: 0

README

gocodb

Library to import and use easier driver configuration for database

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckConnection

func CheckConnection(retry int, driver *Driver) error

CheckConnection try db connection to check connectoin health

func GetConnection

func GetConnection(driver string) (*gorm.DB, error)

GetConnection get database connection within given driver name or shortname

func ImportDrivers

func ImportDrivers(filename string) error

ImportDrivers information in given file as yaml format

Types

type Driver

type Driver struct {
	Name        string `yaml:"name"`
	Engine      string `yaml:"engine"`
	Version     string `yaml:"version"`
	Credentials string `yaml:"credentials"`
	EnvFile     string `yaml:"env_file"`
	IsActive    bool   `yaml:"-"`
}

Driver of a database is all information needed to etablish a db connection

type DriversPool

type DriversPool struct {
	Drivers []Driver `yaml:"drivers"`
}

DriversPool is struct to import from yaml file

Jump to

Keyboard shortcuts

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