testutil

package
v1.0.0-13 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTestDatabase

func CreateTestDatabase(dbPath string, fixtureFiles []string) (*bun.DB, error)

CreateTestDatabase recreates the test database and runs migrations and fixtures as passed in, returning a pointer to the database

func CreateTestDatabasePostgres

func CreateTestDatabasePostgres(dbHost, dbUser, dbName string, migrationFunctions []func(*bun.DB) error, fixtureFiles []string) (*bun.DB, error)

CreateTestDatabasePostgres is similar to CreateTestDatabase but it uses Postgres instead of sqlite, this is needed for testing packages that rely on some Postgres specifuc features (such as table inheritance)

Types

This section is empty.

Jump to

Keyboard shortcuts

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