sqldb

package
v0.0.0-...-e652847 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloseFunction

type CloseFunction func()

CloseFunction is a function with no arg nor return values for closing a resource

type TestDB

type TestDB struct {
	Driver   string
	Dsn      string
	LogFlags qb.LogFlags
	Logger   xbus.Logger
	// contains filtered or unexported fields
}

TestDB holds a test database and provides access to it until its 'Close' function is called

func GetTestDB

func GetTestDB(t testing.TB) *TestDB

GetTestDB creates a test database and returns a TestDB pointing to it

func (*TestDB) Close

func (tdb *TestDB) Close()

Close releases the underlying database

func (*TestDB) GetModelDB

func (tdb *TestDB) GetModelDB(maxConn int) (*model.Model, *yago.DB)

GetModelDB returns a new connection pool to the database

Jump to

Keyboard shortcuts

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