database

package
v0.0.0-...-6b4cc3a Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2019 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDatabaseSettingDecoder

func AddDatabaseSettingDecoder()

AddDatabaseSettingDecoder adds a decoder for the database setting format in the config file.

func CloseAllDatabaseHandles

func CloseAllDatabaseHandles()

CloseAllDatabaseHandles closes all database handles. call at end of program to clean up.

func GetDatabaseHandle

func GetDatabaseHandle(dsn string) *sql.DB

GetDatabaseHandle returns the database handle for the specified dsn Or nil if no database handle for the specified dsn exists.

func OpenDatabaseHandles

func OpenDatabaseHandles(conList []ConnectionSettings)

OpenDatabaseHandles works much like OpenNewDatabaseHandle() but takes an entire list of database connections to open

func OpenNewDatabaseHandle

func OpenNewDatabaseHandle(driver string, dsn string) (*sql.DB, error)

OpenNewDatabaseHandle opens and returns a new database handle constructed by the driver denoted by "driver" and targeting the DSN denoted by "dsn"

Types

type ConnectionSettings

type ConnectionSettings struct {
	Driver,
	DSN string
}

ConnectionSettings represents the settings for a database connection

Jump to

Keyboard shortcuts

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