xpgtst

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Conn

func Conn(t testing.TB) *xpg.Conn

Conn creates new real connection to database and t.SkipNow() if is not parsable or missing

Types

type TestingConn

type TestingConn struct {
	// contains filtered or unexported fields
}

TestingConn is struct helping to keep conn to database and help to close it when needed.

func NewConn

func NewConn(t testing.TB) *TestingConn

NewConn creates new testing connection.

func (*TestingConn) Close

func (t *TestingConn) Close()

Close will close connection to db.

func (*TestingConn) Get

func (t *TestingConn) Get() *pg.DB

Get return conn to database which is type orm.DB

type TestingConnTx

type TestingConnTx struct {
	// contains filtered or unexported fields
}

TestingConnTx is struct helping to keep conn to database and help to close it when needed.

func NewConnTx

func NewConnTx(t testing.TB) *TestingConnTx

NewConnTx creates new testing connection. Also create transaction which will be closed one .Close() is called

func (*TestingConnTx) Close

func (t *TestingConnTx) Close()

Close will close connection to db and rollback transaction

func (*TestingConnTx) Get

func (t *TestingConnTx) Get() *pg.Tx

Get return conn to database which is type orm.DB

Jump to

Keyboard shortcuts

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