database

package
v0.0.0-...-3324a55 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectMySQLDB

func ConnectMySQLDB(connectionString string, newLogger *logger.Interface) *gorm.DB

ConnectMySQLDB connects to MySQL database.

func ConnectPostgresDB

func ConnectPostgresDB(connectionString string, newLogger *logger.Interface) *gorm.DB

ConnectPostgresDB connects to Postgres database.

func ConnectSQLiteDB

func ConnectSQLiteDB(connectionString string, newLogger *logger.Interface) *gorm.DB

ConnectSQLiteDB connects to SQLite database.

Types

type DB

type DB struct {
	// contains filtered or unexported fields
}

DB contains a db connection.

func Connect

func Connect() *DB

Connect connects to the appropriate database.

func Setup

func Setup() *DB

Setup connects to and prepares the database.

func (*DB) AddMissingTableColumns

func (db *DB) AddMissingTableColumns()

AddMissingTableColumns adds missing tables and columns.

func (*DB) Close

func (db *DB) Close()

Close closes database connection.

type DBType

type DBType int

DBType represents the type of the database.

const (
	POSTGRES DBType = iota
	MYSQL
	SQLITE
)

DBType values.

func ToDbType

func ToDbType(ty string) (DBType, error)

ToDbType converts string representation to

func (DBType) String

func (dbType DBType) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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