integrationtest

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2021 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 interface {
	Query(ctx context.Context, result interface{}, filter sqlgen.Filter, options *sqlgen.SelectOptions) error
	QueryRow(ctx context.Context, result interface{}, filter sqlgen.Filter, options *sqlgen.SelectOptions) error
	InsertRow(ctx context.Context, row interface{}) (sql.Result, error)
	UpsertRow(ctx context.Context, row interface{}) (sql.Result, error)
	UpdateRow(ctx context.Context, row interface{}) error
	DeleteRow(ctx context.Context, row interface{}) error
}

DB is an interface that satisfies both sqlgen.DB and LiveDB

type DBGenerator

type DBGenerator struct {
	Name      string
	Generator func(t *testing.T) (db DB, sqlDB *sql.DB, close func())
}

DBGenerator is a struct that contains the ability to build a database.

func NewDBGenerators

func NewDBGenerators(dbSetup func(testDB *testfixtures.TestDatabase, schema *sqlgen.Schema) error) []DBGenerator

NewDBGenerators is a function that will return a list of database "generators" which own the lifecycle of a database (both live and sqlgen)

Jump to

Keyboard shortcuts

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