database

package
v0.0.0-...-5d42de7 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecDBStatements

func ExecDBStatements(hostName string, databaseName string, user string, password string, driverName string, statements []string) error

ExecDBStatements will create the connection, execute statements and close the connection

Types

type Database

type Database struct {
	Connection *sql.DB
}

Database will provide the postgres database configuration

func NewDatabase

func NewDatabase(hostName string, databaseName string, user string, password string, driverName string) (*Database, error)

NewDatabase will create a database connection and provide the connection instance

func (*Database) CloseDatabaseConnection

func (d *Database) CloseDatabaseConnection() error

CloseDatabaseConnection will close the database connection

func (*Database) ExecuteStatements

func (d *Database) ExecuteStatements(statements []string) []error

ExecuteStatements will list of statements

func (*Database) WaitForDatabase

func (d *Database) WaitForDatabase(attempts int) bool

WaitForDatabase will ping the database until it becomes accessible

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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