utils

package
v0.0.0-...-72a5972 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MigratePG

func MigratePG(sourceDir, host, user, password, database string, isSSL bool) error

MigratePG updates an existing Postgres database to have the most up-to-date schema.

Types

type DB

type DB interface {
	Close() error
	Error() error

	Prepare(string) *sql.Stmt
	QueryRow(string, ...interface{}) *sql.Row

	RowScan(*sql.Row, ...interface{})

	StmtExec(*sql.Stmt, ...interface{}) sql.Result
}

DB is a wrapper around the standard database/sql interface that provides error handling logic, allowing for easier code maintenance in application code.

func InitializeDB

func InitializeDB() (DB, error)

InitializeDB opens a new DB connection with the database and wraps it in Hermes DB helpers.

func NewDB

func NewDB(db *sql.DB) (DB, error)

NewDB creates an new DB from an existing sql/db.

Jump to

Keyboard shortcuts

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