pgunit

package
v0.0.0-...-cbb1631 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSchemaTableNames

func GetSchemaTableNames(t *testing.T, db pgkit.DB, schema string) []string

GetSchemaTableNames will return the names of all the tables in the public schema.

func TemporaryDatabaseTestCase

func TemporaryDatabaseTestCase(
	t *testing.T,
	db pgkit.DB,
	fn func(*testing.T, pgkit.DB),
)

TemporaryDatabaseTestCase creates a new database and executes the provided function passing it a reference to the newly created database. When the test is complete, the temporary database is destroyed.

func TransactionedTestCase

func TransactionedTestCase(
	t *testing.T,
	db pgkit.DB,
	fn func(*testing.T, pgkit.DataProvider),
)

TransactionedTestCase will execute the provided function with a transaction and rollback once the test is complete. It passes the given *testing.T to the function, so failing in the test function triggers the failure of the outer test.

Types

This section is empty.

Jump to

Keyboard shortcuts

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