dbtest

package
v0.0.0-...-926d3c4 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListTables

func ListTables(db *pgdb.DB) ([]string, error)

func Run

func Run() bool

Run is a helper function to determine if the current test context requires the database tests to run. `True` indicates that that `-database` flag was set when the tests were run.

func Setup

func Setup() *pgdb.DB

Setup connects to a database for testing purposes. The following OS vars are required:

POSTGRES_URI

func TruncateTables

func TruncateTables(db *pgdb.DB) error

Types

type Suite

type Suite struct {
	suite.Suite
	Database *pgdb.DB
}

Suite defines a struct to be used with a db test suite. You should wrap this in your test with your own type. `type <your-type> dbtest.Suite`

Jump to

Keyboard shortcuts

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