db

package
v0.0.0-...-24333fe Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2015 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

DB holds data to create a *sql.DB, as well the *sql.DB instance itself.

func New

func New(connectToDatabase PoolFn, cfg *base.Config) *DB

New *DB with the given pool function and Configuration

func (*DB) Init

func (db *DB) Init() *sql.DB

Init the DB for testing. Creates a new database for testing and runs the migrations against it.

func (*DB) Shutdown

func (db *DB) Shutdown()

Shutdown the DB. Closes all connections and deletes the test database that was created in #Init

type PoolFn

type PoolFn func(url string) *sql.DB

PoolFn should create a *sql.DB with the given URL.

Jump to

Keyboard shortcuts

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